<<

Outline

► Introduction to ► BRKGA Metaheuristics methods ► Hybrid Metaheuristics ► Local Search ► Matheuristics ► GRASP ► SimHeuristics ► ► Learnheuristics Helena Ramalhinho ► Iterated Local Search

Metaheuristics 1 Metaheuristics 2

Solution Methods Solution Methods

► Branch-and-bound

Local Search Methods ► Branch-and- Metaheuristics ► ► Cutting and price ► Programming ► Lagrangean relaxation Exact Methods ► Linear relaxation Exact Methods ► Surrogate relaxation ► Etc…

Metaheuristics 3 Metaheuristics 4

Solution Methods Solution Methods

► Good solutions for ► Local Improvement Local Search Methods complex and large- Local Search Methods ► Tabu Search Metaheuristics scale problems Metaheuristics ► Iterated Local Search ► Short running times ► ► Easily adapted • Mathematical proved ► Genetic optimal solutions ► Evolutionary algorithms • Important information on the characteristics and Integer Programming ► Ant Colony Optimization properties of the Exact Methods ► Scatter Search problem. ► Memetic Algorithms ► Etc…. Metaheuristics 5 Metaheuristics 6

© Helena Ramalhinho-Lourenço, (2019) 1 Algorithms Algorithms

► Metaheuristics § Any approximate method build up on the basis of the structural § The process of finding a good solution (eventually the optimum) properties or on the characteristics of the problem solution, with consists in applying at each step (guiding) a subordinate reduced with respect to exact methods and providing, which has to be design for each particular problem. in general, good feasible quality solutions, without a forma * C. Ribeiro [1996] guarantee of solution quality. § Cost vs. Time § Have been designed to attack complex where classical heuristics and optimization have failed (so far) to be effective and efficient.

Metaheuristics 7 Metaheuristics 8

Metaheuristics Metaheuristics for real problems

► Four attributes of Heuristics and Metaheuristics: ► Metaheuristics ► Real Problems § Accuracy § Highly effective on hard § Complex problems * Close to optimal problems § Rapid changes in reality § Speed § § Need to quick * Small computational time § Easy implementation implementation § Simplicity § Short updates § Different aspects in * No parameters adjustment / easy to program § Robust different sectors § Flexibility § Able to give good § Need to quick answer * Easy to adapt to other real problems solutions in short time. and multiple scenarios

Cordeau JF, Gendreau M, Laporte G, Potvin JY, Semet F (2002) A guide to vehicle heuristics. J Oper Res Soc 53:512–522.

Metaheuristics 9 Metaheuristics 10

Local optimization algorithms Local optimization algorithms

► Given a solution, attempts to improve this solution by making ► Local search local modifications at each iteration. § 1. Get a initial solution x (current solution). Use a constructive ► Neighborhood heuristic. § N: A® 2A subset of feasible solutions § 2. Search the neighborhood. While there is an untested neighbor § Define a local modification, move; * the neighborhood of a solution x is the subset of feasible solutions of x: obtained from applying this move to x. * 2.1 Let x’ be an untested neighbor of x; § Local optima solution x: * 2.2 If c(x’)

Metaheuristics 11 Metaheuristics 12

© Helena Ramalhinho-Lourenço, (2019) 2 Local optimization algorithms Traveling Salesman Problem

► Design of a local optimization : ► Traveling Salesman Problem § Obtain an initial solution § Traveling Salesman Problem * Heuristic * E: of edges, each has a cost c(e); * Random solution * A: any subset of edges forming a Hamilton cycle; * Constructive method * c(x): total cost of the edges in x.

§ Define the neighborhood 5

* Specific for each problem 8 § How to search the neighborhood 10 10 * Complete search 12 18 * First improvement 5 14 6

Metaheuristics 13 Metaheuristics 14

Vehicle Routing Nearest neighbor algorithm

► Traveling salesman problem – initial solution ► Nearest neighbor algorithm on TSP § Heuristic of the nearest neighbor 1. stand on an arbitrary vertex as current vertex. 2. find out the shortest edge connecting current vertex and an 0 1 12 unvisited vertex V. 3. set current vertex be V. 8 4. mark V as visited. 4 4 20 5. if all the vertices in domain are visited then terminate. Else go to 8 8 step 2. 18 5

10 6

Metaheuristics 15 Metaheuristics 16 2 3

Vehicle Routing Vehicle Routing

► Heuristic of the nearest neighbor ► Heuristic of the nearest neighbor 0 0 1 12 1 12 8 8

4 4 4 4 20 20 8 8 8 8 18 18 5 5

10 10 6 6

2 3 2 3 Metaheuristics 17 Metaheuristics 18

© Helena Ramalhinho-Lourenço, (2019) 3 Vehicle Routing Vehicle Routing

