Solving 0-1 knapsack problems based on amoeboid organism algorithm
1. Solving 0-1 knapsack problems
based on amoeboid organism
algorithm
Xiaoge Zhang, Shiyan Huang, Yong Hu, Yajuan
Zhang, Sankaran Mahadevan, Yong Deng
Juan José Miramontes Sandoval
Modelos de Sistemas de Software
1
2. Tabla de Contenido
• 0-1 Knapsack problem
• Amoeboid organism
• Proposed method
▫ Example with 4 items
▫ Example with 8 items
• Experimental results
• Conclusiones
2
3. 0-1 Knapsack Problem
Given a set of items, each with
a weight and a value, determine
the count of each item to
include in a collection so that
the total weight is less than or
equal to a given limit and the
total value is as large as
possible.
3
K. Pepper. Nakagaki. (2007). Knapsack Taken from:
http://en.wikipedia.org/wiki/Knapsack_problem
Combinatorial optimization problem
5. 0-1 Knapsack Problem
This model is widely used in real-life applications:
• Capital budgeting problems
• Loading problems
• Resource allocation
• Project selection problems
and can be found as a sub problem of other more
general models
5
6. Amoeboid organism
6
P. Monzon. Alimentación Ameba. Taken
from: http://vidadeamebas.blogspot.mx/
• Is a type of cell or organism
which has the ability to alter
its shape.
• Lacking cell wall.
• Capture food through
movement.
7. Proposed method
• Recently, it is shown that an
amoeboid organism can find the
shortest path between two
selected points in a labyrinth.
A new method using the amoeboid organism
model is propose to solve the 0-1 knapsack
problem
7
T. Nakagaki. (2001). Tracking
the shortest path in a maze by
the plasmodium.
Effective method to solve optimization problems
9. Proposed method
Example:
Knapsack capacity: W = 6
vj is the value of item j
wj is the weight of item j
9
j 1 2 3 4
vj 40 15 20 10
wj 4 2 3 1
10. Proposed method
1.- Converting the 0-1
knapsack problem as the
longest path problem:
10
11. 2.- Transforming the longest path problem into
the shortest path problem:
11
Proposed method
12. Proposed method
2.- Transforming the longest
path problem into the
shortest path problem:
12
13. 3.- Finding the shortest path based on the amoeboid
organism algorithm:
Step 1. Remove the edges with conductivity equal to zero.
Step 2. Calculate the pressure of each node using each node’s
current conductivity and length.
Step 3. Use the pressure of each node obtained from step 2 to
calculate each node’s conductivity.
Step 4. Judge whether each edge’s conductivity is 1, if not, go to
step 5; otherwise go to step 7.
Step 5. According to the current flux and conductivity, calculate
the flux and conductivity next time.
Step 6. Return to step 1.
Step 7. Get the result and the algorithm is over.
13
Proposed method
14. • According to the network converting algorithm
shown previously, there are 퐖 + ퟏ ∗ 풏 + ퟐ
items in the converted network.
• For the amoeboid organism algorithm,
regardless of the algorithm’s outer iterations, its
main time is spent on solving the linear
equations and its complexity is 푶(풏ퟑ)
Then, the complexity of the of the proposed
method is: 퐎 ( 푾 + ퟏ ∗ 풏 + ퟐ)ퟑ = 푶(풏ퟑ)
14
Complexity of the proposed method
15. Proposed method
Example with 8 items:
Knapsack capacity: W = 8
vj is the value of item j
wj is the weight of item j
15
j 1 2 3 4 5 6 7 8
vj 83 14 54 79 72 52 48 62
wj 3 2 3 2 1 2 2 3
19. Experimental results
19
Result of knapsack problem with 8 Items:
J 1 2 3 4 5 6 7 8
vj 83 14 54 79 72 52 48 62
wj 3 2 3 2 1 2 2 3
Six test problems with different dimensions are used to study
the performance of the proposed method:
20. Conclusions
20
• Based on amoeboid organism algorithm and the
network converting algorithm, a new method is
proposed to solve classical 0-1 knapsack
problems.
• Using benchmark problems to test the amoeboid
organism algorithm, the computational results
demonstrate the efficiency of the presented
approach.
21. References
• Zhang, X., Huang, S., Hu, Y., Zhang, Y., Mahadevan, S.,
& Deng, Y. (2013). Solving 0-1 knapsack problems based
on amoeboid organism algorithm. Applied Mathematics
and Computation, 219(19), 9959–9970.
doi:10.1016/j.amc.2013.04.023
21