Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software framework for metaheuristics Parallel Cooperative Optimization Research Group Laboratoire d’Informatique Fondamentale de Lille

Similar presentations


Presentation on theme: "Software framework for metaheuristics Parallel Cooperative Optimization Research Group Laboratoire d’Informatique Fondamentale de Lille"— Presentation transcript:

1 Software framework for metaheuristics Parallel Cooperative Optimization Research Group Laboratoire d’Informatique Fondamentale de Lille http://paradiseo.gforge.inria.fr

2 Outline framework. ParadisEO-EO (population-based metaheuristics). ParadisEO-MO (solution-based metaheuristics). EO & MO  hybridized metaheuristics. Conclusions and perspectives

3 Framework and tutorial application  Framework dedicated to metaheuristics   Tutorial application  The Traveling Salesman Problem (TSP) Parallel and Distributed Evolving Objects

4 ParadisEO (1/2)  A templates-based, ANSI-C++ compliant Metaheuristic Computation Framework.  GForge Project by INRIA Dolphin Team.  Paradigm Free (genetic algorithms, genetic programming, particle swarm optimization, local searches …).  Hybrid, distributed and cooperative models. http://paradiseo.gforge.inria.fr

5  Flexible / a considered problem.  Generic components (variation operators, selection, replacement, termination, particle behaviors …).  Many services (visualization, managing command-line parameters, saving/restarting, …). ParadisEO (2/2) http://paradiseo.gforge.inria.fr

6 Evolutionary computation, Swarm intelligence : population- based metaheuristics Tabu Search, Simulated Annealing, Hill Climbing: single solution based metaheuristics Multi-objective metaheuristics Parallel and distributed metaheuristics ParadisEO: Module-based architecture

7 Evolutionary computation, Swarm intelligence: population-based metaheuristics Tabu Search, Simulated Annealing, Hill Climbing: single solution based metaheuristics Multi-objective metaheuristics Parallel and distributed metaheuristics ParadisEO: Module-based architecture

8 ParadisEO-EO (Evolving Object)

9 Available approaches Genetic algorithm (GA). Genetic programming (GP). Evolution strategies (ES). Evolutionary algorithm (EA). Evolutionary programming (EG). Particle Swarm Optimization (PSO). Estimation of Distribution Algorithm (EDA).

10 Design concepts Each metaheuristic has: – generic parts  not dedicated to one problem. –dedicated parts  linked to the problem to solve. The user: –can directly use the available generic boxes, –has only to code the information dedicated to his problem.

11 Needed task: designing a representation  Maybe several ways to do this. The representation must be relevant regards the tackled problem.  The user needs to have:  basic representations available.  the possibility to use his specific representation.

12 Existent basic representations

13 Scheme of one available algorithm: the evolutionary algorithm

14 The Traveling Salesman Problem (TSP)  “Given a collection of N cities and the distance between each pair of them, the TSP aims at finding the shortest route visiting all of the cities”.  Symmetric TSP:candidate solutions.  Example: v0v0 v4v4 v2v2 v1v1 8 10 6 9 4 4 6 3 6 5 Length: 26 v3v3

15 Representation and evaluation  We aim at minimizing the total length of the path: v5v5 v3v3 v4v4 v2v2 v1v1 8 10 6 9 4 4 6 3 6 5 14235 12345 1069 8 260464 394056 4 6503 584630

16 Application to the TSP  Path encoding:  Every node is assigned a number (e.g. from 0 up to n - 1) and solutions are represented by the ordered sequence of visited nodes.

17 Scheme of one available algorithm: the evolutionary algorithm

18

19

20

21

22

23

24

25

26 Implementation of an EA (1/9) RouteInit route_init; RouteEval full_route_eval; eoPop pop (POP_SIZE, route_init); eoGenContinue continue (NUM_GEN); OrderXover crossover; CitySwap mutation; eoStochTournamentSelect select_one; eoSelectNumber select (select_one, POP_SIZE); eoSGATransform transform (cross, CROSS_RATE, mutation, MUT_RATE); eoPlusReplacement replace; eoEasyEA ea (continue, full_route_eval, select, transform, replace); ea (pop);