► Heuristic of the nearest neighbor ► Heuristic of the nearest neighbor 0 1 0 1 12 12 8 8

4 4 4 4 20 20 8 8 8 8 18 18 5 5

10 10 6 6 2 3 2 3 Metaheuristics 19 Metaheuristics 20

Vehicle Routing Vehicle Routing

► Heuristic of the nearest neighbor ► Optimal solution 0 1 0 1 12 12

8 8

4 4 4 4 20 20 8 8 8 8 18 18 5 5

10 10 6 6 2 3 2 3 Total distance = 43 Total distance = 35 Metaheuristics 21 Metaheuristics 22

Neighborhood Neighborhood

► Traveling Salesman Problem: ► Traveling Salesman Problem: § 2-Opt Move § 3-Opt Move

Metaheuristics 23 Metaheuristics 24

© Helena Ramalhinho-Lourenço, (2019) 4 Local Search Example TSP – local search application

► Examples… ► Initial solution and current § Construction heuristics solution § 2-opt local search method ► Nearest neighbor heuristic ► http://www-e.uni-magdeburg.de/mertens/TSP/TSP.html

The closest vertex to Berlin is Paris The closest vertex to Paris is Londres The closest vertex to Londres is Sevilla The closest vertex to Sevilla is Roma The closest vertex to Roma is Moscow The nearest to the initial vertex is Moscow

SOLUTION: Nearest-Neighbor ------Route: Berlin, Paris, Londres, Sevilla, Roma, Moscow, Berlin Length: 65

Metaheuristics 25 Metaheuristics 26

Example TSP – local search application Example TSP – local search application

► 2-opt neighborhood ► 2-opt neighborhood § 9 neighbors § 9 neighbors § Neighbor 1 § Neighbor 2 § Cost: 69 § Cost: 69

Metaheuristics 27 Metaheuristics 28

Example TSP – local search application Example TSP – local search application

► 2-opt neighborhood ► 2-opt neighborhood § 9 neighbors § 9 neighbors § Neighbor 3 § Neighbor 4 § Cost: 78 § Cost: 67

Metaheuristics 29 Metaheuristics 30

© Helena Ramalhinho-Lourenço, (2019) 5 Example TSP – local search application Example TSP – local search application

► 2-opt neighborhood ► 2-opt neighborhood § 9 neighbors § 9 neighbors § Neighbor 5 § Neighbor 6 § Cost: 63 § Cost: 73

Metaheuristics 31 Metaheuristics 32

Example TSP – local search application Example TSP – local search application

► 2-opt neighborhood ► 2-opt neighborhood § 9 neighbors § 9 neighbors § Neighbor 7 § Neighbor 8 § Cost: 76 § Cost: 78

Metaheuristics 33 Metaheuristics 34

Example TSP – local search application Example TSP – local search application

► 2-opt neighborhood ► Best neighbor (5)

§ 9 neighbors ► Cost 63 § Neighbor 9 ► New current solution § Cost: 69 § Repeat until find a local optimal § Local optimal solution: The current solution is better than any solution in the neighborhood.

Metaheuristics 35 Metaheuristics 36

© Helena Ramalhinho-Lourenço, (2019) 6 Facility Location Models Location example – Local search

► Important problem in logistics § Where to locate new facilities. * Retailers, warehouses, factories. § Very complex problems ► Warehouse location problem § to locate a set of warehouses in a distribution network ► Cost of locating a warehouse at a particular site: § fixed cost vs cost

* cost of open facility vs. transportation cost Example of M. Resende AT&T Labs Research

Metaheuristics 37 Metaheuristics 38

Location example – Local search Location example – Local search

Example of M. Resende Example of M. Resende AT&T Labs Research AT&T Labs Research

Metaheuristics 39 Metaheuristics 40

Location example – Local search Location example – Local search

Example of M. Resende Example of M. Resende AT&T Labs Research AT&T Labs Research

Metaheuristics 41 Metaheuristics 42

© Helena Ramalhinho-Lourenço, (2019) 7 Location example – Local search Location example – Local search

Example of M. Resende Example of M. Resende AT&T Labs Research AT&T Labs Research

Metaheuristics 43 Metaheuristics 44

Location example – Local search Location example – Local search

Example of M. Resende Example of M. Resende AT&T Labs Research AT&T Labs Research

Metaheuristics 45 Metaheuristics 46

Location example – Local search Vehicle Routing

► A set of customers at known geographical locations has to be supplied by a fleet of vehicles from a single depot. ► Each customer has a specific demand. ► Each route starts and finish at the depot. ► The objective is to find the set of routes whose total length or cost is minimal. § Or minimize the number of routes.

Example of M. Resende AT&T Labs Research

Metaheuristics 47 Metaheuristics 48

