Better Ants, Better Life?Better Ants, Better Life?
Hybridization of Constraint Programming and Ant Colony Optimization
Supervisors: Dr. Bernd Meyer, Dr. Andreas Ernst
Martin Held
Oct 27th, 2005
- final presentation -
Hybridizing CP and ACO [2]
IntroductionIntroduction
Ant Colony Optimization (ACO)
nature inspired algorithms to tackle combinatorial optimization problemsbased on collective behaviour of ants
Constraint Programming
Programming paradigm that allows to effectively solve hard constraint problemsSUDOKU, n-Queens, SEND+MORE = MONEY
Hybridizing CP and ACO [3]
IntroductionIntroduction
Project Aims
Analysis of different constraint handling techniques in Ant Colony Optimization algorithms (ACO)Improvement of an existing hybrid algorithm (CPACS)Combination of hard and soft constraint handling algorithms
Hybridizing CP and ACO [4]
BackgroundBackground
Combinatorial Optimization Problems
Finding the best solution among a set of discrete solutionsinteresting COPs are NP-completesolving them exactly needs exponential timenear optimal solutions can be obtained by using heuristics
Naive way of solving them
enumerate all solutions, pick best onebad idea: exponential number of solutions
Hybridizing CP and ACO [5]
BackgroundBackground
Better: Meta-heuristics
stochastic search strategiescleverly sample fraction of solution spacegiven solutions they attempt to generatebetter onesmovement in search space to good solutionsmechanisms to prevent getting stuckin local optimaSimulated Annealing, Genetic Algorithms,Ant Colony Optimization
Hybridizing CP and ACO [6]
BackgroundBackground
Constrained COPs
most real world COPs are constrained
practical relevance (timetabling, rostering,
job scheduling, …)
constraints impose difficulties for search procedure
how to generate feasible solutions?
should infeasible solutions be used?
…
no ultimate way of handling constraints in MH
Hybridizing CP and ACO [7]
BackgroundBackground
Travelling Salesman Problem (TSP)
unconstrained COP
Example for a COP
A
B
C
D
2
4
5 23
3
7
A – C - B - D - A
Hybridizing CP and ACO [8]
BackgroundBackground
TSP with Time windows (TSP-TW)Each city has a time windows in which is has to be visited
single machine job scheduling problem
Example for a constrained COP
A
B
C
D
8
5
30 3
15
12
(10, 50)(20, 34)
(30, 35)
(5, 25)
Hybridizing CP and ACO [9]
BackgroundBackground
How would ants solve a TSP?
based on pheromone trails, ants are able to find shortest paths to food sourcestranslating this into an algorithm (ACO), it can be used to solve COPs
A
B
C
D
2
4
5 23
3
7
Hybridizing CP and ACO [10]
BackgroundBackground
How would ants solve a TSP?
after constructing a tour, corresponding path is rewarded with pheromoneamount of pheromone depends on solution qualitylater ants more likely to regenerate good solutions
tours might be infeasible due to constraint violationReward them? Try again? Prevent construction of infeasible tours?
How to solve a TSP-TW?
Hybridizing CP and ACO [11]
BackgroundBackground
We need smarter ants!(enable them to cope with constraints)
Hybridizing CP and ACO [12]
Prunes search space, provides look ahead
Find a feasible instantiation for X and Y X ≥ Y, X+Y < 4, X Є {1,2}, Y Є {1,2}
Can be used to express more complex constraintse.g. job scheduling (due date restrictions etc.)
X
Y Y
1 2
1 2 1 2
X=1Y=1
X=1Y=2
X=2Y=1
X=2Y=2
BackgroundBackground
Constraint Programming
Hybridizing CP and ACO [13]
BackgroundBackground
Ants armed with CP knowledge
A
B
C
D
8
5
30 3
15
12
(10, 50)(20, 34)
(30, 35)
(5, 25)
Hybridizing CP and ACO [14]
BackgroundBackground
Ants armed with CP knowledge
look ahead depends on constraint solver strengthimplemented in CPACS
A
8
5(10, 50) (20, 34)
(30, 35)
(5, 25)
B
C
D
30
C
D
B
D
B
C
D
C
D
B
C
B
15
12
15
3
12
3
15
15
12
12
3
3
Hybridizing CP and ACO [15]
ProjectProject
How to increase look ahead?
besides CP other options to obtain look ahead bounding: calculation of solution boundsGeneral idea:
obtain bound on solutionexclude choices that lead to worse solutions than best found so far
To obtain bounds and information about costs for potential variable assignments we solve a relaxation of the actual TSP-TW
Hybridizing CP and ACO [16]
ProjectProject
How to increase look ahead?
relaxation easier to solve than original problemsolution of relaxation only lower bound on actual solution
A
B
C
D
A
B
C
D
A B
D C
5
2
23
34 7
Tour Length: 8 (actual TSP optimal 19)
Hybridizing CP and ACO [17]
ProjectProject
How to increase look ahead?
Use standard linear programming (lp) to solve relaxation
Hybridizing CP and ACO [18]
ProjectProject
How to increase look ahead?
LP solution provides information aboutlower bound on problem solutioncost for each edge, by which amount would lower bound increase if edge would be in solution
Allows to exclude edges from consideration:
LB + cost[i][j] > best solution found so far
Edges (i,j) were this is true do not have to be considered by antsadditional pruning
Implemented in CPACSlp
Hybridizing CP and ACO [19]
ProjectProject
Using LP information for dynamic guidance
A
8
5
B
C
D
30
C
D
B
D
B
C
D
C
D
B
C
B
15
12
15
3
12
3
15
15
12
12
3
3
Ant decision based on pheromone concentration and some bias
e.g. prefer shorter edges
Hybridizing CP and ACO [20]
ProjectProject
Using LP information for dynamic guidance
bias is static, dependent on fixed problem properties
Lp calculated edge costs can be used as bias instead
change dynamically while tour construction
represent ‘current’ desirability of edges
might have better search guiding abilities
Implemented in dynamicCPACSlp
Hybridizing CP and ACO [21]
ResultsResults
Comparing CPACS vs. (CPACSlp & dynCPACSlp )
all algorithms were applied to a test set of single machine job scheduling problems with various tightnesseach algorithm was run 10 times on each of the 19 problemsTested different configurations
CPACS vs. CPACSlp in absence of pheromone learningCPACS vs. CPACSlp with learning componentdynCPACSlp vs. CPACSlp
Due to vast amount of computation, experiments had to be carried out on the cluster
Hybridizing CP and ACO [22]
ResultsResults
Comparing CPACS vs. (CPACSlp & dynCPACSlp )
with 10 runs, standard deviation of measurements was to high to draw any conclusionsincreased the number of runs to 100analyses commenced 4 weeks ago …in between the cluster exhibited severe stability problemsAnalysis not finished yet No final results obtained yetWhat do we expect?
Let’s guess…
Hybridizing CP and ACO [23]
ResultsResults
Possible outcomes and consequences
A:significant improvement of search efficiency (labelling steps)
B: no measurable improvement
Hybridizing CP and ACO [24]
DiscussionDiscussion
Possible outcomes and consequences (A)
significant improvement of search efficiency (labelling steps)
very good, we implemented an algorithm that performs superior to existing onesit needs less labelling steps to find even better solutions than existing onesFurther investigations should relate labelling steps to CPU timeLess labelling steps not necessarily fasterCP and LP solving needs additional timeSimpler search heuristic might be able to achieve similar results with same amount of CPU time
Hybridizing CP and ACO [25]
DiscussionDiscussion
Possible outcomes and consequences (B)
no measurable improvement
unfortunateobtained bounds might not be tight enoughinvestigation of actual tightnessHow much pruning is achieved?necessarily improve LP model
Hybridizing CP and ACO [26]
ConclusionsConclusions
implemented new algorithmic approaches to handle constraints in ACO
results will allow to asses the relevance of these new approaches
proved justification of using Stochastic Ranking as constraint handling technique in ACO
Hybridizing CP and ACO [27]
Future Directions (general)Future Directions (general)
Investigation of labelling steps – CPU time relationImprovement of LP model to get tighter bounds more search space pruning, better guidance?further investigation of different scalings of dynamic cost valuescomparison with other algorithms (needs efficient implementations)