27 Implementation of an EA (2/9) RouteInit route_init; RouteEval full_route_eval; eoPop pop (POP_SIZE, route_init); eoGenContinue continue (NUM_GEN); OrderXover crossover; CitySwap mutation; eoStochTournamentSelect select_one; eoSelectNumber select (select_one, POP_SIZE); eoSGATransform transform (cross, CROSS_RATE, mutation, MUT_RATE); eoPlusReplacement replace; eoEasyEA ea (continue, full_route_eval, select, transform, replace); ea (pop);

28 Implementation of an EA (3/9) RouteInit route_init; RouteEval full_route_eval; eoPop pop (POP_SIZE, route_init); eoGenContinue continue (NUM_GEN); OrderXover crossover; CitySwap mutation; eoStochTournamentSelect select_one; eoSelectNumber select (select_one, POP_SIZE); eoSGATransform transform (cross, CROSS_RATE, mutation, MUT_RATE); eoPlusReplacement replace; eoEasyEA ea (continue, full_route_eval, select, transform, replace); ea (pop);

29 Implementation of an EA (4/9) RouteInit route_init; RouteEval full_route_eval; eoPop pop (POP_SIZE, route_init); eoGenContinue continue (NUM_GEN); OrderXover crossover; CitySwap mutation; eoStochTournamentSelect select_one; eoSelectNumber select (select_one, POP_SIZE); eoSGATransform transform (cross, CROSS_RATE, mutation, MUT_RATE); eoPlusReplacement replace; eoEasyEA ea (continue, full_route_eval, select, transform, replace); ea (pop);

30 Implementation of an EA (5/9) RouteInit route_init; RouteEval full_route_eval; eoPop pop (POP_SIZE, route_init); eoGenContinue continue (NUM_GEN); OrderXover crossover; CitySwap mutation; eoStochTournamentSelect select_one; eoSelectNumber select (select_one, POP_SIZE); eoSGATransform transform (cross, CROSS_RATE, mutation, MUT_RATE); eoPlusReplacement replace; eoEasyEA ea (continue, full_route_eval, select, transform, replace); ea (pop);

31 Implementation of an EA (6/9) RouteInit route_init; RouteEval full_route_eval; eoPop pop (POP_SIZE, route_init); eoGenContinue continue (NUM_GEN); OrderXover crossover; CitySwap mutation; eoStochTournamentSelect select_one; eoSelectNumber select (select_one, POP_SIZE); eoSGATransform transform (cross, CROSS_RATE, mutation, MUT_RATE); eoPlusReplacement replace; eoEasyEA ea (continue, full_route_eval, select, transform, replace); ea (pop);

32 Implementation of an EA (7/9) RouteInit route_init; RouteEval full_route_eval; eoPop pop (POP_SIZE, route_init); eoGenContinue continue (NUM_GEN); OrderXover crossover; CitySwap mutation; eoStochTournamentSelect select_one; eoSelectNumber select (select_one, POP_SIZE); eoSGATransform transform (cross, CROSS_RATE, mutation, MUT_RATE); eoPlusReplacement replace; eoEasyEA ea (continue, full_route_eval, select, transform, replace); ea (pop);

33 Implementation of an EA (8/9) RouteInit route_init; RouteEval full_route_eval; eoPop pop (POP_SIZE, route_init); eoGenContinue continue (NUM_GEN); OrderXover crossover; CitySwap mutation; eoStochTournamentSelect select_one; eoSelectNumber select (select_one, POP_SIZE); eoSGATransform transform (cross, CROSS_RATE, mutation, MUT_RATE); eoPlusReplacement replace; eoEasyEA ea (continue, full_route_eval, select, transform, replace); ea (pop);

34 Implementation of an EA (9/9) RouteInit route_init; RouteEval full_route_eval; eoPop pop (POP_SIZE, route_init); eoGenContinue continue (NUM_GEN); OrderXover crossover; CitySwap mutation; eoStochTournamentSelect select_one; eoSelectNumber select (select_one, POP_SIZE); eoSGATransform transform (cross, CROSS_RATE, mutation, MUT_RATE); eoPlusReplacement replace; eoEasyEA ea (continue, full_route_eval, select, transform, replace); ea (pop);

35 Other features Checkpointing system. Configuration file creation and management. Visualization tools (link with gnuplot). Automatic design tool. …

36 ParadisEO-MO (Moving Object)

37 Design concepts Single solution metaheurisitcs  neighbourhood exploration. How can another solution be generated ?  disturbing the current solution  make a movement. Base of ParadisEO-MO = moMove.

38 Available algorithms Hill Climbing Tabu Search Simulated Annealing