© Helena Ramalhinho-Lourenço, (2019) 8 Vehicle Routing The Job-Shop Scheduling

► Careful with the Local search ►A set of n jobs, J1, ... , Jn vehicle capacity! ► Moves:

§ 2-opt like in TSP. ►A set of m machines, M1, ... , Mm § Interchange customers in routes. ► the processing of each job by the machines. ►The objective is to minimize the maximum completion time (makespan)

§ Min Cmax= max Cj.

Metaheuristics 49 Metaheuristics 50

The Job-Shop Scheduling Local search for the Job-Shop

► Initial solution method ► Local Search Method ► Priority dispatching rule: § Initial schedule § Consider a priority . § Simple Neighborhoods: * van Laarhoven, Aarts & Lenstra (1992) § The first operations of all jobs are inserted in a priority queue. § More sophisticates neighborhood and metaheuristics: § At each iteration: * Schedule the maximum priority operation as soon as possible in the * Dell’Amico and Trubian (1993) correspondent machine. * Nowicki, E. and C. Smutnicki (2005) * Delete it from the queue. * The next operation of the same job, if exists, is inserted in the priority queue.

► Other approaches: Shifting Bottleneck Heuristic Metaheuristics 51 Metaheuristics 52

Neighborhood for Job-Shop Neighborhood for Job-Shop

► Neighborhood Exchange J1 and J3 M1 J3 J1 J2 at machine M1 § van Laarhoven, Aarts and Lenstra (1992) M2 § Exchange the processing order of two operations. J3 J2 J1 * Reverse an arc in the graph representing the solution. M3 J2 J1 J3 § Successive operations processed in the same machine. 0 1 2 3 4 5 6 7 M1 J1 J3 J2 § Critical operations. Current solution * Below to the longest path in the graph. M2 J3 J2 J1

M3 J2 J1 J3

0 1 2 3 4 5 6 7 Neighbor solution Metaheuristics 53 Metaheuristics 54

© Helena Ramalhinho-Lourenço, (2019) 9 Neighborhood for Job-Shop Local Search Software

► Reverse an arc ► Local Solver

O11 O21 O31 § http://www.localsolver.com/

0 012 022 032 *

O11 O21 O31

013 023 033

0 012 022 032 *

013 023 033

Metaheuristics 55 Metaheuristics 56

Local Search Software Local Search Software

► Local Solver ► Example § http://www.localsolver.com/ pmedian § Resulting from a 5-year &D project involving distinguished experts in computational optimization, LocalSolver is the first math programming software combining the simplicity of use of a model- and-run solver and the power of local-search techniques for combinatorial optimization. LocalSolver includes an innovative math modeling language for fast prototyping and lightweight object-oriented for full integration (C++, Java, .NET).

Metaheuristics 57 Metaheuristics 58

Local optimization algorithms Computational Results

► Comments ► Local search is clearly inferior to other metaheuristics. § The search stops at the first solution with respect to § Too many local optimal solutions the neighborhood N. ► Tabu-search outperformed the other methods. § The final solution highly depends on the initial solution and on the ► Iterated Local Search neighborhood. § No way back out of unattractive local optima... § Large-step optimization combined with tabu-search gave the better results.

c(x)

local optima global optimal solution x* x x1x2x3x4x5 Metaheuristics 59 Metaheuristics 60

© Helena Ramalhinho-Lourenço, (2019) 10 Multi-Start / Re-start Heuristics GRASP

► Iterative improvement or hill-descending ► Greedy Randomized Adaptive Search Procedure § 1. Get a initial random solution x. § 1. While stopping criterion not satisfied: § 2. Run a Local Search Method (output x) * 2. Get a greedy randomized initial solution x. * 3. Local Search starting with solution x § 3. If cost(x)

Metaheuristics 61 Metaheuristics 62

GRASP Bias Ramdomization Heuristics

► Comments ► Biased Randomization of Heuristics § Very easy to implement § Introduce of a slight modification in the greedy constructive § Greedy heuristics can be develop for almost any combinatorial behavior that provides a certain degree of while problem. maintaining the logic behind the heuristic. § Very few parameters to be set. § BRPs can be categorized into two main groups according to how choice are computed: § Many successful applications. * BRPs using an empirical bias function; * BRPs using a skewed distribution. ► References § M.G.C. Resende and C.C. Ribeiro (2017) “Greedy randomized adaptive search procedures: Advances and extensions” Grasas A., Juan, A.A. Faulin, J., De Armas, J. and Ramalhinho H. (2017), Biased Randomization of Heuristics using Skewed Probability Distributions: applications to routing and other § http://mauricio.resende.info/papers.html problems, Computers & Industrial Engineering 110: 216–228. Doi: 10.1016/j.cie.2017.06.019.

