Inspection Route Optimization Bernard Gendron Thibaut Vidal + August 11, 2017 CRM Industrial Problem Solving Workshop, Montréal, Canada CIRRELT and Département d informatique et de recherche opérationnelle, Université de Montréal, Canada + PUC-Rio - Pontificia Universidade Catòlica do Rio de Janeiro
Outline Team Problem Definition Problem Formalization Model for the Annual Problem Model for the Weekly Problem Heuristic Methods for the Weekly Problem Conclusions
Students 1. Steven Lamontagne, Université de Montréal 2. Belhal Karimi, Polytechnique Paris 3. David Hagenimana, University of Nairobi 4. Jalal Ahammad, Memorial University of Newfoundland 5. Monuara Gagum, Memorial University of Newfoundland 6. Dena Kazerani, Polytechnique Paris 7. Ilya Chugunov, UC Berkeley 8. Maikel Geagea, Polytechnique Montréal 9. Mickael Albertus, Université Paul Sabatier Toulouse 10. Bora Yongacoglu, Queens University
Coordinators Bernard Gendron Thibaut Vidal Mathieu Giguère, The Co-Operators Jean-Michel Plante, The Co-Operators
The Co-Operators
Description of the Application Locations (buildings, stores, farms,...) all across Canada The company has to decide if a particular location is worth to insure or not A risk score is computed following an off-site inquiry When the risk score is high, an inspector is sent to visit the location (on-site inquiry) More than 5,000 locations need to be visited (over a year) Not enough inspectors to visit all of them! Which locations should be visited over the next year?
Methods Implemented by the Company Old method 11 inspectors: assign each of them to a territory (divided by province) based on their home For each inspector, assign the locations to be inspected in descending order of risk scores Drawback: too greedy! New method Same assignment of inspectors to territories Decompose each territory by cities to which locations are assigned For each city, find a tour that maximizes risk scores and minimizes distances Drawbacks: 1) arbitrary decomposition 2) time limits not always respected
High-Level View of the Problem Objective: maximize risk scores Constraints: time limits Each day: every inspector makes a tour (starting and ending at a hotel) whose total duration (travel + inspection) should not exceed 7 hours Each week: every inspector makes up to 5 daily tours before coming back home Over the year: every inspector works (about) 46 weeks Decomposition into weekly problems assembled in an annual problem
Solutions of the Weekly Problem
Assignment of Tasks to Team Members 1. Extract and analyze data given by the company 2. Develop and implement model for the annual problem 3. Develop and implement model for the weekly problem 4. Develop and implement heuristic methods for the weekly problem
Annual Problem: Assumptions and Data Assume we know all weekly solutions: not realistic, but it helps to model the problem! Each weekly solution has an inspector traveling from/to home and making 5 daily tours I : set of weekly solutions J: set of locations K: set of inspectors δ ij = 1 if location j J belongs to weekly solution i I, 0 otherwise θ ik = 1 if inspector k K is assigned to weekly solution i I, 0 otherwise p i : profit (risk score) of weekly solution i I W k : annual number of weeks worked by inspector k K
Annual Problem: Model x i = 1, if weekly plan i I is selected, 0 otherwise max i I p i x i δ ij x i 1 i I θ ik x i W k i I x i {0, 1} j J k K i I (Constrained) Set Packing Problem: NP-hard
Annual Problem: Solution Methods Column generation based on linear programming + Branch-and-Price Exact method! It takes some time to develop... Column generation based on solving lots of weekly problems + Branch-and-Bound Heuristic method Doable in a few days/weeks Can be used as warmstart to speedup exact method
Formalization of the Weekly Problem Construct a set of d 5 daily tours such that: Overall profit (risk score) is maximized The daily time limit is respected This is a variant of Vehicle Routing Problem (VRP) known in the literature as the Team Orienteering Problem (TOP) Once a TOP is solved (through a model or by using heuristic methods): Complete the week if necessary (by solving another TOP) Assign set of 5 daily tours to nearby inspectors This gives a few complete weekly solutions
TOP: Assumptions and Data d tours to construct Locations: 1,..., n Duplicate depot (hotel): origin 0 and destination n + 1 G = (V, A): V = {0, 1,..., n, n + 1} A = {(i, j) i V n+1, j V 0 } (V i = V \ {i}) p i : profit at location i V (p 0 = p n+1 = 0) t ij : time at arc (i, j) A (travel from i to j + inspection at j; t 0(n+1) = 0) T : daily time limit
TOP: Generic Model y l x l ij i = 1, if i V is selected in tour l, 0 otherwise = 1, if (i, j) A is selected in tour l, 0 otherwise max d p i yi l i V l=1 xij l = yi l i V n+1, l = 1,..., d j V i xji l = yi l i V 0, l = 1,..., d j V i y l 0 = y l n+1 = 1 d l=1 l = 1,..., d y l i 1 i V \ {0, n + 1}
TOP: Generic Model (continued) (i,j) A y l i {0, 1} x l ij {0, 1} t ij x l ij T Symmetry Breaking Constraints: l = 1,..., d i V, l = 1,..., d (i, j) V, l = 1,..., d x l 0i x l+1 0j i V 0, j V 0, i j, l = 1,..., d 1 Subtour Elimination Constraints (SEC): Classical SEC involve exponential number of constraints: can be handled by cutting-plane method (a lot of time to develop) Compact (polynomial size) formulation can be obtained through multicommodity flows
SEC: Multicommodity Flows w kl ij : flow on (i, j) A destined to k V 0 in tour l j V i w kl ij wji kl = j V i yk l, i = 0 yk l, i = k 0, i 0, k i V, k V 0, l = 1,..., d 0 w kl ij x l ij (i, j) A, k V 0, l = 1,..., d
TOP: Heuristic Methods Heuristic methods are often preferred to solving a model, as they can provide (effective) solutions much faster Here, we have to solve a large number of TOPs to feed the annual problem: it is crucial to solve them quickly! Even if we could solve the above multicommodity flow model, heuristic methods are interesting, as they provide starting solutions that speedup the solution of the model Local Search methods are among the most efficient and effective heuristics for VRPs
TOP: Local Search Location-based moves: Add (i, j): add location i (not in tour) immediately after j (in tour) Switch (i, j): insert location i (not in tour) in place of j (in tour) Routing-based moves: 2-opt (i, j): replace 2 arcs (one starting at i, the other ending at j) in a tour by 2 other arcs (intra-route) 2-opt (i, j): replace 2 arcs (one starting at i, the other ending at j) in different tours by 2 other arcs (inter-route) Relocate (i, j): remove a sequence of visits (starting at i and ending at j) from a tour and insert the sequence in a tour (intra- or inter-route) Swap (i, j): swap locations i and j in a tour or in 2 tours (intra- or inter-route)
TOP: Local Search (continued) Typical Metaheuristic Framework: Start from routes computed by greedy (randomized) heuristic (or from empty routes) For each (i, j) (in random order), try each move and move to improving solution Restart by perturbing the solution (Iterated Local Search) or by starting from scratch (Multistart/GRASP) Other Metaheuristics are possible: Simulated Annealing (SA), Tabu Search (TS), Variable Neighborhood Search (VNS) Suggested data structures for a route: Doubly linked list + array of pointers: move performed in O(1) Forward and backward times: feasibility checking in O(1)
Achievements A formalization of the problem presented by the company A natural decomposition based on planning horizon: year divided into weeks Mathematical programming models for annual and weekly problems Local Search heuristics for the weekly problem Python codes for: Preprocessing and input/output Solving model for the annual problem (with Gurobi) Solving the weekly problem by Local Search
Forthcoming (?) Solve the weekly problem by Local Search/Mathematical Programming Solve the annual problem by heuristic column generation + Branch-and-Bound Solve the annual problem by LP-based column generation + Branch-and-Price Implement solution with the company