Evolutionary Computation for Combinatorial Optimization Günther Raidl Vienna University of Technology, Vienna, Austria raidl@ads.tuwien.ac.at EvoNet Summer School 2003, Parma, Italy August 25, 2003 Evolutionary Computation for Combinatorial Optimization p.1/29
Combinatorial Optimization Problems (COPs) We consider: Problems having a finite number of solutions (discrete problems) Each solution has associated an objective value Goal: Find a solution that maximize. Evolutionary Computation for Combinatorial Optimization p.2/29
COPs and Evolutionary Algorithms Some examples of COPs: time-tabling scheduling transportation problems vehicle routing packing and cutting network design set partitioning or covering Good solutions to such problems are highly important in various industrial, economical, and scientific domains. Unfortunately, many instances are too hard/difficult to be solved exactly. We apply evolutionary algorithms (EAs) to get approximate solutions. Evolutionary Computation for Combinatorial Optimization p.3/29
Overview 1. The (Multi-Constrained) Knapsack Problem 2. Constraint Handling Techniques 3. Hybridizing Evolutionary Algorithms 4. Conclusions Evolutionary Computation for Combinatorial Optimization p.4/29
An Example: The Knapsack Problem (KP) Given: items with weights and profits, a knapsack that may carry a maximum total weight Objective: Find a subset of items with maximum total profit and total weight.... characteristic vector Evolutionary Computation for Combinatorial Optimization p.5/29
The Multi-Constrained Knapsack Problem (MKP) resources/constraints: We extend the KP by considering with profits resources of size Given: items : resource consumption Objective: Evolutionary Computation for Combinatorial Optimization p.6/29
An Evolutionary Algorithm for the MKP A straight-forward EA-setup for the MKP: Solution representation: binary vector (genotype phenotype) Initialization: choose each independently at random Mutation: flip each bit with probability Recombination: uniform crossover Evolutionary Computation for Combinatorial Optimization p.7/29
An Evolutionary Algorithm for the MKP A straight-forward EA-setup for the MKP: Solution representation: binary vector (genotype phenotype) Initialization: choose each independently at random Mutation: flip each bit with probability Recombination: uniform crossover Problem: What shall we do with infeasible solutions? Evolutionary Computation for Combinatorial Optimization p.7/29
Constraint Handling Techniques Evolutionary Computation for Combinatorial Optimization p.8/29
Constraint Handling Techniques 1. Discarding infeasible solutions Most primitive approach: If solution is infeasible: Problematic if search space consists of many infeasible solutions. Infeasible solutions may guide the search toward an optimum. E.g. for the (M)KP: An optimal solution always lies at the boundary of the feasible region. Evolutionary Computation for Combinatorial Optimization p.9/29
Constraint Handling Techniques (2) 2. Adding a penalty to according to the degree of infeasibility For the MKP: Evolutionary Computation for Combinatorial Optimization p.10/29
Constraint Handling Techniques (2) 2. Adding a penalty to according to the degree of infeasibility For the MKP: Choice of penalty coefficients is often difficult. Evolutionary Computation for Combinatorial Optimization p.10/29
Constraint Handling Techniques (3) Stepwise Adaption of Weights (SAWing) Initialize all Do every with small values generations: (constraint is violated in the so-far best solution):... strategy parameters Evolutionary Computation for Combinatorial Optimization p.11/29
Constraint Handling Techniques (4) 3. Repairing infeasible solutions For the MKP: ; while choose an ; : at random; ; The repaired solution may be written back into the chromosome (Lamarckian approach) or not (Baldwin effect) In general: often highly effective, but not always applicable Evolutionary Computation for Combinatorial Optimization p.12/29
Constraint Handling Techniques (5) 4. Considering constraints in operators E.g. for the MKP: Create only feasible initial solutions by the following randomized heuristic: for all items if adding item then in random order: to solution is feasible, Similarly: Constraint-aware mutation and recombination Evolutionary Computation for Combinatorial Optimization p.13/29
Constraint Handling Techniques (6) 5. Using an indirect representation and a clever decoder Example for the MKP: New representation: permutation Decoding heuristic: of all items for to : if adding item then to solution is feasible, Mutation: Swap, Move, etc. Recombination: Order1, Uniform order based, etc. Evolutionary Computation for Combinatorial Optimization p.14/29
Hybridization of Evolutionary Algorithms Evolutionary Computation for Combinatorial Optimization p.15/29
Hybridization of EAs A simple EA can almost always be improved for a specific problem by incorporating problem specific knowledge. Specialized algorithms are combined with the EA, yielding a hybrid system. Performance of EA Specialization Evolutionary Computation for Combinatorial Optimization p.16/29
Common Hybridization Approaches 1. Creation of initial solutions by specific heuristics Greedy heuristic for the KP: Sort items according to decreasing relative profit Perform decoding heuristic on this order. Care must be taken to achieve enough diversity!. If elitism is used, the EA s final solution will never be worse than those of the heuristics. Evolutionary Computation for Combinatorial Optimization p.17/29
Common Hybridization Approaches (2) 2. Local improvement of solutions The best, some, or all newly created candidate solutions are locally improved. Often referred to as (Local-Search Based) Memetic Algorithm Generic hill-climber for bit-strings ; while do ; ; if then ; EA-part emphasizes exploration, local improvement concentrates on exploitation ; : Evolutionary Computation for Combinatorial Optimization p.18/29
Common Hybridization Approaches (3) 3. Intelligent decoders Candidate solutions are indirectly represented. A heuristic for the problem is parameterized by the genotype. The heuristic is used as decoder to obtain the phenotype. Examples for representations: Permutations Weighted codings Sometimes problematic: time effort; locality Evolutionary Computation for Combinatorial Optimization p.19/29
Another Example Problem The Degree-Constrained Minimum Spanning Tree Problem ( -MSTP): Given: a complete graph, costs associated to all edges. Goal: Find a spanning tree on of minimum total costs with each node s degree being not larger than some. Given vertices MST 3-ST Evolutionary Computation for Combinatorial Optimization p.20/29
A Weight-Coded EA for the -MSTP Solution representation: vector of weights Evolutionary Computation for Combinatorial Optimization p.21/29
A Weight-Coded EA for the -MSTP Solution representation: vector of weights Evaluation scheme: Temporarily modify edge-costs: Apply a fast heuristic for the -MSTP to this biased problem to obtain a feasible solution (e.g. an extended version of Prim s MST algorithm). This is the decoded solution; evaluate it using original (unbiased) costs. Evolutionary Computation for Combinatorial Optimization p.21/29
A Weight-Coded EA for the -MSTP (2) Initialization and mutation of weights: Evolutionary search is biased towards the surrounding of the solution the decoding heuristic derives for the unbiased problem. controls the heuristic pressure. Recombination: e.g. uniform crossover Evolutionary Computation for Combinatorial Optimization p.22/29
A Weight-Coded EA for the -MSTP (2) Initialization and mutation of weights: Evolutionary search is biased towards the surrounding of the solution the decoding heuristic derives for the unbiased problem. controls the heuristic pressure. Recombination: e.g. uniform crossover Weighted Codings are widely applicable. For a relatively small development time, you get a relatively high performing EA. Evolutionary Computation for Combinatorial Optimization p.22/29
Common Hybridization Approaches (4) 4. Intelligent/heuristic operators Often in combination with problem specific representations. Can often provide stronger locality/heritability than decoder-based approaches. Often faster than decoder-based approaches. Typically higher development and testing effort. Evolutionary Computation for Combinatorial Optimization p.23/29
Example: Heuristic Mutation for -MSTP Evolutionary Computation for Combinatorial Optimization p.24/29
Example: Heuristic Mutation for -MSTP Select a new edge at random and insert it; biased toward cheap edges. Evolutionary Computation for Combinatorial Optimization p.24/29
Example: Heuristic Mutation for -MSTP Select a new edge at random and insert it; biased toward cheap edges. This introduces a cycle; determine its edges. Evolutionary Computation for Combinatorial Optimization p.24/29
Example: Heuristic Mutation for -MSTP Select a new edge at random and insert it; biased toward cheap edges. This introduces a cycle; determine its edges. Select one edge from the cycle and delete it. Can be implemented in time. Evolutionary Computation for Combinatorial Optimization p.24/29
Example: Heuristic Recombination for -MSTP Parent Parent Evolutionary Computation for Combinatorial Optimization p.25/29
Example: Heuristic Recombination for -MSTP Parent Parent Merge edge-sets of parents. Evolutionary Computation for Combinatorial Optimization p.25/29
Example: Heuristic Recombination for -MSTP Parent Parent Merge edge-sets of parents. Apply a random -spanning tree algorithm to. Offspring Evolutionary Computation for Combinatorial Optimization p.25/29
Example: Heuristic Recombination for -MSTP Parent Parent Merge edge-sets of parents. Apply a random -spanning tree algorithm to. Offspring Inheriting edges from with higher priority is usually a good idea. Can be implemented in time. Evolutionary Computation for Combinatorial Optimization p.25/29
Some Results of different EAs for -MSTP Instance BC-EA NRK-EA WE-EA ES-EA HES-EA name %-gap %-gap %-gap %-gap %-gap M1 50 6.60 136.56 7.85 0.41 1.19 0.00 M2 50 5.78 163.28 11.75 9.01 1.45 0.01 M3 50 5.50 133.75 5.40 16.20 0.92 0.00 M4 100 11.08 217.16 53.88 3.60 6.58 0.01 M5 100 11.33 224.50 58.62 4.59 10.78 0.01 M6 100 10.19 253.88 71.33 6.89 14.70 0.01 M7 200 18.33 296.69 146.60 0.34 17.64 0.02 M8 200 19.16 313.29 166.17 0.87 26.30 0.02 M9 200 16.13 313.17 153.89 0.36 9.78 0.01 M10 300 40.69 M11 400 54.69 M12 500 79.34 175.48 89.67 13.71 19.99 0.06 212.72 137.93 20.34 37.84 1.00 171.53 117.38 29.09 34.04 1.09 Evolutionary Computation for Combinatorial Optimization p.26/29
Some Results of different EAs for -MSTP (2) Evolutionary Computation for Combinatorial Optimization p.27/29
Example: The Traveling Salesman Problem Given: points, distances between any two points Objective: Find a shortest round tour visiting each point exactly once. A solution is described by a permutation of. An EA-demo for it can be found at: http://www.ads.tuwien.ac.at/ guenther/tspga/tspga.html Evolutionary Computation for Combinatorial Optimization p.28/29
Conclusions When developing an EA for a COP: Take care of strong locality/heritability Try to handle constraints efficiently If you want a really good EA and have enough time for development and testing: Consider any available problem-specific knowledge and any existing (heuristic) algorithm for an eventual hybridization. Evolutionary Computation for Combinatorial Optimization p.29/29