Metaheuristics 63 Metaheuristics 64

MIRHA MIRHA

► Multi-start biased randomization of heuristics with ► procedure MIRHA(inputData, endConditions, prob.Dist., adaptive local search seed, heuristic) § Apply a Greedy Classical Heuristics randomized using a bias § initializeRandomGenerator(seed); distribution: § while endCondition[1]= false do * The main idea of these heuristics is to select the next step from a list * solution = getRandomSolution(inputData, heuristic, prob.Dist.); of available movements, usually according to a greedy criterion. * solution = adaptiveLocalSearch(solution, endCondition[2]); * we consider non-uniform and nonsymmetric (biased) distributions, * bestSolution = updateBestSolution(solution); e.g.: the geometric distribution or the decreasing triangular distribution. § end while; § Local Search § return bestSolution; ► end MIRHA

Metaheuristics 65 Metaheuristics 66

© Helena Ramalhinho-Lourenço, (2019) 11 Bias Ramdomization ILS Simulated Annealing

► Skewed Theoretical Probability Distributions ► Simulated Annealing § Pseudocode to select the next element using a skewed distribution. § Attempts to avoid stopping in bad local optima by allowing uphill

Procedure BRP(L, s, PD, p) moves. 01 µ ß using seed s, generate pseudo-random number in [0,1) 02 ρ ß using µ, generate random variate from distribution PD(p) § The probability of accepting uphill moves decreases with the 03 l ß select the ρ-th element of the sorted list L 04 return l number of iterations performed. End § Convergence proof () Distribution Plot Geometric

0.20 p § Easy to implement 0.1 0.2

0.15 * implementation choices: problem-specific and generic. y t i l i b

a § Large computation running times b 0.10 o r P

0.05 * Kirkpatrick, Gelatt & Vecchi [1983], Cerny [1985] * Johnson et al. [1989] 0.00 0 10 20 30 40 50 X X = total number of trials. Metaheuristics 67 Metaheuristics 68

Simulated Annealing Tabu-Search

► Simulated annealing with a geometric cooling schedule: ► Tabu Search § Get a initial solution x; § Attempts to escape from local optima and continue the search further. § Get a initial temperature t; § Make the best move found… § While a certain stop-criteria is not verified: * Problem: alternates between two solution. * Perform the following loop L times: § Tabu list – Pick a random neighbor x’ of x; – Let dc= cost(x’)-cost(x) * Information about the most recently made moves is kept in a – If dc ≤ 0 set x=x’, tabu list. – otherwise set x=x’ with probability exp(-dc/t); * Some solution in the neighborhood are tabu for some * Set t=r*t; iterations (tabu-tenure) § Adaptive memory § Return the best solution found. ► Glover [1989], Glover [1990], Glover & Laguna [1997]

Metaheuristics 69 Metaheuristics 70

Tabu-Search Tabu-Search

► Aspiration Criteria ► Tabu-Search with diversification / intensification strategy: § Accept a tabu-move if leads to the best solution seen so far. § Get a initial solution x; ► Intensification Strategy § While a certain stop-criteria is not verified: § Focus the search into more promising regions. * Get the neighbor x’ of x, not tabu or satisfying an aspiration criteria * After a certain number of iterations without an improvement in with minimal cost among the neighbors of x; the best solution, restart the algorithm with the best solution * Set x=x’ and update the tabu list and aspiration criteria; found. § Execute a diversification or an intensification strategy and repeat. ► Diversification strategy § Return the best solution found. § Drive the search to unexplored regions. ► Stopping Criteria § Maximum number of iterations or § One intensification phase where the best solution was not changed.

Metaheuristics 71 Metaheuristics 72

© Helena Ramalhinho-Lourenço, (2019) 12 Tabu-Search Tabu-Search

► Design of a Tabu- (1/2): ► Design of a Tabu-Search algorithm (2/2): § Obtain an initial solution § Define the tabu criteria § Define the aspiration criteria * Heuristic § Intensification Strategy * Random solution § Diversification strategy § Define the neighborhood § Stopping Criteria * Specific for each problem * Running time § How to search the neighborhood * Number of iterations without improvement * Complete search * First improvement ► All of the above are problem-specific.

Metaheuristics 73 Metaheuristics 74

Tabu List Tabu-Search

► Traveling Salesman Problem: 2-Opt move ► Comments § The tabu list consists of the shortest edged of the two deleted by a § Produces good solutions in relatively small computational times. move, Glover [1986] § Good quality solutions: best solutions for many problems. * tabu move: reinsert this edge § Large number and diversification of applications. § The tabu list consist of pairs of edges, each pair being the set of edges deleted in some previous iteration, Knox [1994]. * tabu move: reinsert this pair of edges

Metaheuristics 75 Metaheuristics 76

