the vehicle routing problem - transp-or · the vehicle routing problem (vrp) is a combinatorial...

26
The Vehicle Routing Problem Decision-aid Methodologies in Transportation: Computer Lab 11 Iliya Markov Transport and Mobility Laboratory School of Architecture, Civil and Environmental Engineering ´ Ecole Polytechnique F´ ed´ erale de Lausanne May 5, 2015 Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 1 / 21

Upload: others

Post on 19-Oct-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

  • The Vehicle Routing ProblemDecision-aid Methodologies in Transportation: Computer Lab 11

    Iliya Markov

    Transport and Mobility LaboratorySchool of Architecture, Civil and Environmental Engineering

    École Polytechnique Fédérale de Lausanne

    May 5, 2015

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 1 / 21

  • Overview

    1 Introduction

    2 MILP Formulation

    3 Extensions

    4 Solution approaches

    5 Exercise

    6 References

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 2 / 21

  • Introduction

    Overview

    1 Introduction

    2 MILP Formulation

    3 Extensions

    4 Solution approaches

    5 Exercise

    6 References

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 3 / 21

  • Introduction

    Introduction

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 4 / 21

  • Introduction

    Introduction

    depot c11

    c10

    c9

    c8c7

    c6

    c5

    c4

    c3

    c2

    c1

    The Vehicle Routing Problem (VRP) is acombinatorial optimization and integerprogramming problem that seeks to findthe most efficient utilization and routingof a vehicle fleet to service a set ofcustomers subject to constraints.

    It was introduced by Dantzig and Ramser(1959), and is one of the most practicallyrelevant and widely studied problems inOperations Research.

    It has numerous applications in thedistribution and collection of goods andthe transportation of people.

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 5 / 21

  • MILP Formulation

    Overview

    1 Introduction

    2 MILP Formulation

    3 Extensions

    4 Solution approaches

    5 Exercise

    6 References

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 6 / 21

  • MILP Formulation

    Formulating the capacitated VRP (CVRP)

    We present the three-index directed vehicle-flow formulation of theVRP, modified from Golden, Magnanti and Nguyen (1977). For it, weneed to define the following:Sets:

    K is a set of identical vehiclesN is a set of all nodes, where the depot is represented by two nodes, oand d , for the start and end point of each tour

    Parameters:Q is the vehicle capacityqi is the demand at node icij is the travel cost from node i to j

    Variables:xijk = 1 iff vehicle k moves from node i to j ; 0 otherwiseyik = 1 iff vehicle k visits node i ; 0 otherwiseuik is the cumulated demand serviced by vehicle k when arriving atnode i

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 7 / 21

  • MILP Formulation

    Formulating the capacitated VRP (CVRP)

    Objective: minimize total travel cost

    minimize∑k∈K

    ∑i∈N

    ∑j∈N

    cijxijk

    A customer is visited by exactly one vehicle

    s.t.∑k∈K

    yik = 1, ∀i ∈ N \ {o, d}

    Path-flow

    s.t.∑

    j∈N\{i}

    xijk −∑

    j∈N\{i}

    xjik = 0, ∀i ∈ N \ {o, d}, k ∈ K

    s.t.∑

    j∈N\{o}

    xojk −∑

    j∈N\{o}

    xjok = 1, ∀k ∈ K

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 8 / 21

  • MILP Formulation

    Formulating the capacitated VRP (CVRP)

    Objective: minimize total travel cost

    minimize∑k∈K

    ∑i∈N

    ∑j∈N

    cijxijk

    A customer is visited by exactly one vehicle

    s.t.∑k∈K

    yik = 1, ∀i ∈ N \ {o, d}

    Path-flow

    s.t.∑

    j∈N\{i}

    xijk −∑

    j∈N\{i}

    xjik = 0, ∀i ∈ N \ {o, d}, k ∈ K

    s.t.∑

    j∈N\{o}

    xojk −∑

    j∈N\{o}

    xjok = 1, ∀k ∈ K

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 8 / 21

  • MILP Formulation

    Formulating the capacitated VRP (CVRP)

    Objective: minimize total travel cost

    minimize∑k∈K

    ∑i∈N

    ∑j∈N

    cijxijk

    A customer is visited by exactly one vehicle

    s.t.∑k∈K

    yik = 1, ∀i ∈ N \ {o, d}

    Path-flow

    s.t.∑

    j∈N\{i}

    xijk −∑

    j∈N\{i}

    xjik = 0, ∀i ∈ N \ {o, d}, k ∈ K

    s.t.∑

    j∈N\{o}

    xojk −∑

    j∈N\{o}

    xjok = 1, ∀k ∈ K

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 8 / 21

  • MILP Formulation

    Formulating the capacitated VRP (CVRP)

    Coupling

    s.t. yik =∑

    j∈N\{i}

    xijk , ∀i ∈ N \ {d}, k ∈ K

    s.t. ydk =∑

    i∈N\{d}

    xidk , ∀k ∈ K

    Domain

    s.t. xijk ∈ {0, 1}, ∀i , j ∈ N, k ∈ Ks.t. yik ∈ {0, 1}, ∀i ∈ N, k ∈ K

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 9 / 21

  • MILP Formulation

    Formulating the capacitated VRP (CVRP)

    Coupling

    s.t. yik =∑

    j∈N\{i}

    xijk , ∀i ∈ N \ {d}, k ∈ K

    s.t. ydk =∑

    i∈N\{d}

    xidk , ∀k ∈ K

    Domain

    s.t. xijk ∈ {0, 1}, ∀i , j ∈ N, k ∈ Ks.t. yik ∈ {0, 1}, ∀i ∈ N, k ∈ K

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 9 / 21

  • MILP Formulation

    Let’s stop and think

    depot c11

    c10

    c9

    c8c7

    c6

    c5

    c4

    c3

    c2

    c1

    Look at the solution depicted here.

    The cycles c6 −→ c7 −→ c8 −→ c6 andc3 −→ c4 −→ c3 are referred to as subtours.Subtours are part of the vehicles’ tours that aredisconnected from the depot.

    Apparently a solution like this should not exist.

    However, is it a feasible solution for the modeldefined above?

    Let’s check constraint by constraint.

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 10 / 21

  • MILP Formulation

    Let’s stop and think

    depot c11

    c10

    c9

    c8c7

    c6

    c5

    c4

    c3

    c2

    c1

    Look at the solution depicted here.

    The cycles c6 −→ c7 −→ c8 −→ c6 andc3 −→ c4 −→ c3 are referred to as subtours.Subtours are part of the vehicles’ tours that aredisconnected from the depot.

    Apparently a solution like this should not exist.

    However, is it a feasible solution for the modeldefined above?

    Let’s check constraint by constraint.

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 10 / 21

  • MILP Formulation

    Let’s stop and think

    depot c11

    c10

    c9

    c8c7

    c6

    c5

    c4

    c3

    c2

    c1

    min∑k∈K

    ∑i∈N

    ∑j∈N

    cijxijk

    s.t.∑k∈K

    yik = 1, ∀i ∈ N \ {o, d}∑j∈N\{i}

    xijk −∑

    j∈N\{i}

    xjik = 0, ∀i ∈ N \ {o, d}, k ∈ K

    ∑j∈N\{o}

    xojk −∑

    j∈N\{o}

    xjok = 1, ∀k ∈ K

    yik =∑

    j∈N\{i}

    xijk , ∀i ∈ N \ {d}, k ∈ K

    ydk =∑

    i∈N\{d}

    xidk , ∀k ∈ K

    xijk ∈ {0, 1}, ∀i , j ∈ N, k ∈ Kyik ∈ {0, 1}, ∀i ∈ N, k ∈ K

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 11 / 21

  • MILP Formulation

    Subtour elimination constraints

    The constraints we are missing are calledsubtour elimination constraints (SEC).

    Their role is to eliminate the possibility of subtours and to enforce thevehicle capacity constraints.

    SEC can be formulated in different ways, with an impact on thenumber of SEC and the integrality gap.

    In the labs, we will focus on the so-called MTZ-formulationintroduced by Miller, Tucker and Zemlin (1960) for the TSP.

    The first set of constraints links the node demand qi with thecumulated demand uik in a big-M fashion:s.t. uik + qj ≤ ujk + Q(1− xijk), ∀i , j ∈ N, k ∈ KThe second set of constraints enforces the vehicle capacity andprovides a lower bound for uik :s.t. qi ≤ uik ≤ Q, ∀i ∈ N, k ∈ K

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 12 / 21

  • MILP Formulation

    Subtour elimination constraints

    The constraints we are missing are calledsubtour elimination constraints (SEC).

    Their role is to eliminate the possibility of subtours and to enforce thevehicle capacity constraints.

    SEC can be formulated in different ways, with an impact on thenumber of SEC and the integrality gap.

    In the labs, we will focus on the so-called MTZ-formulationintroduced by Miller, Tucker and Zemlin (1960) for the TSP.

    The first set of constraints links the node demand qi with thecumulated demand uik in a big-M fashion:s.t. uik + qj ≤ ujk + Q(1− xijk), ∀i , j ∈ N, k ∈ KThe second set of constraints enforces the vehicle capacity andprovides a lower bound for uik :s.t. qi ≤ uik ≤ Q, ∀i ∈ N, k ∈ K

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 12 / 21

  • MILP Formulation

    Complete model

    min∑k∈K

    ∑i∈N

    ∑j∈N

    cijxijk

    s.t.∑k∈K

    yik = 1, ∀i ∈ N \ {o, d}∑j∈N\{i}

    xijk −∑

    j∈N\{i}xjik = 0, ∀i ∈ N \ {o, d}, k ∈ K

    ∑j∈N\{o}

    xojk −∑

    j∈N\{o}xjok = 1, ∀k ∈ K

    yik =∑

    j∈N\{i}xijk , ∀i ∈ N \ {d}, k ∈ K

    ydk =∑

    i∈N\{d}xidk , ∀k ∈ K

    uik + qj ≤ ujk + Q(1− xijk ), ∀i , j ∈ N, k ∈ Kqi ≤ uik ≤ Q, ∀i ∈ N, k ∈ Kxijk ∈ {0, 1}, ∀i , j ∈ N, k ∈ Kyik ∈ {0, 1}, ∀i ∈ N, k ∈ K

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 13 / 21

  • Extensions

    Overview

    1 Introduction

    2 MILP Formulation

    3 Extensions

    4 Solution approaches

    5 Exercise

    6 References

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 14 / 21

  • Extensions

    Versions of the VRP

    Many versions of the VRP have been considered in the literatureCapacitated VRPVRP with time windowsPickup and delivery VRPVRP with backhaulsVRP with split deliveriesPeriodic VRPHeterogeneous fleet VRPDial-a-ride problem (DARP)Stochastic VRPDynamic VRPInventory routing problem (IRP)etc...

    The interested student is referred to Toth and Vigo (2002) or Tothand Vigo (2014). The full text of the former can be accessed onlinefrom the EPFL library website if you are on campus or connectedthrough VPN.

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 15 / 21

  • Solution approaches

    Overview

    1 Introduction

    2 MILP Formulation

    3 Extensions

    4 Solution approaches

    5 Exercise

    6 References

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 16 / 21

  • Solution approaches

    Solution approaches

    The VRP, and by generalization, all of its extensions are NP-hard.

    Solution approaches can broadly be classified into three categories:

    Exact approaches:

    Branch-and-boundBranch-and-cutBranch-and-price-and-cut

    Heuristic approaches:

    Construction heuristicsImprovement heuristicsMetaheuristics–neighborhood based, population based

    Hybridizations

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 17 / 21

  • Exercise

    Overview

    1 Introduction

    2 MILP Formulation

    3 Extensions

    4 Solution approaches

    5 Exercise

    6 References

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 18 / 21

  • Exercise

    Exercise

    You are asked to develop a CPLEX OPL model for solving a VRPproblem.

    The problem is the same as what you have seen here, but it has morefeatures and more constraints, which you will have to develop.

    The problem is described in exercise-session10.pdf

    You are provided with the model and data file to start from.

    If your model is taking too long to optimize, you can limit thecomputation time by specifying:

    execute

    {

    cplex.tilim = 600;

    }

    in the beginning of your model file.

    This will force CPLEX to stop after 10 minutes and report the bestfeasible solution found so far.

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 19 / 21

  • References

    Overview

    1 Introduction

    2 MILP Formulation

    3 Extensions

    4 Solution approaches

    5 Exercise

    6 References

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 20 / 21

  • References

    Dantzig, G. and Ramser, R. (1959). The truckdispatching problem. Management Science,6:80–91.

    Golden, B. L., Magnanti, T. L. and Nguyen, H. Q.(1977). Implementing vehicle routing algorithms.Networks, 7(2):133–148.

    Miller, D.L.,Tucker, A.W., and Zemlin, R.A. (1960).Integer programming formulations of travelingsalesman problems. Journal of the ACM, 326–329.

    Toth, P and Vigo, D. (2002). The Vehicle RoutingProblem. SIAM.

    Toth, P and Vigo, D. (2014). Vehicle Routing:Problems, Methods, and Applications, SecondEdition. SIAM.

    Markov (TRANSP-OR) Computer Lab 11 May 5, 2015 21 / 21

    IntroductionMILP FormulationExtensionsSolution approachesExerciseReferences