Capacitated Vehicle Routing Problem with Traffic Jams

Problem statement – CVRP with Traffic Jams

On this page, you can find a condensed report on a study of Dynamic Capacitated Vehicle Routing with Traffic Jams (CVRPwTJ). This variant is our proposal of adding dynamic elements into the classical and well-studied CVRP, which in turn is an extension of VRP. All of the problems fall into combinatorial optimization and integer programming.

The relationship between the problems is as follows:

VRP – there is an undirected and complete graph of N locations (N-1 customers and the depot) and a fleet of m vehicles. Each edge connecting two locations has a traverse cost (Euclidean distance). The goal is to visit each customer exactly once by a vehicle while minimizing the total cost of the routes. Each route must originate and terminate in the depot.

CVRP – in addition to VRP, each customer has a certain demand of goods. The vehicles have identical capacities, that denote how many of the goods they can serve. Because each customer must be served exactly once, the maximum amount of demand cannot exceed the vehicles’ capacity.

CVRPwTJ – in addition to CVRP, the cost of traversing an edge in the locations graph is affected by traffic conditions. The conditions may change during the realization of the problem according to certain probability distributions, which makes it dynamic and stochastic in contrast to VRP and CVRP.

The evaluation procedure

Unlike in static optimization problems such as VRP and DCVRP, the final result depends on the traffic situation, which is unknown until it actually happens. Therefore, the solution is constructed dynamically during a simulation. We will refer to this simulation as “the main simulation” to distinguish it from o Monte Carlo simulations aimed at testing various actions/modifications without applying them to the actual solution yet. Apart from the impact (constructing the actual solution vs. testing possible scenarios), both types of simulations have the same structure.

The simulations are divided into discrete time steps.

In each step:

  • The current traffic situation is calculated.
  • At least one vehicle must be assigned a non-empty visiting schedule. We will call such vehicles active. Here, the MCTS/UCT approach is employed to calculate this schedule.
  • Active vehicles are moved from the current locations to the next ones according the their schedules. This is performed as an atomic operation regardless of how long the distances are.
  • The total cost of the simulation is incremented by the sum of edges traversed by the vehicles.
  • Unless the problem is solved (i.e. all vehicles returned to the depot and all clients are served), the simulation proceeds to the next step.

How a traffic situation is calculated:

We introduce three variables controlling the traffic simulation:

For each edge, P stands for the probability that a TJ will be imposed on it in the current time step. If TJ is imposed on the edge a, its regular cost c(a) is multiplied by a random intensity I(a) for the timespan of L(a) steps.

We have tested the following values of P: 0.02, 0.05 and 0.15. I(a) and L(a) were selected from uniform random distributions U_INT[10,20] and U_INT[2,5], respectively.

Figure: How the traffic conditions in the simulation are applied.

We assume that although benchmark problems include exact realizations of TJ computed by certain probability distributions, any method used for solving the CVRPwTJ problem has access only those distributions. The actual realizations of the traffic jams are visible to the method only after they happen. Therefore, a method may use the fact that the global probability P = 0.05 (for example) and what range the intensities and lengths can be in, but not when or where the TJ will be imposed.

The main idea of the proposed approach

In short, our idea of solving the problem with use of MCTS/UCT is based on the following steps:

  • We decided to start from the initial solution – computed for the static version of the problem – rather than using MCTS to solve the problem from scratch, because the latter approach was completely infeasible due to the combinatorial complexity of the problem. The initial solution of choice is the Clark and Wrights savings algorithm.
  • For each route present in the initial solution, a UCT tree is created. At the beginning, the trees are in simply paths with the first and the last elements being a depot. The consecutive elements on each path denote the clients visited by respective trucks in subsequent time steps. For example, the fourth elements in all paths represent the set of clients visited in the third step of the solution.
  • A top-down overview of the method can be found here.
  • The internal UCT simulations are performed simultaneously in all UCT trees. At each time step, and action is chosen in each tree. The next compound step (movement of all k trucks) is a result of a combined knowledge obtained from all trees.
  • An action in a tree represents moving the truck according to the schedule or changing the schedule (in order to test a different one). In order to limit the state-space search, we defined various types of sensible actions which can be used by the MCTS/UCT algorithm.
  • All proposed actions are based on the following underlying rationale: if the currently selected candidate edge is not jammed then traverse it, otherwise try to enhance the
    planned route (by avoiding the traffic jam) by means of local changes in the planned orders of visited clients. We have defined actions, which modify on 0, 1 or 2 existing routes, respectively.
  • A simulation ends when there are no more active trees (all trucks have completed their routes) or the step counter reaches a pre-defined threshold value of MAX STEPS (the so-called Early Termination), whichever comes first. We set MAX STEPS to be equal to the maximum length of a traffic jam
  • Once the simulation is completed, the sum of traversed costs from all k trees is back-propagated from the last visited nodes in each tree to the root nodes. When the Early Termination condition is applied, the sum of static costs (i.e. without TJ consideration) computed for the remaining fragments of the routes is added to the score

Benchmarks and Results

We have used some of the known benchmark instances available for CVRP and injected the information about the traffic jams. The file format used for this study is specified in this text document. You can download the base versions, i.e. without the traffic jams, here [9 KB]. Next you can use the tool provided below to insert traffic jams into the downloaded files.

Convertion-generation tool [Download] [17 KB]