Production Scheduling Problem in a Production Scheduling Problem in a Cardboard Box Factory Cardboard Box Factory

► Factory that produces different cardboard boxes. ► Phase 1 Vinho do Porto § each order passes first in a trim machine, where the cardboard is § A cutting-stock problem. cut in rectangles (phase 1). * § then, goes to several converting machines that finish the box § The orders are cut with the objective of minimizing the left overs. (phase 2) (unrelated parallel machines): ► Phase 2 * Folding § Each converting machine can do some specific operations; * Printing Vinho do * Glue Porto § Each order (job) needs some operations. * Staple § Release dates and due dates. § The processing time of each operation depends on the order and Coffee on the machine. § The set-up time depends on the machine and operations. Metaheuristics 77 Metaheuristics 78

© Helena Ramalhinho-Lourenço, (2019) 13 Vinho do Vinho do Production Scheduling Problem Porto A Generalized Job-Shop Porto

► The usual constraints for the generalized job-shop ► Objective: scheduling problem, and... § Minimize a general cost function

§ Each operation Oij can be processed by a subset of the machines, but has a preferred one. ► The cost function is a combination of several functions: § Each operation Oij has a different processing time in each of the § cost of a machine being idle; machines, pijk. § cost of the processing an operation in a certain machine; § Each job has a release time, rj . § cost of switching from a operation to other operation in a certain § Each job has a duedate, dj . machine; § Between the processing of two operations in the same machine § cost related with late jobs. there can exist a set-up time. ► Minimize a general cost function.

Metaheuristics 79 Metaheuristics 80

Vinho do Vinho do Production Scheduling Porto Production Scheduling Porto

► Two types of moves: ► Tabu-Search Algorithm § Type I: § Initial solution: Priority dispatching rule (slack time) * Pick two operations that are processed consecutively in the same § Moves: Type I &Type II, Tabu List machine. § Aspiration Criteria * Reverse the order of processing these operations. * Over rule a tabu move if lead to a better solution seen so far. – Classical job-shop: only pair of operations in the critical path. § Intensification Strategy § Type II: * Focus on the scheduling of one machine if this can improve * Pick an operation that can be processed in more than one machine. significantly the solution. * Switch the operation from the actual machine to other machine that * Use a constructive and improvement heuristic. can processed it. § Switch from one type of move to other after a certain number of iterations, or if there is no improvement.

Metaheuristics 81 Metaheuristics 82

Vinho do Production Scheduling Porto Iterated Local Search

► Good results ► A Local Search Method. § improves the cost of the initial solution about 3% to 7 %. ► Combines local optimization with a big § no optimal cost or other solutions methods to compare. transition/perturbation. ► Flexible method § Diversification strategy based on the structure of the problem. § permits to change the cost function without changing the full § Optimization techniques program. ► Local optimal solutions. § different parameters (tabu-list size, etc.) do not make a big influence in the results. ► Able to make large changes at any stage of the algorithm. Next Topic!

Metaheuristics 83 Metaheuristics 84

© Helena Ramalhinho-Lourenço, (2019) 14 Genetic Algorithms Genetic Algorithms

► Genetic algorithms ► Main Operators § Based on § Evaluation of the (objective function) of each individual § Use information of a population of individuals (solutions) during the search § Selection of well adapted individuals for better solutions. § Crossover (recombination) of select individuals * Not only information from a single individual. § Mutation of some individuals ► Important aspects § Representation of the solutions * binary: genetic algorithms next generation * vector of real numbers: evolution strategies § Generation of the initial solution § Selection of suitable parents Selection, Crossover, Mutation § Genetic Operators: crossover and mutation. Metaheuristics 85 Metaheuristics 86

Genetic Algorithms Bias Random Key

► (Simple) Genetic Algorithm ► GAs and random keys § Get a initial Population P(0); § Introduced by Bean (1994) for sequencing problems. § While a certain stop-criteria is not verified: § Individuals are strings of real-valued numbers (random keys) in * Evaluate the fitness of each individual in P(t); the interval [0,1]. * Construct new population P(t+1): S = ( 0.25, 0.19, 0.67, 0.05, 0.89 ) – Select elements from P(t); s(1) s(2) s(3) s(4) s(5) – Crossover these elements; § Decode by sorting vector of random keys – Mutation of some elements. § Sorting random keys results in a sequencing order: § Return the best solution found. S' = ( 0.05, 0.19, 0.25, 0.67, 0.89 ) s(4) s(2) s(1) s(3) s(5) Sequence: 4 – 2 – 1 – 3 – 5

Metaheuristics 87 Metaheuristics 88

Bias Random Key Genetic Algorithm Bias Random Key Genetic Algorithm

