Vehicle routing in Python

Slides:



Advertisements
Similar presentations
Cognitive Radio Communications and Networks: Principles and Practice By A. M. Wyglinski, M. Nekovee, Y. T. Hou (Elsevier, December 2009) 1 Chapter 12 Cross-Layer.
Advertisements

1 LP Duality Lecture 13: Feb Min-Max Theorems In bipartite graph, Maximum matching = Minimum Vertex Cover In every graph, Maximum Flow = Minimum.
ECE Longest Path dual 1 ECE 665 Spring 2005 ECE 665 Spring 2005 Computer Algorithms with Applications to VLSI CAD Linear Programming Duality – Longest.
1 Lecture 2 Shortest-Path Problems Assignment Problems Transportation Problems.
Introduction to Algorithms
An Exact Algorithm for the Vehicle Routing Problem with Backhauls
The 2 Period Travelling Salesman Problem Applied to Milk Collection in Ireland By Professor H P Williams,London School of Economics Dr Martin Butler, University.
Management Science 461 Lecture 2b – Shortest Paths September 16, 2008.
Modeling Rich Vehicle Routing Problems TIEJ601 Postgraduate Seminar Tuukka Puranen October 19 th 2009.
EMIS 8373: Integer Programming Valid Inequalities updated 4April 2011.
Branch and Bound Similar to backtracking in generating a search tree and looking for one or more solutions Different in that the “objective” is constrained.
Approximation Algorithms
Network Optimization Models: Maximum Flow Problems In this handout: The problem statement Solving by linear programming Augmenting path algorithm.
1 Branch and Bound Searching Strategies 2 Branch-and-bound strategy 2 mechanisms: A mechanism to generate branches A mechanism to generate a bound so.
1 Lecture 4 Maximal Flow Problems Set Covering Problems.
1.3 Modeling with exponentially many constr.  Some strong formulations (or even formulation itself) may involve exponentially many constraints (cutting.
Linear Programming Topics General optimization model LP model and assumptions Manufacturing example Characteristics of solutions Sensitivity analysis Excel.
Introduction to Job Shop Scheduling Problem Qianjun Xu Oct. 30, 2001.
Minimum Cost Flows. 2 The Minimum Cost Flow Problem u ij = capacity of arc (i,j). c ij = unit cost of shipping flow from node i to node j on (i,j). x.
Logical Topology Design
The Application of The Improved Hybrid Ant Colony Algorithm in Vehicle Routing Optimization Problem International Conference on Future Computer and Communication,
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
11.5 Implicit Partitioning/Packing Problems  Given M = {1, …, m}, K implicitly described sets of feasible subsets of M. Find a maximum value packing or.
An Integrated Approach to Load Matching, Routing, and Equipment Balancing Problem Sarah Root June 8, 2005 Joint work with advisor Amy M. Cohn.
V. Cacchiani, ATMOS 2007, Seville1 Solving a Real-World Train Unit Assignment Problem V. Cacchiani, A. Caprara, P. Toth University of Bologna (Italy) European.
Column Generation By Soumitra Pal Under the guidance of Prof. A. G. Ranade.
Branch-and-Cut Valid inequality: an inequality satisfied by all feasible solutions Cut: a valid inequality that is not part of the current formulation.
1 Inventory Control with Time-Varying Demand. 2  Week 1Introduction to Production Planning and Inventory Control  Week 2Inventory Control – Deterministic.
Branch and Bound Algorithms Present by Tina Yang Qianmei Feng.
Chapter 2. Optimal Trees and Paths Combinatorial Optimization
Resource Allocation in Hospital Networks Based on Green Cognitive Radios 王冉茵
Global Optimization Methods for the Discrete Network Design Problem Dr. Shuaian Wang Lecturer University of Wollongong Dr. Qiang Meng Associate Professor.
Management Science 461 Lecture 4a – P center September 30, 2008.
Branch and Bound Searching Strategies
The minimum cost flow problem. Solving the minimum cost flow problem.
Approximation Algorithms Duality My T. UF.
Constraint Programming for the Diameter Constrained Minimum Spanning Tree Problem Thiago F. Noronha Celso C. Ribeiro Andréa C. Santos.
1 Chapter 5 Branch-and-bound Framework and Its Applications.
Tuesday, March 19 The Network Simplex Method for Solving the Minimum Cost Flow Problem Handouts: Lecture Notes Warning: there is a lot to the network.
Discrete Optimization MA2827 Fondements de l’optimisation discrète Material from P. Van Hentenryck’s course.
MIT and James Orlin © The Geometry of Linear Programs –the geometry of LPs illustrated on GTC.
St. Edward’s University
Linear Programming: Sensitivity Analysis and Duality
Integer Programming An integer linear program (ILP) is defined exactly as a linear program except that values of variables in a feasible solution have.
The minimum cost flow problem
Network Simplex Animations
EMIS 8373: Integer Programming
1.3 Modeling with exponentially many constr.
1.206J/16.77J/ESD.215J Airline Schedule Planning
Network Optimization Research Laboratory
Analysis of Algorithms
Integer Linear Programming
Integer Programming (정수계획법)
1.206J/16.77J/ESD.215J Airline Schedule Planning
Copyrights (H.Rashidi & E.Tsang)
1.3 Modeling with exponentially many constr.
D1 Discrete Mathematics
Integer Programming (정수계획법)
Chapter 5 Network Modeling.
Successive Shortest Path Algorithm
Flow Feasibility Problems
11.5 Implicit Partitioning/Packing Problems
11.5 Implicit Partitioning/Packing Problems
Part II General Integer Programming
Integer Linear Programming
Intersection Cuts from Bilinear Disjunctions
Branch-and-Bound Algorithm for Integer Program
REVIEW FOR EXAM 1 Chapters 3, 4, 5 & 6.
EMIS The Maximum Flow Problem: Flows and Cuts Updated 6 March 2008
Presentation transcript:

Vehicle routing in Python December 6th 2017 Guillaume Crognier Ecole polytechnique, Paris

Vehicle routing in Python Summary I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Vehicle routing in Python

I Problem presentation Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Problem description A set of vehicles Streets to be served Limited capacity How to serve every street in a minimum of time ? Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Why is it interesting for Orange ? A set of vehicles External problems (clients) -Various problems (eg: waste collection) Problems directly related to Orange -Network maintenance -Infrastructure deployment Streets to be served Limited capacity How to serve every street in a minimum of time ? Vehicle routing in Python

II First approach: the standard formulation Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Notations Parameters Let E be the set of the edges. For every e in E, e+ et e- will be the corresponding arcs. Let A be the set of the arcs. For every a in A, a will be the corresponding edge. de is the edge e demand, and ce is the travel cost. m is the number of vehicles available, K is the maximum capacity of a given vehicle. D is the depot: all vehicles must start and end their paths there. Variables Xka represents the number of times the vehicle k passes through arc a. Yke equals 1 if the vehicle k collects the demand on edge e, 0 otherwise. Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Standard problem Goal Collecting => Passing through Maximum capacity Coverage constraints Kirchhoff’s law et Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Standard problem (2) Let δ+(v) be the outgoing arcs of node v, and δ-(v) the incoming arcs Subtour constraints 1 Subtour constraints 2 4 4 2 2 2 3 3 1 1 1 1 2 1 Vehicle routing in Python

III Second approach: master-slave formulation Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Master problem Parameters Let F be the set of feasible and optimal tours. A tour f is said optimal if there is not any tour which collects the same edges as f with a strictly inferior cost. For every f in F, let Cf be the cost of the tour f. For every e in E and f in F, let χe(f) be the function equal to 1 if e is collected by f, 0 otherwise. Variables xf equals 1 if the tour f is used, 0 otherwise. Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Master problem (2) Goal Coverage constraints Maximum number of vehicles Integrity constraints Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Continuous master problem Goal Coverage Maximum number of vehicles Non-negative constraints Vehicle routing in Python

Dual problem ρe δ xf Dual variables Coverage Maximum number of I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Dual problem Dual variables ρe Coverage Maximum number of vehicles δ Dual constraints The idea: rather than working with F, let’s work with a smaller set And then one has to ensure that all of the |F | dual constraints hold. In order to do so, a slave programme will be used. This one has to find a tour which violates (15). xf Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Slave programme It has to find a tour which violates (15) The associated linear programme is s.t. the tour is valid (same constraints as in the standard problem) Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Global view Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Branch and bound Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Branch and bound principle Upper bound : +inf Lower bound : -inf Upper bound : +inf Lower bound : 432,3 432,3 X12=1 433,7 X7=1 Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Branch and bound principle Upper bound : +inf Lower bound : 432,3 Upper bound : 436 Lower bound : 432,3 432,3 X12=1 433,7 X7=1 X7=0 436 Unfeasible Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Branch and bound principle Upper bound : 436 Lower bound : 432,3 Upper bound : 436 Lower bound : 432,8 432,3 X12=1 X12=0 433,7 432,8 X7=1 X7=0 X8=1 436 Unfeasible 437,1 Vehicle routing in Python

Branch and bound principle I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Branch and bound principle Upper bound : 436 Lower bound : 432,8 Upper bound : 436 Lower bound : 435,2 432,3 X12=1 X12=0 433,7 432,8 X7=1 X7=0 X8=1 X8=0 436 Unfeasible 437,1 435,2 Lower bound = Upper bound => End of the algorithm Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Branch and bound principle How to choose the tour to branch on ? Chosen method: Maximum feasibility The algorithm branches on the tour f whose corresponding xf is the highest possible In which order will the algorithm explore the nodes ? Chosen method: Deep exploration, and always branching the tour on 1 before branching on 0. The objective is to obtain a feasible solution quickly. Vehicle routing in Python

Vehicle routing in Python IV Valid inequalities Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Valid inequalities Let S be the set of odd group nodes is odd. Required edge Non-required edge Then there is a tour collecting an odd number of edges which have one node in S and the other outside S. In order to formalize this: Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Continuous master problem Goal Coverage Maximum number of vehicles Non-negative constraints Valid inequalities Vehicle routing in Python

Dual problem ρe δ γS xf Dual variables Coverage Maximum number of I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Dual problem Dual variables ρe Coverage Maximum number of Vehicles Valid inequalities δ γS Dual constraints The idea: rather than working with F, let’s work with a smaller set And then one has to ensure that all of the |F | dual constraints hold. In order to do so, a slave programme will be used. This one has to find a tour which violates (16). xf Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Slave programme It has to find a tour which violates The associated linear programme is 7 s.t. the tour is valid Vehicle routing in Python

V Computational results and conclusion Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Where to find benchmarks ? A website provides examples which are used a lot in the literature http://logistik.bwl.uni-mainz.de/benchmarks.php -A lot of researchers use these benchmarks -For most of them, the optimal solution has been found -But there are still unsolved problems ! Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Comparative results Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Comparative results The standard problem pros… and cons -CPLEX handles the integrity constraints efficiently -The lower bound is often of poor quality -Often very quick on small problems -Unable to solve large problems The master-slave formulation pros… and cons -The quality of the lower bound at the root of the branch and bound is often excellent -Able to find quickly a feasible solution -Able to solve larger problems -If the lower bound is not optimal, the convergence time can be unreasonably high -Much more complex to implement Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Standard problem results Vehicles x Arcs = 400 Vehicles Vehicle routing in Python Less than 5min More than 4h Less than 30min Less than 4h

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Graphic results Size 322 7 vehicles 46 arcs Vehicle routing in Python

Graphic results (2) Size 528 4 vehicles 132 arcs I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Graphic results (2) Size 528 4 vehicles 132 arcs

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion What I would want to do Size 3080 11 vehicles 280 arcs Vehicle routing in Python

Vehicle routing in Python I Problem presentation II First approach: the standard formulation III Second approach: master-slave formulation IV Valid inequalities V Computational results and conclusion Conclusion Both approaches are complementary A lot of improvements are yet possible -Adding other valid inequalities -Creating a mixed approach -Changing the branching methods At the end of the internship, the algorithm solved 400-size problems in less than 5 minutes This code is now included in an Orange project Vehicle routing in Python

Vehicle routing in Python Thank you for your attention ! Vehicle routing in Python