You are on page 1of 6

GA FOR TSP

It is enough we use 1-5-3-4-2 instead of 1-5-3-4-2-1, if we compute Z including the distance


between 2-1 as well. Note that 1-5-3-4-2 can also be used for flow shop (permutation)
scheduling.

Crossover Operator

a) Partially mapped crossover (PMX) operator


P1: 1-5-3-4-2
P2: 2-4-3-1-5

Formation of C1: 1-5-3-4-2 ⇒ 4-5-3-1-2

Formation of C2: 2-4-3-1-5 ⇒ 2-1-3-4-5

b) Order based crossover operator


Formation of C1: ( )-( )-3-1-( ) ⇒ 5-4-3-1-2 …..Filled up in the relative order from P1
[-3-1- inherited from P2]

Formation of C1 : ( )-( )-3-1-( ) ⇒ 2-1-3-4-5 …. Filled up in the relative order from P1


[-3-1- inherited from P1 ]

NOTE : Inheritance can be from non-continuous genes. For example, we can choose genes 2
and 4, instead of genes 3 and 4, chosen as above.

Mutation/Local Search

1-5-3-4-2

Insertion : 1-5-3-4-2 ⇒ 5-3-1-4-2

Swap : 1-5-3-4-2 ⇒ 3-5-1-4-2

VRP ( with 3 vehicles, 10 customers)

3 2 5 1 5 3 2 4 6 9 10 7 8

4 3 3 5 2 10 3 1 8 7 9 6 4

Crossover Operator: sub chromosome 1


4 2 5 1 5 3 2 4 6 9 10 7 8

3 3 3 5 2 10 3 1 8 7 9 6 4

After repairing the sub chromosome 1

4 1 5 1 5 3 2 4 6 9 10 7 8

OR

4 2 4 5 2 10 3 1 8 7 9 6 4

4 2 4

Crossover of sub chromosome 2 is the same for TSP

Hence 4 children can be generated.


Check for feasibility, especially with respect to load ?
Here : mutation is done by swap can help us to ensure load feasibility, and insertion within
vehicle tour is good.
Fixed Charge Transportation problem

1 2 3
100
100 200 300

4 5 6
150
700 800 900

7 8 9
250
400 500 600

75 275 150

Min Z = ∑𝑖 ∑𝑗 𝐹𝑖𝑗 ∗ 𝛿𝑖𝑗 + ∑𝑖 ∑𝑗 𝐶𝑖𝑗 ∗ 𝑋𝑖𝑗

∑ 𝑋𝑖𝑗 = 𝐷𝑗 ; ∑ 𝑋𝑖𝑗 = 𝑆𝑖
𝑖 𝑗
𝑋𝑖𝑗 ≤ 𝑀𝑖𝑗 ∗ 𝛿𝑖𝑗 ; 𝑤ℎ𝑒𝑟𝑒 𝑀𝑖𝑗 = 𝑚𝑖𝑛 {𝑆𝑖 , 𝐷𝑗 }

Note:

1. When 𝛿𝑖𝑗 is set to 0 ≤ 𝛿𝑖𝑗 ≤ 1 , we have


𝑋𝑖𝑗
𝛿𝑖𝑗 = 𝑚𝑖𝑛 {𝑆𝑖 ,𝐷𝑗 }
Hence 𝑀𝑖𝑗 = 𝑚𝑖𝑛 {𝑆𝑖 , 𝐷𝑗 } gives us a target lower bound,
as opposed to
𝑋
big M: which case 𝛿𝑖𝑗 = 𝑀𝑖𝑗 which is closer to 0 as 𝑀𝑖𝑗 is a large number.
𝑖𝑗

2. When such a related problem is solved, the transport plan {𝑋𝑖𝑗 } is always feasible
except for a lower bound on Z.

3. Hence when we compute Z using 𝛿𝑖𝑗 ∈ {0,1} corresponding to 𝑋𝑖𝑗 = 0 or positive, we


get a upper bound on Z.
GA for Transportation

75 25 100

150 150

100 150 250

Matrix 1

75 275 150

100 100

100 50 150

75 175 150 250

75 275 150

Matrix 2

Ensuring feasibility (𝛿𝑖𝑗 within 1) of basic cells while performing the crossover and mutation
operators is a challenge.

We cannot perform crossover either by row or by column as 𝑆𝑖 and 𝐷𝑖 with respect to ∑𝑋𝑖𝑗
will not be satisfied.

We transform to permutation representation and use the TSP/Scheduling GA application.

Matrix 1

{1-2-5-8-9 - 3-4-6-7}

Shipment Cells Non- shipment cells

When converted from permutation representation to shipment plan, we have the same matrix.

Matrix 2

{3-5-6-7-8 - 1-2-4-9}
Non-
Shipment
shipment
Cells
cells
100

150

75 125 50

When converted back into transportation plan, we have the following matrix, which portrays
a different transportation plan!

The aim is to find a suitable way to transform the given transportation plan into the
permutation representation such that when we derive the transportation plan from the
permutation representation, we must get the original transport plan.

Note that our reference is the transportation plan and not the permutation representation.

Step 1: When a transport plan is given, identify the cells for which

𝑋𝑖𝑗 = min { left over supply, left over demand };

…….. them in any sequence

E.g. In the above matrix 2 : we have 3 and 7. The partial permutation sequence is { 3-7} or {
7-3}

Step 2: Now, update the leftover supply and left over demand by removing the shipments
carried to 3 and 7.

Step 3: The new sets of qualifying cells {6,8} and hence we have the sequence {3,7,6,8} and
finally {3,7,6,8,5}. This sequence will lead to Matrix 2 when converted into the transport
plan.

If we have a arbitrary sequence

{9-7-8-6-5-4-3-2-1}

Then the corresponding transport plan is

100

150

75 25 100
And this result is {9-7-5-2-8-1-3-4-6}

The above permutation yields the same envisaged transportation plan

You may have alternate permissible sequences for the same transportation plan.

You might also like