► Random-keys vs biased random-keys § How do random-key GAs (Bean, 1994) and biased random-key GAs differ? * A random-key GA selects both parents at random from the entire population for crossover: some pairs may not have any elite solution * A biased random-key GA always has an elite parent during crossover * Parametrized uniform crossover makes it more likely that child inherits characteristics of elite parent in biased random-key GA while it does not in random key GA (survival of the fittest)

Metaheuristics 89 Metaheuristics 90

© Helena Ramalhinho-Lourenço, (2019) 15 Bias Random Key Genetic Algorithm Bias Random Key Genetic Algorithm

► J.F. Gonçalves and M.G.C. Resende (2016) “Biased random-key ” Handbook of Heuristics, R. Martí, P.M. Pardalos, and M.G.C. Resende, eds., Springer, 2016 § http://mauricio.resende.info/papers.html

Metaheuristics 91 Metaheuristics 92

Bias Random Key Genetic Algorithm Bias Random Key Genetic Algorithm

► Decoders § A decoder is a deterministic algorithm that takes as input a random-key vector and returns a feasible solution of the optimization problem and its cost. § Bean (1994) proposed decoders based on sorting the random-key vector to produce a sequence. § A random-key GA searches the solution space indirectly by searching the space of random keys and using the decoder to evaluate fitness of the random key.

Metaheuristics 93 Metaheuristics 94

Open Vehicle Routing Open Vehicle Routing

► Visit all customer but does not have to start or finish at the ► Time- Capacity Open VRP (1/2) depot… § A direct graph G = (V, A) is given, where V = {0, 1, …, n) is the set 0 4 of n + 1 nodes and A is the set of arcs. 5 § Node 0 represents the depot while the remaining nodes V’ = V \ 8 {0} corresponds to the n visiting points.

§ Each collection point i ϵ V’ has qi products/boxes to be transported 3 to the depot (assume q0 = 0). 7 1 § Distance and travel times between each node.

2 6

Metaheuristics 95 Metaheuristics 96

© Helena Ramalhinho-Lourenço, (2019) 16 Open Vehicle Routing Open Vehicle Routing

► Time-Constraint Capacity Open VRP (2/2) ► Applications of the Time-Constraint Capacity Open VRP § Open routes (start at the first point and finish at the depot) § Blood Collection Sample at a Clinical Laboratory (2 hours) § The vehicle fleet is composed M = {1,…, m} identical vehicles with § Patients transportation to medical exams (1 hour) capacity Qk. § School Bus (1 hour time constraint) § The travel maximum time between the first point to the depot is k § Retailing with subcontracted distribution transportation (8 hours hours. working time) § Minimize the total distance (or transportation costs) § Etc.

Metaheuristics 97 Metaheuristics 98

Open Vehicle Routing Open Vehicle Routing- Real Application

► Decoder for the Time-Constraint Capacity Open VRP ► The Blood Sample Collection at a Clinical Laboratory § Suppose each collection points has one bag and the capacity of § Application Lab 1: 43 collection points the vehicles is 2. § Actually 10 routes § A solution: S = ( 0.25, 0.19, 0.67, 0.05, 0.89 ) § Data: Decoding… * Laboratory S’= ( 0.05, 0.19, 0.25, 0.67, 0.89 ) * Distances and time by google maps s(4) s(2) s(1) s(3) s(5) Sequence: 4 – 2 – 1 – 3 – 5 – vrp.upf.edu § Means that 3 routes are obtained: § Two scenarios & two different truck capacities * 4-2-lab * 1-3-lab * 5-lab

Metaheuristics 99 Metaheuristics 100

Open Vehicle Routing- Real Application Open Vehicle Routing- Real Application

► The Blood Sample Collection at a Clinical Laboratory ► BRKGA * Lab 1: saving 30% of total annual routing costs (around 45.000€) § The results were obtained in 100 seconds. * Better management if there are new collection points or changes in

the address. Number of Routes * Better service quality (2 hours transportation). Current BRKGA Solution * Better planning in the case of laboratory merging strategy. Solution Vehicle Vehicle Capacity = Capacity = 16 25 Scenario I CST+HUMT 5 3 3 ICS 5 5 4 Scenario II CST+HUMT+I 7 7

Grasas A., Ramalhinho H., Pessoa L.S., Resende M.G.C., Caballé I. and Barba N. (2014) On the CS Improvement of Blood Sample Collection at Clinical Laboratories, BMC Health Services Research, 14:12 DOI:10.1186/1472-6963-14-12. WoS, 2014 JCR IF = 1.712, Q2. Open access article.

Metaheuristics 101 Metaheuristics 102

© Helena Ramalhinho-Lourenço, (2019) 17 Open Vehicle Routing- Real Application Ant Colonies