39 Design a move for the TSP Reminding the chosen coding.  Ordered sequence of visited vertices. 2 23154 3 1 4 1453241352 5 Some relevant moves: – Two-opt, City-swap, LK, etc…

40 Two-Opt Two points within the string are selected and the segment between them is inverted. This operator put in two new edges in the tour. 23154 23514 2 3 5 1 4 2 3 5 1 4 Delta = - d(2,1) – d (5,3) + d(2, 5) + d(1, 3)

41 Hill Climbing

42 How can a Hill Climbing be built ? Designing a move operator, its features. Designing/implementing the operator to build the first move (and implicitly the first neighboring candidate). Designing/implementing the operator to update a given move to its successor. Designing/implementing the incremental evaluation function. Choosing the neighbour selection strategy. No continuation criterion (stopping as a local optimum is reached).

43 Hill Climbing class To build the first move To build the next move To compute the fitness delta Full evaluation function Move selection strategies

44 Two-Opt features (1/2) TwoOpt  a two-opt move is a couple of positions in the sequence of visited nodes. TwoOptInit  it initializes both positions to zero !

45 Two-Opt features (2/2) TwoOptNext  i t increments the second position if possible. Else, it increments the first position, and reinitializes the second position. TwoOptIncrEval  It computes the new length from the costs of the added/removed edges.

46 Neighbour selection strategy Deterministic/full: choosing the best neighbor (i.e. that improves the most the cost function). Deterministic/partial: choosing the first processed neighbour that is better than the current solution. Stochastic/full: processing the whole neighborhood and applying a random better one.

47 Implementation of a Hill Climbing Route route; /* One solution */ RouteInit route_init; /* Its builds random routes */ route_init (route); /* Building a random starting solution */ RouteEval full_route_eval; /* Full route evaluator */ TwoOptInit two_opt_init; /* Initializing the first couple of edges to swap */ TwoOptNext two_opt_next; /* Updating a movement */ TwoOptIncrEval two_opt_incr_eval; /* Efficiently evaluating a given neighbor */ moBestImprSelect two_opt_move_select; /* Movement selection strategy (elitist) */ /* Building the Hill Climbing from those components */ moHC hill_climbing (two_opt_init, two_opt_next, two_opt_incr_eval, two_opt_move_select, full_route_eval); /* It applies the HC to the solution */ hill_climbing (route);

48 Simulated Annealing

49 How can a Simulated Annealing be built ? Designing a move operator, its features. Designing/implementing the operator to build a random candidate move. Designing/implementing the incremental evaluation function. Choosing the cooling schedule strategy. Independent of the tackled problem Could be reused from Hill Climbing

50 Simulated Annealing class To compute the fitness delta Cooling schedule strategy Random move generator Full evaluation function

51 The Two-Opt random move generator It randomly determines a couple of random positions ! class TwoOptRand : public moMoveRand { public : void operator () (TwoOpt & __move, const Route & __route) ; } ; To be implemented

52 Cooling Schedule Two (basic) strategies are already implemented: linear and exponential: –Linear  temp = temp – x. –Exponential  temp = temp * x.

53 Route route; /* One solution */ RouteInit route_init; /* Its builds random routes */ route_init (route); /* Building a random starting solution */ RouteEval full_route_eval; /* Full route evaluator */ TwoOptRand two_opt_rand; /* It builds random candidate movements */ TwoOptIncrEval two_opt_incr_eval; /* Efficiently evaluating a given neighbor */ moExponentialCoolingSchedule cool_scheme (0.99, 1); /*Cooling schedule and associated parameters */ /* Building the Simulated Annealing from those components */ moSA simulated_annealing (two_opt_init, two_opt_incr_eval, 100, 100, cool_scheme, full_route_eval); /* It applies the SA to the solution */ simulated_annealing (route); Implementation of Simulated Annealing Factor and threshold Initial temperature and number of iterations at any step

54 Tabu Search

55 How can Tabu Search be built ? Design a move operator, its features. Design/implement the operator to build the first move (and implicitly the first neighboring candidate). Design/implement the operator to update a given move to its successor. Design/implement the incremental evaluation function. Design/implement the Tabu List. Choosing the aspiration criterion. Choosing the continuation criterion. Could be reused from Hill Climbing Independent of the tackled problem

56 Tabu Search class To build the first move To build the next move To compute the fitness delta Full evaluation function Tabu List Aspiration criterion Continuation criterion

