Multi-objective Optimization of Two-Dimensional Sheet Cutting Problem using Genetic Algorithms
description
Transcript of Multi-objective Optimization of Two-Dimensional Sheet Cutting Problem using Genetic Algorithms
Multi-objective Multi-objective Optimization of Two-Optimization of Two-Dimensional Sheet Dimensional Sheet
Cutting Problem using Cutting Problem using Genetic AlgorithmsGenetic Algorithms
Santosh TiwariSantosh Tiwari
Sheet Cutting FrameworksSheet Cutting Frameworks
Guillotine Cutting – (cutting from edge to Guillotine Cutting – (cutting from edge to edge, Detached parts treated as separate edge, Detached parts treated as separate entities) – entities) – Applicable to metallic sheetsApplicable to metallic sheets
Non-guillotine Cutting – (cutting from edge Non-guillotine Cutting – (cutting from edge to edge not mandatory, Detached parts to edge not mandatory, Detached parts treated as same entity) – treated as same entity) – Applicable to Applicable to piles of paperpiles of paper
Guillotine cutting is of practical importance Guillotine cutting is of practical importance to industryto industry
Sheet Cutting formulated as an Sheet Cutting formulated as an optimization problem for Industryoptimization problem for Industry
Optimization ProblemOptimization Problem
Objective 1: Minimize the length of Objective 1: Minimize the length of mother-sheet required (mother-sheet required (Trim lossTrim loss))
Objective 2: Minimize the number of cuts Objective 2: Minimize the number of cuts required (required (Tool lifeTool life))
Non-guillotine Cutting: Both real and Non-guillotine Cutting: Both real and binary formulationsbinary formulations
Guillotine Cutting: Only binary formulationGuillotine Cutting: Only binary formulation Binary formulation greatly outperforms Binary formulation greatly outperforms
real variable formulationreal variable formulation
Real variable formulationReal variable formulation
Two real variables and one binary variable
Variables (x1, y1) and a bit ‘0’ or ‘1’ for every rectangle
Representation of an Representation of an IndividualIndividual
Let number of parts be ‘n’Let number of parts be ‘n’ Length of gene of real variables = Length of gene of real variables =
‘2n’‘2n’
((xx11, , yy11, , xx22, , yy22, .., .., .., ..), .., .., .., ..) Length of gene of binary variables = Length of gene of binary variables =
‘n’‘n’
((‘0’‘0’, , ‘1’‘1’, ., ., ., .) , ., ., ., .)
Objective FunctionsObjective Functions Objective 1:Objective 1:
Objective 2: (Non-guillotine cutting)Objective 2: (Non-guillotine cutting)
2 1 2 2 2max | , | ,..., |nl x x x
Objective 2 contd…Objective 2 contd…
Number of cuts (Non-guillotine Number of cuts (Non-guillotine cutting)cutting)
1. Number of cuts = 1. Number of cuts = 4*n4*n..2. For every rectangle 2. For every rectangle ‘i’‘i’ do the following do the following3.3. For every edge of rectangle For every edge of rectangle ‘i’‘i’ that lies on the boundary decrease the number that lies on the boundary decrease the number
ofof cuts by one and mark that edge using a flag.cuts by one and mark that edge using a flag.4. 4. For every rectangle For every rectangle ‘j’‘j’ from from ‘i+1’‘i+1’ to to ‘n’‘n’ do the following do the following5.5. For every unmarked edge of rectangle For every unmarked edge of rectangle ‘i’‘i’ compare it with all the compare it with all the
(suitable)(suitable)edges of rectangle edges of rectangle ‘j’‘j’ to find out if they are aligned. to find out if they are aligned.
6.6. If they are aligned then find out if they are touching or not, if they are If they are aligned then find out if they are touching or not, if they are touching, then decrease the number of cuts by one and mark the touching, then decrease the number of cuts by one and mark the corresponding edge of rectangle corresponding edge of rectangle ‘j’‘j’..
7.7. If the rectangles are not touching then find out the line joining the If the rectangles are not touching then find out the line joining the aligningaligning
edges and for every rectangle edges and for every rectangle ‘k’ ≠ ‘i’‘k’ ≠ ‘i’ and and ≠ ‘j’≠ ‘j’ find out whether the find out whether the lineline
and rectangle and rectangle ‘k’‘k’ interfere or not. If none of the rectangle interfere or not. If none of the rectangle ‘k’‘k’ interfere interfere thenthen
decrease the number of cuts by one and mark the corresponding edge decrease the number of cuts by one and mark the corresponding edge of of
rectangle rectangle ‘j’‘j’8. Increase the number of cuts by one to account for the final cut that is made at 8. Increase the number of cuts by one to account for the final cut that is made at
the end of the mother sheet. the end of the mother sheet.
ConstraintsConstraints
Constraint 1: Error in location of Constraint 1: Error in location of rectangular parts – should be inside rectangular parts – should be inside the mother sheetthe mother sheet
Constraint 2: Overlap error – no two Constraint 2: Overlap error – no two triangles should overlap one anothertriangles should overlap one another
1 0x 1 0y 2x l 2y b
Overlap ErrorOverlap Error1.1. For i←0 to i←n do For i←0 to i←n do 2.2. {{3.3. if (rect[i].x1<0)if (rect[i].x1<0) return ERRORreturn ERROR4.4. if (rect[i].y1<0)if (rect[i].y1<0) return ERRORreturn ERROR5.5. if (rect[i].x2>l)if (rect[i].x2>l) return ERRORreturn ERROR6.6. if (rect[i].y2>b)if (rect[i].y2>b) return ERRORreturn ERROR7.7. For j←i+1 to j←n do For j←i+1 to j←n do 8.8. {{9.9. if (rect[i].x2≤rect[j].x1 or rect[i].x1≥rect[j].x2 if (rect[i].x2≤rect[j].x1 or rect[i].x1≥rect[j].x2
oror rect[i].y1≥rect[j].y2 or rect[i].y2≤rect[j].y1 )rect[i].y1≥rect[j].y2 or rect[i].y2≤rect[j].y1 )10.10. { do nothing }{ do nothing }11.11. elseelse12.12. return ERRORreturn ERROR13.13. }}14.14. }}15. 15. return NO_ERRORreturn NO_ERROR
Binary FormulationBinary Formulation
1 2l l l
1 2max ,b b b
1 2max ,l l l
1 2b b b
Equation representing the Equation representing the IndividualIndividual
““1 2 H 3 4 H V 5 6 V 7 8 V H H” 1 2 H 3 4 H V 5 6 V 7 8 V H H” “0, 1, 1, 0, 0, 0, 1, 0”
Tree View
Physical LayoutPhysical Layout
Tree-String ConversionTree-String Conversion
Algorithm to convert the tree to string Algorithm to convert the tree to string – we use in-order traversal– we use in-order traversal
Traverse-tree (x) 1 if x ≠ NIL2 then traverse-tree (left[x])3 traverse-tree (right[x])4 print key[x]
Feasibility and Validity of Feasibility and Validity of GeneGene NNoo – number of operators – number of operators
NNpp – number of parts – number of parts NNo o = N = Npp – 1 – 1 In tree, In tree,
all intermediate nodes are operatorsall intermediate nodes are operators All leaf nodes are partsAll leaf nodes are parts Tree should be completeTree should be complete Leaf nodes should be uniqueLeaf nodes should be unique
In string,In string, NNpp – number of parts to its left for any operator – number of parts to its left for any operator NNoo – number of operators to its left including itself – number of operators to its left including itself
for any operatorfor any operator1 1o pn n
Advantages of String Advantages of String NotationNotation
Constant size of stringConstant size of string No parenthesis requiredNo parenthesis required Unique representationUnique representation Finite search spaceFinite search space Optimal representation of the setOptimal representation of the set Powerful crossover and mutation operators Powerful crossover and mutation operators
can be designedcan be designed Both guillotine and non-guillotine sets can Both guillotine and non-guillotine sets can
be representedbe represented
Coordinate allocation and Tree Coordinate allocation and Tree ConstructionConstruction
1. If it is a part number push it into stack1.1. If it is a part number push it into stack1.2. If it is an operator then pop two elements from stack1 2. If it is an operator then pop two elements from stack1
make a new part number and push it into stack1 and make a new part number and push it into stack1 and stack2. Keep track of the breadth of the newly formed stack2. Keep track of the breadth of the newly formed part number, if it is more than the breadth of the master part number, if it is more than the breadth of the master sheet, then change the operator and communicate the sheet, then change the operator and communicate the change back to the GAs.change back to the GAs.
3. When all the elements are interpreted then only one 3. When all the elements are interpreted then only one entry remains in stack1 and n-1 entries remain in entry remains in stack1 and n-1 entries remain in stack2.stack2.
4.4. Pop the first entry from stack2, assign it the Pop the first entry from stack2, assign it the coordinates, and then assign the coordinates to its coordinates, and then assign the coordinates to its constituents.constituents.
5.5. Pop next entry from stack2 and assign the coordinates Pop next entry from stack2 and assign the coordinates to its constituents.to its constituents.
6. Proceed until stack2 is empty. 6. Proceed until stack2 is empty.
Number of Cuts – Guillotine Number of Cuts – Guillotine CuttingCuttingkey←2n-1key←2n-1
calculate number of cuts (key) calculate number of cuts (key) 1.1. a←rect[key].aa←rect[key].a2.2. b←rect[key].bb←rect[key].b3.3. op←rect[key].opop←rect[key].op4.4. number of cuts←1number of cuts←15.5. if (rect[key].breadth<breadth of mother sheet)if (rect[key].breadth<breadth of mother sheet)6.6. number of cuts←1+number of cutsnumber of cuts←1+number of cuts7.7. calculate dimensions of rect[a] based on its orientationcalculate dimensions of rect[a] based on its orientation8.8. calculate dimensions of rect[b] based on its orientationcalculate dimensions of rect[b] based on its orientation9.9. if (op=’H’)if (op=’H’)10.10. if (vertical dimension(a)≠vertical dimension(b))if (vertical dimension(a)≠vertical dimension(b))11.11. number of cuts←2+number of cutsnumber of cuts←2+number of cuts12.12. elseelse13.13. number of cuts←1+number of cutsnumber of cuts←1+number of cuts14.14. if (op=’V’)if (op=’V’)15.15. if (horizontal dimension(a)≠horizontal dimension(b))if (horizontal dimension(a)≠horizontal dimension(b))16.16. number of cuts←2+number of cutsnumber of cuts←2+number of cuts17.17. elseelse18.18. number of cuts←1+number of cutsnumber of cuts←1+number of cuts19.19. if (a>number of rectangles)if (a>number of rectangles)20.20. number of cuts←number of cuts+calculate number of cuts (a)number of cuts←number of cuts+calculate number of cuts (a)21.21. if (b>number of rectangles)if (b>number of rectangles)22.22. number of cuts←number of cuts+calculate number of cuts (b)number of cuts←number of cuts+calculate number of cuts (b)23.23. return number of cutsreturn number of cuts
Crossover OperationCrossover Operation
Done with the stringDone with the string Three types of crossover routines Three types of crossover routines
implementedimplemented PMX Partial mapped crossoverPMX Partial mapped crossover Ordered CrossoverOrdered Crossover Cyclic CrossoverCyclic Crossover
Uniform one point crossover done to Uniform one point crossover done to the string keeping record of the string keeping record of orientationorientation
Mutation OperationMutation Operation
Done to the treeDone to the tree Pick up any two intermediate nodes Pick up any two intermediate nodes
and swap themand swap them Pick any two leaf nodes and swap Pick any two leaf nodes and swap
themthem Pick any intermediate node and flip itPick any intermediate node and flip it Pick any location on the state string Pick any location on the state string
and flip itand flip it
Simulation ResultsSimulation Results Case 1: Breadth of mother sheet = 6 Case 1: Breadth of mother sheet = 6
unitsunits 5 rectangles of size 1x1 units5 rectangles of size 1x1 units Two pareto-optimal solutionsTwo pareto-optimal solutions
Simulation Results contd…Simulation Results contd… Case 2: Breadth of mother sheet = 5 Case 2: Breadth of mother sheet = 5
unitsunits 5 rectangles of size 1x1 units5 rectangles of size 1x1 units Only one solution obtainedOnly one solution obtained
Simulation Results contd…Simulation Results contd… Case 3: Breadth of mother sheet = 1 Case 3: Breadth of mother sheet = 1
unitsunits 5 rectangles of size 1x1 units5 rectangles of size 1x1 units Only one solution obtainedOnly one solution obtained
Simulation Results contd…Simulation Results contd… Case 4: Breadth of mother sheet = Case 4: Breadth of mother sheet =
10 units10 units 10 rectangles of dimensions10 rectangles of dimensions
(1 4,2 4,5 4,2 2,1 4,4 4,4 4,4 2,2 2,2 5)
Simulation Results contd…Simulation Results contd… Case 5: Breadth of mother sheet = 20 unitsCase 5: Breadth of mother sheet = 20 units 20 rectangles of dimensions20 rectangles of dimensions
(1 4,2 4,5 4,2 2,1 4,4 4,4 4,4 2,2 2,2 5,3 5,3 3,4 5,
2 3,4 5,3 5,1 3,4 2,2 2,3 4)
For Guillotine CuttingFor Guillotine Cutting Case 6: Breadth of mother sheet = 10 unitsCase 6: Breadth of mother sheet = 10 units 20 rectangles of dimensions20 rectangles of dimensions
(1 4,2 4,5 4,2 2,1 4,4 4,4 4,4 2,2 2,2 5)
For Guillotine Cutting For Guillotine Cutting contd…contd… Case 7: Breadth of mother sheet = 20 unitsCase 7: Breadth of mother sheet = 20 units
20 rectangles of dimensions20 rectangles of dimensions
(1 4,2 4,5 4,2 2,1 4,4 4,4 4,4 2,2 2,2 5,3 5,3 3,4 5,
2 3,4 5,3 5,1 3,4 2,2 2,3 4)