► Upper and lower bounds on the number of routes ► Ant Colony Optimization studies artificial systems that take § using CPLEX CPLEX Solution inspiration from the behavior of real ant colonies. Vehicle Capacity Vehicle Capacity § 1h (CST+HUMT) = 16 = 25 § Ants seem to be able to find their way, from nest to a food source

§ 2h (ICS) Scenario I CST+HUMT 4(3) 4(2) and back, with relative easy. ICS 5* 6(3) § 3h (CST+HUMT+ICS) Scenario II CST+HUMT+I 13(6.43) 14(5) § Entomology studies discovered that in many cases this capacity is

CS the result of interplay via chemical communication (Pheromone) between ants and the presence of many ants. ► Recall BRKGA results in 100 seconds Number of Routes BRKGA Solution ► Current Dorigo, Maniezzo & Colorni [1991] Solution Vehicle Capacity = 16 Vehicle Capacity = 25 Scenario CST+HUMT 5 3 3 ICS 5 5 4 ScenarioI CST+HUMT+ICS 7 7

II Metaheuristics 103 Metaheuristics 104

Ant Colonies Hybrid Metaheuristics

► Traveling Salesman Problem ► HM combine various algorithmic components of different

§ Assign initially tij constant to each edge. metaheuristics and even other optimization and artificial § Each ant acts as follows: intelligent approaches. * At every step the ant chooses, using a probabilistic rule, a city to § …complementary metaheuristics, mathematical programming, move among those not yet visited. simulation, and … * The probability of choosing edge (i,j) is directly proportional to the ► amount tij of pheromone in the edge and to inverse of edge length cij. The main motivation behind the hybridization of different * The ant remembers each city already visited. algorithms is to exploit the complementary character of * After a tour, the ant lays a positive trail on each edge in the tour. And different optimization strategies. account some evaporation. § Blum, C., Puchinger, J., Raidl, G. R., & Roli, A. (2011). Hybrid metaheuristics in § Now, consider M ants moving in the graph simultaneously. Ants combinatorial optimization: A survey. Applied Soft Computing, 11(6), 4135–4151. laying trail on a set of edges make them more “desirable” for other § Talbi, E. (2013), Hybrid Metaheuristics, Studies in Computational Intelligence, Springer. ants. Metaheuristics 105 Metaheuristics 106

Solution Methods Matheuristics

► Good solutions for Local Search Methods complex and large- Local Search Methods Metaheuristics scale problems Metaheuristics ► Short running times ► Easily adapted • Mathematical proved Matheuristics optimal solutions • Important information on the characteristics and Integer Programming Integer Programming properties of the Exact Methods Exact Methods problem.

Metaheuristics 107 Metaheuristics 108

© Helena Ramalhinho-Lourenço, (2019) 18 Matheuristics Matheuristics: Classification

► Refers to … ► Exact algorithms to explore large neighborhoods within local search. § on exploiting mathematical programming (MP) techniques in a ► Information of high quality solutions found in several runs of local (meta)heuristic framework or search is used to define smaller problems solvable by exact § on granting to mathematical programming approaches the algorithms. cross-problem robustness and constrained-CPU-time ► Exploit lower bounds in constructive heuristics. effectiveness which characterize metaheuristics. ► Local search guided by information from integer programming * Copied from Matheuristics 2010 Conference webpage. relaxations. ► Use exact algorithms for specific procedures within metaheuristics. ► Integrative Combinations § Incorporating exact methods in metaheuritics § Incorporating metaheuristics in exact methods

Metaheuristics 109 Metaheuristics 110

Matheuristics Matheuristics: Examples

► Maybe the first application… ► Set Covering / Partitioning Problem § Use an exact algorithm to solve a sub-problem within a Local ► Crew scheduling problem Search heuristic for the Job-Shop Scheduling Problem § Crossover operator considering the columns in the parents and * Perturbation Step: Solving to optimality the one-machine solving to optimality the reduced set covering problem. scheduling problem with due dates and delivery times using the * Perfect Child /offspring Carlier Algorithm. § Aggarwal, C.C., J.B. Orlin, and R.P. Tai. (1997). “An Optimized Crossover for * Iterated Local Search Maximum Independent Set,” 45, 226-234. – Lourenço H.R. (1995), Job-Shop Scheduling: computational study of local search § Lourenço H.R., Paixão J.P. and Portugal R. (2001), Multiobjective metaheuristics and large-step optimization methods. European Journal of Operational Research 83(2): 347-364. ISSN 0377-2217. for the bus-driver scheduling problem. Transportation Science 35(3): 331-343. * Tabu Search – Lourenço HR. and Zwijnenburg M. (1996), Combining the large-step optimization with tabu-search: application to the job-shop scheduling problem. In Meta-Heuristics: Theory and Applications, I.H. Osman and J.P. Kelly (Eds.), Kluwer Academic Publishers, pp. 219-236. ISBN: 978-0-7923-9700-7 Metaheuristics 111 Metaheuristics 112

