Download Procedure 4

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Location arithmetic wikipedia , lookup

Addition wikipedia , lookup

Elementary mathematics wikipedia , lookup

Lattice model (finance) wikipedia , lookup

Transcript
Optimization of order-picking
using a revised minimum spanning
table method
盧坤勇
國立聯合大學電子工程系
Minimum spanning tree : MST
Problem statement:
Given a connected graph
G = (V, E) ,
where V={v0, v1, …, vn-1} is the set of
vertices and E V × V is the set of edges.
MST is a connected sub-graph of G of
minimum cost with no cycles.
Traditional MST solution
Linear programming method
Integer programming
Min
C
i j
S.T:

i j
ij
xij
xij   x ji ,  j  G
i j
xij  1 ,  (i, j )  E
xij  x ji  1 ,  (i, j )  E
xij  0 , 1 , i  j , i , j  G
Some well-known heuristic
algorithms
Kruskal, 1956
Prim, 1959
Sollin, 1965
Revised MST algorithm(cont.)
Step 1: listing the cost relationships of vertices by two
dimensional matrices( n × n matrices)
Step 2: choosing the minimum cost for each row and
marking the minimum one from choose cost (e.g. Cij)
Step 3: connecting the vertices of xi and xj and deleting the
ith row and jth column from the matrices
Step 4: repeating step 2 and 3, until deleting all rows and
columns, or all vertices are selected
Revised MST algorithm(cont.)
Step 5: detecting and marking the results by isolated node,
tree, and cycle
5-1 : if single tree only exists, stop
5-2 : if a cycle tree exists, then de-cycling in a tree with
minimum cost
Step 6: connecting all isolated nodes and trees by some
heuristic rules: e.g. Branch and Bound, GA, etc.
Example
Step 1
X1
X2
X3
X4
X5
X6
X7
X1 X2 X3 X4 X5 X6 X7
*
9
8
4
5
9
4
9
*
4
6
4
9
9
3
4
*
2
3
5
4
4
8
5
*
1
7
8
5
9
8
8
*
1
4
3
4
2
7
3
*
6
3
4
8
5
9
4
*
Example
Step 2
X1
X2
X3
X4
X5
X6
X7
Minimum cost / row
X1 X2 X3 X4 X5 X6 X7
*
9
8
4
5
9
4
9
*
4
6
4
9
9
3
4
*
2
3
5
4
4
8
5
*
1
7
8
5
9
8
8
*
1
4
3
4
2
7
3
*
6
3
4
8
5
9
4
*
4
4
2
1
1
2
3
Example (cont.)
Step 3
X1
X2
X3
X4
X5
X6
X7
X1 X2 X3 X4 X5 X6 X7
*
9
8
4
5
9
4
9
*
4
6
4
9
9
3
4
*
2
3
5
4
4
8
5
* 11 7
8
5
9
8
8
*
1
4
3
4
2
7
3
*
6
3
4
8
5
9
4
*
4
4
2
1
1
2
3
x4→x5
Example (cont.)
Step 4
X1
X2
X3
X4
X5
X6
X7
X1 X2 X3 X4 X5 X6 X7
*
9
8
4
5
9
4
9
*
4
6
4
9
9
3
4
*
2
3
5
4
4
8
5
* 11 7
8
5
9
8
8
* 12 4
3
4
2
7
3
*
6
3
4
8
5
9
4
*
4
4
2
1
1
2
3
x4→x5
x5→x6
Example (cont.)
Step 4
X1
X2
X3
X4
X5
X6
X7
X1 X2 X3 X4 X5 X6 X7
*
9
8
4
5
9 46
9
*
4
6
4
9
9
3
4
* 23 3
5
4
4
8
5
* 11 7
8
5
9
8
8
* 12 4
3
4 24 7
3
*
6
35 4
8
5
9
4
*
4
4
2
1
1
2
3
x1→x7
Isolated
vertex
x3→x4
x4→x5
x5→x6
x6→x3
x7→x1
Example (cont.)
Step 5
Vertex
x1 x2
index
Sequence
6 7
Destination x7 x2
Cycle index 2 3
x3
x4
x5
x6 x7
3
x4
1
1
x5
1
2
x6
1
4 5
x3 x1
1 2
Results:
Two cycles: x4-x5-x6-x3, x7-x1
One isolated vertex
Example (cont.)
Step 6
6-1 de-cycling
x4 → x5 →x6 →x3 →
x4 → x5 →x6 →x3
x1
x7
x7→x1
Example (cont.)
Step 6
6-2 connecting
1. choosing isolated vertex firstly
x4
x2
x3
6
8
4
4
x2
x1
x7
9
9
9
4
Alternative solutions: x2→x3, x3→x2, x7→x2
Example (cont.)
Step 6
2. Connecting results
x2 → x3 → x4 → x5 → x6
x4 → x5 → x6 → x3 → x2
x1 → x7 → x2
Example (cont.)
Step 6
3. Connecting other trees
{x1,x7,x2} , {x4,x5,x6,x3}
x2
x3
x4
6
*
x1
*
3
Minimum cost
Alternative solutions: x3→x1
Example (cont.)
Step 6
4. Connecting results
x4 → x5 → x6 → x3 →x1 → x7 → x2
Total cost : 15
5. Optimizing the results by using Branch and
Bound or GA algorithms
Application of GA to optimize
the generalized results
Procedure 1 :Initialize the population
Procedure 2 :Evaluate the fitness
Procedure 3 :Parents selection
Procedure 4 :Genetic operation
Application of GA to optimize
the generalized results(cont.)
Procedure 1 :Initialize the population
Step1. Collect the groups against the results of
MST and give a sequence number, ex :
G1={2},
G2={1,7},
G3={4,5,6,3}
Step2. Initialize parameters : index q=1, a
population size s and population P = {Ø }.
Step3. Randomly produce a integer number Pq to
represent the group , ex : a number 1
represents the group G1.
Application of GA to optimize
the generalized results (cont.)
Procedure 1 :Initialize the population
Step4. If Pq is feasible, go to step 5, or else go to
step 3.
Step5. If Pq is different from any previous
individuals, then P = P + {Pq} , q=q+1, or
else go to step 3.
Step6. If q > s, then P = {p1, p2, …, Ps} is the initial
population and stop; or else go to step3.
Application of GA to optimize
the generalized results (cont.)
Procedure 2 : Evaluate the fitness
Step 1. Initialize a constant c, decrement rate d and
evaluation value E.
Step 2. Order the chromosomes in the decreasing
order of evaluation value.
Step 3. Based on E, calculate the fitness value Fi,
which starts at c, ane reduces linearly with
decrement rate r, Fi = c+ (i-1) r, i = (1,2,…,s)
where s is the size of the population.
Application of GA to optimize
the generalized results (cont.)
Procedure 3 : Parents selection
s the
Step 1. Compute the fitness value of all
population members, Fsum =  f i ,s is the
i 1
population size.
Step 2. Initialize, index i = 0 and a counter F = 0.
Step 3. Randomly generate a real number f [0, Fsum].
Step 4. i = i + 1, F = F + fi .
Application of GA to optimize
the generalized results (cont.)
Procedure 3 : Parents selection
Step 5. If F > f, then return selected position i and
stop; or else go to step 4.
Step6 . Select the first chromosome if n is smaller
than or equal to the sum of cumulative
probability of proceeding chromosomes.
Application of GA to optimize
the generalized results (cont.)
Procedure 4 : Genetic operation
Step 1. Generate a bit string.
Step 2. Check those numbers of parent1 against the
ordered list of the bit string.
Step 3. If those numbers against digit 1 from parent1,
move those numbers from parent1 to offspring
at the same position..
Application of GA to optimize
the generalized results (cont.)
Procedure 4 : Genetic operation
Step 4. Check those numbers against digit 0 from
parent1 and then find those numbers occurring
on parent2.
Step5 . Move those numbers to unfilled positions of
the offspring in the same sequence of parent2.
Application of GA to optimize
the generalized results (cont.)
Example : crossover operation
Bit string 1 0 0 1 0 1 0 0 1 1
Parent1
7 4 8 1 3 6 9 10 2 5
Offspring 7 3 8 1 10 6 4 9 2 5
Parent2
3 5 2 8 7 10 4 1 6 9
Application of GA to optimize
the generalized results (cont.)
Example : mutate operation
Parent1
5 4 8 | 1 7 2 3 | 10 2 5
Offspring 5 4 8 | 3 7 2 1 | 10 2 5