Download presentation
Presentation is loading. Please wait.
1
Vehicle routing in Python
December 6th 2017 Guillaume Crognier Ecole polytechnique, Paris
2
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
3
I Problem presentation
Vehicle routing in Python
4
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
5
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
6
II First approach: the standard formulation
Vehicle routing in Python
7
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
8
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
9
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 2 1 1 1 1 2 1 Vehicle routing in Python
10
III Second approach: master-slave formulation
Vehicle routing in Python
11
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
12
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
13
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
14
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
15
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
16
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
17
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
18
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
19
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
20
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
21
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
22
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
23
Vehicle routing in Python
IV Valid inequalities Vehicle routing in Python
24
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
25
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
26
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
27
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
28
V Computational results and conclusion
Vehicle routing in Python
29
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 -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
30
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
31
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
32
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
33
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
34
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
35
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
36
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
37
Vehicle routing in Python
Thank you for your attention ! Vehicle routing in Python
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.