Matheuristics: Examples Matheuristics: Examples

► Mixed Integer Programming ► § Construction of promising neighborhood using information § Iterated Local Search to assign customer to route and optimize the contained in a continuous relaxation of the MIP model. sequencing of the customers. * Relaxation Induced Neighborhood Search * Solve a TSP using Concorde algorithm, § Danna, E., Rothberg, E., & Pape, C. Le. (2005). Exploring § Dynamic programming is applied to determine the arriving time at relaxation induced neighborhoods to improve MIP solutions. each customer. Mathematical Programming, Ser. A, 102, 71–90. * Ibaraki, Kubo, Masuda, Uno & Yagiura (2001) * Network design and multicommodity routing § Exploring a large scale neighborhood using dynamic programming * Job-shop scheduling with earliness and tardiness in a VRP problem. * Local branching * Thompson & Psaraftis(1993)

Metaheuristics 113 Metaheuristics 114

© Helena Ramalhinho-Lourenço, (2019) 19 Matheuristics Matheuristics

► Real Applications ► Main References § Maybe the best set of problems to apply Matheuristics methods… § Dumitrescu, I. and T. Stutzle (2003). Combinations of local search and exact algorithms. In G. R. Raidl ed. Applications of Evolutionary § Why? Computation. vol 2611 of LNCS, pp. 211-223. Springer. * Complex problems with a large number of constraints. § Fernandes S. and Lourenço H.R. (2007), Hybrids Combining Local * Sometimes difficult to model… Search Heuristics with Exact Algorithms. In Proceeding of the V Congreso * But, a simplification of the problem is frequently a well-studied Español sobre Metaheurísticas, Algoritmos Evolutivos y Bioinspirados, optimization problem. MAEB’2007, F. Rodriguez, B. Mélian, J.A. Moreno, J.M. Moreno (Eds.) § Apply metaheuristics for the real general problem, and exact Tenerife, Spain, February 14-16, pp. 269-274. ISBN 978-84-690-3470-5. methods for the well-known problem. § Puchinger, J. and G. R. Raidl (2005). "Combining Metaheuristics and Exact Algorithms in Combinatorial Optimization: A Survey and Classification." Lecture Notes in , vol. 3562.

Metaheuristics 115 Metaheuristics 116

Simheuristics Simheuristics

► Many real-world problems are NP-hard and actually also ► A Simheuristics approach is a show behavior. particular case of simulation- ► If the system becomes complex, it’s tempting to over- optimization (similar to simplify the assumptions to have an analytically tractable simulation-based optimization, model. but focused on H/MH and § Advantage: you get exact (and deterministic) answers SCOPs). § but… how good is such answer to a stochastic problem? ► Juan, A.A., Faulin, J., Grasman, S. E., Rabe, M., & Figueira, G. (2015). A review of ► Simulation can deal with complex models...but… simheuristics: Extending metaheuristics to deal with stochastic combinatorial optimization § Can get the best scenario? problems. Operations Research Perspectives, § How to deal with decision variable? 2, 62–72. § How to deal with optimization? ► Work of Juan, A.SA. And de Armas J. Metaheuristics 117 Metaheuristics 118

Simheuristics Simheuristics

► Generate promising solution in the deterministic world. ► Validate these solution in the stochastic world.

Source: Jesica de Armas ([email protected]) Metaheuristics 119 Source: Jesica de Armas ([email protected]) Metaheuristics 120

© Helena Ramalhinho-Lourenço, (2019) 20 LearnHeuristics LearnHeuristics

► Inputs are deterministic (i.e., non-stochastic) but, instead of being fixed in advance, they vary according to the structure of the solution, § i.e., they change as the solution is being constructed following a heuristic-based iterative process. ► Existing literatura: § Machine learning is employed to enhance metaheuristics. § Metaheuristics are used to improve the performance of machine learning techniques. ► Calvet, L., Armas, J. De, Masip, D., & Juan, A. A. (2017). Learnheuristics: Hybridizing metaheuristics with machine learning for optimization with dynamic inputs. Open Mathematics, 15(1), 261–280. Metaheuristics 121 Source: Jesica de Armas ([email protected]) Metaheuristics 122

Example of LearnHeuristics Metaheuristics

► Which is the best metaheuristic? § begin with a simple method and then turn, if necessary, to a more complicated one or refine the first implementation § Small number of parameters § Evaluate its performance by: * Accuracy * Speed * Simplicity * Flexibility

Source: Jesica de Armas ([email protected]) Metaheuristics 123 Metaheuristics 124

© Helena Ramalhinho-Lourenço, (2019) 21