Using this tool you can load a file, which is either a third-party CVRP file (three formats are supported) or the CVRP file in our format either with or without the traffic jams inside. When working with the former case, clicking the Convert button will generate the file compliant with our CVRPwTJ problem. Such a generated file may be loaded again using the Select file and then injected with the traffic jams using the Generate button. If any traffic data is already contained it will be overwritten.

The injection of the traffic jams is performed based on the probability distributions discussed earlier. For each out of 10 tested benchmarks, we used the same intensity and length distributions and three options for probability values: 0.02, 0.05, 0.15 for light, medium and heavy traffic, respectively. That counts as 30 distinct benchmark instances. For each instance, we generated 50 test cases with various probability realizations, what gives 1500 tests in total.

Below, we present the used benchmark with sample graphical results of the solutions:

Benchmark Name

Visual representation

P-n19-k2

P-n45-k5

E-n51-k5

A-n54-k7

A-n69-k9

E-n76-k5

A-n80-k10

P-n101-k4

C-n150D-k5

Tai-n150b-k5

TABLE 1

Below, we present the summary of the results for 50 runs of each benchmark. P is the probability of a jam to occur as discussed earlier. The four right-most columns contain the solution costs (the lower the better) for the respective methods. Static No-traffic is the cost, which would be obtained without any traffic jams, so this expresses the hypothetical ideal cost to compare with. We can analyze how close or far to this reference cost other methods come. The Static simulated column contains costs of the static solution applying to the dynamic problem, i.e. without any actions to avoid/mitigate traffic jams. The last two columns denote our proposed MCTS/UCT approach using the two best exploration constants (parameter C in the UCT formula) as found during empirical experiments.

Benchmark

P

Static

No-traffic

Static simulated

UCT

C = 0.7

UCT

C = 1.8

P19

2

237,9

388,9

246,2

244,9

P19

5

237,9

612,0

269,6

269,3

P19

15

237,9

1278,0

338,2

340,9

P45

2

573,0

1007,7

604,0

601,0

P45

5

573,0

1759,6

648,6

646,8

P45

15

573,0

3299,5

787,7

781,8

E51

2

584,6

989,2

615,4

615,6

E51

5

584,6

1571,6

665,7

667,1

E51

15

584,6

3509,7

847,1

845,4

A54

2

1201,2

1939,2

1258,3

1254,9

A54

5

1201,2

3072,4

1355,0

1347,5

A54

15

1201,2

6275,0

1634,5

1647,6

A69

2

1210,8

2005,7

1263,5

1265,2

A69

5

1210,8

3235,4

1385,8

1377,3

A69

15

1210,8

6631,7

1735,5

1731,8

E76

2

737,7

1318,7

779,3

779,0

E76

5

737,7

2130,0

834,8

834,7

E76

15

737,7

4536,7

1083,5

1085,6

A80

2

1860,9

2774,1

1938,6

1929,3

A80

5

1860,9

4100,6

2070,0

2063,8

A80

15

1860,9

9066,5

2578,6

2588,4

P101

2

765,4

1436,5

813,7

815,0

P101

5

765,4

2552,0

893,3

891,6

P101

15

765,4

5419,6

1194,7

1204,0

C150

2

1140,4

1883,0

1203,1

1202,0

C150

5

1140,4

3099,1

1318,8

1318,7

C150

15

1140,4

6766,7

1730,2

1810,2

Tai150b

2

2890,4

4994,7

3016,1

3021,5

Tai150b

5

2890,4

8751,9

3259,9

3270,1

Tai150b

15

2890,4

18104,0

4388,0

4442,5

 TABLE 2

Below, we present the standard deviations for the results from TABLE 1. Please refer to TABLE 1 for the description of the methods.

Benchmark

P

Static simulated

UCT

C = 0.7

UCT

C = 1.8

P19

2

214,9

12,5

10,9

P19

5

213,3

24,0

23,1

P19

15

358,9

60,7

61,3

P45

2

326,2

30,0

20,7

P45

5

411,9

35,7

35,7

P45

15

733,3

52,6

54,3

E51-K5

2

240,6

22,4

22,2

E51-K5

5

386,3

40,5

40,5

E51-K5

15

688,9

70,4

70,2

A54

2

542,7

45,8

41,3

A54

5

887,7

77,0

77,9

A54

15

1441,9

146,6

139,2

A69

2

531,8

42,4

43,3

A69

5

644,1

106,6

103,0

A69

15

1170,9

163,2

173,1

E76-K7

2

295,5

33,5

32,6

E76-K7

5

460,4

38,7

39,8

E76-K7

15

838,0

73,1

68,9

A80

2

625,2

65,0

58,4

A80

5

830,1

145,0

121,9

A80

15

1437,4

132,5

141,7

P101

2

262,6

24,2

25,4

P101

5

547,3

39,7

38,2

P101

15

801,5

79,6

81,9

C150

2

368,8

37,1

39,1

C150

5

587,5

56,4

53,5

C150

15

840,1

89,0

110,6

Tai150b

2

1165,5

91,1

100,7

Tai150b

5

1936,7

155,1

176,3

Tai150b

15

2581,2

318,7

285,5

Executable application

Click here to download [23 KB] an executable version of the program solving the CVRPwTJ problem with the MCTS/UCT approach. After selecting a file in our format (discussed earlier on this page), you can click “Load Problem” to do the initialization. Two windows will pop up, in which the dynamic construction of the solution and the realization of the static solution will be shown. It is a good time to arrange the windows to your liking,. They can be conveniently used to compare the obtained routes and the traverse costs. When you are ready to start the dynamic part, please click the “Solve Problem” button.