57 Tabu List Predefined structures: –List of tabu solutions or tabu moves storing the tenure (short term memory).

58 Choosing an aspiration criterion (Basic) implemented strategies: –No aspiration criterion, –A tabu move builds a new solution that updates the best solution found during the search.

59 Choosing a stopping criterion Use strategies equivalent to those in ParadisEO-EO EA: –An optimum is reached, –A given total number of iterations, –A given number of gen. without improvement, –…

60 Implementing a Tabu Search Route route; /* One solution */ RouteInit route_init; /* Its builds random routes */ route_init (route); /* Building a random starting solution */ RouteEval full_route_eval; /* Full route evaluator */ TwoOptInit two_opt_init; /* Initializing the first couple of edges to swap */ TwoOptNext two_opt_next; /* Updating a movement */ TwoOptIncrEval two_opt_incr_eval; /* Efficiently evaluating a given neighbor */ moNoAspirCrit two_opt_aspir_crit; /* Aspiration criterion */ moSimpleMoveTabuList two_opt_tabu_list; /* Tabu List */ moGenContinue continue (10000); /* A fixed number of iter. */ /* Building the Tabu Search from those components */ moTS tabu_search (two_opt_init, two_opt_next, two_opt_incr_eval, two_opt_aspir_crit, two_opt_tabu_list, continue, full_route_eval); /* It applies the TS to the solution */ tabu_search (route);

61 EO & MO  Hybridizing Hybridizing allows to combine: –The exploration power of population-based metaheuristics. –The intensification power of single solution- based metaheurisitcs.

62 Scheme of an EA in ParadisEO-EO

63 ParadisEO-EO/ParadisEO-MO link

64 Implementation of an EA RouteInit route_init; /* Its builds random routes */ RouteEval full_route_eval; /* Full route evaluator */ eoPop pop (POP_SIZE, route_init); /* Population */ eoGenContinue continue (NUM_GEN); /* A fixed number of iterations */ OrderXover crossover; /* Recombination */ CitySwap mutation; /* Mutation */ eoStochTournamentSelect select_one; /* Stoch. Tournament selection */ eoSelectNumber select (select_one, POP_SIZE); /* Standard SGA Transformation */ eoSGATransform transform (cross, CROSS_RATE, mutation, MUT_RATE); eoPlusReplacement replace; /* replacement */ eoEasyEA ea (continue, full_route_eval, select, transform, replace); ea (pop); /* Application on the given population */

65 Implementation of an EA hybridized with a hill climbing RouteInit route_init; /* Its builds random routes */ RouteEval full_route_eval; /* Full route evaluator */ eoPop pop (POP_SIZE, route_init); /* Population */ eoGenContinue continue (NUM_GEN); /* A fixed number of iterations */ OrderXover crossover; /* Recombination */ moHC mutation (two_opt_init, two_opt_next, two_opt_incr_eval, two_opt_move_select, full_route_eval); eoStochTournamentSelect select_one; /* Stoch. Tournament selection */ eoSelectNumber select (select_one, POP_SIZE); /* Standard SGA Transformation */ eoSGATransform transform (cross, CROSS_RATE, mutation, MUT_RATE); eoPlusReplacement replace; /* replacement */ eoEA ea (continue, full_route_eval, select, transform, replace); ea (pop); /* Application on the given population */

66 Conclusions and Perspectives (1/2) ParadisEO-EO/MO is a powerful platform to design high quality optimization methods. It can be used by beginners and experts. It can be easily extended to suit to the user needs. It can be used on Unix and Windows systems

67 Conclusions and Perspectives (2/2) Improving the platform: – adding generic algorithm: Variable Neighbourhood Search (VNS), Iterative Local Search (ILS), Guided Local Search (GLS), … –Adding generic boxes: Other cooling schedule, stopping criteria, … Proposing complete methods for classical problems.

68 Any questions ? Thank you for your attention Multi-objective metaheuristics ???  ParadisEO-MOEO. Parallel and distributed metaheuristics ???  ParadisEO-PEO. ParadisEO web site: http://paradiseo.gforge.inria.fr OPAC team web site: http://www.lifl.fr/OPAC


Download ppt "Software framework for metaheuristics Parallel Cooperative Optimization Research Group Laboratoire d’Informatique Fondamentale de Lille"

Similar presentations


Ads by Google