Solving Vehicle Scheduling Problem via Column Generation

9
Solving Vehicle Scheduling Problem via Column Generation Danial Esmaeili Aliabadi a a Sabanci university, Faculty of engineering and natural science, Istanbul, Turkey. Abstract Column generation is an elegant technique in computational optimization for dealing with large problems with huge number of variables. It can cope with large problems by constructing column of original problem little by little wisely. In this scientific report, Vehicle Scheduling Problem (VSP) is solved by column generation. In addition to solving several case study, some programming tricks will be discussed for the sake of acceleration. Keywords: Vehicle Scheduling Problem, Column Generation, Programming trick, Pricing subproblem Table of contents: 1 Introduction 2 2 Vehicle Scheduling Problem 2 3 Column Generation 3 4 Case Studies 4 4.1 Network with 20 entities .................................. 4 4.2 Network with 50 entities .................................. 4 4.3 Network with 70 entities .................................. 5 4.4 Network with 100 entities ................................. 5 4.5 Network with 200 entities ................................. 6 5 Programming Issues 7 5.1 Choosing Software Development Kit (SDK) ....................... 7 5.2 Post Optimality ....................................... 8 5.3 Network issues ....................................... 8 6 Conclusion 9 Email address: [email protected] (Danial Esmaeili Aliabadi)

description

Column generation is an elegant technique in computational optimization for dealing with largeproblems with huge number of variables. It can cope with large problems by constructing column oforiginal problem little by little wisely. In this scientic report, Vehicle Scheduling Problem (VSP)is solved by column generation. In addition to solving several case study, some programming trickswill be discussed for the sake of acceleration.

Transcript of Solving Vehicle Scheduling Problem via Column Generation

Page 1: Solving Vehicle Scheduling Problem via Column Generation

Solving Vehicle Scheduling Problem via Column Generation

Danial Esmaeili Aliabadia

aSabanci university, Faculty of engineering and natural science, Istanbul, Turkey.

Abstract

Column generation is an elegant technique in computational optimization for dealing with large

problems with huge number of variables. It can cope with large problems by constructing column of

original problem little by little wisely. In this scientific report, Vehicle Scheduling Problem (VSP)

is solved by column generation. In addition to solving several case study, some programming tricks

will be discussed for the sake of acceleration.

Keywords: Vehicle Scheduling Problem, Column Generation, Programming trick, Pricing

subproblem

Table of contents:

1 Introduction 2

2 Vehicle Scheduling Problem 2

3 Column Generation 3

4 Case Studies 4

4.1 Network with 20 entities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

4.2 Network with 50 entities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

4.3 Network with 70 entities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

4.4 Network with 100 entities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

4.5 Network with 200 entities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

5 Programming Issues 7

5.1 Choosing Software Development Kit (SDK) . . . . . . . . . . . . . . . . . . . . . . . 7

5.2 Post Optimality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

5.3 Network issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

6 Conclusion 9

Email address: [email protected] (Danial Esmaeili Aliabadi)

Page 2: Solving Vehicle Scheduling Problem via Column Generation

1. Introduction

In today’s industries, we can find Vehicle Scheduling Problem (VSP) everywhere ranging from

distribution of products to fleet management. The VSP can described as follow: given set of vehicle

(V), customer (C) and a depot, find set of routes in order to fulfil all customer’s needs, starting

from and ending to depot. At a glance to the structure of problem, it shows its intractability when

we need to cover huge number of customer with different demands. In our case, we have number

of cities which needs to covered at least by one flight. when the number of cities ascending, the

possible combination of routes growing exponentially, therefore, finding optimal solution for this

type of problem is not primitive.

Column generation is a powerful method for solving Set Partitioning Problem introduced by Dantzig

& Wolfe (1960). It is also applied in many other problems with decomposable structure (Lubbecke &

Desrosiers (2005)). Now a day, it becomes well-known technique to solve Crew Scheduling Problems

(Desrosiers et al. (1995)). In this scientific report, Column Generation is exploited to solve VSP

within a reasonable computation time.

The rest of report is organized as follow. In Section 2, original VSP and corresponding Notations are

discussed. In Section 3, creating Restricted Master Problem (RMP) and solving Pricing Subproblem

are explained carefully then the results of VSP’s case studies via column generation are introduced in

Section 4 and some technical issues about optimizing computer code will follow in the next section.

Finally, Section 6 concludes.

2. Vehicle Scheduling Problem

As mentioned before, VSP can modeled as set covering problem. if we consider P as set of all possible

routes and F as set of all trips (flights) then we can model VSP as follows.

minimize∑p∈P

cpyp (1)

subject to∑p∈P

aipyp ≥ 1 i ∈ F (2)

yp ∈ {0, 1} p ∈ P (3)

where cp is cost of trip in route p and yp is equal to 1 if route p is selected to cover a trip and zero

otherwise. aip is a binary parameter which determines whether route p covers trip i (1) or not (0).

Also, dual variable of each constraint (2) is called ui. In Eq.(1), the objective function of this model

is to minimize total cost of all routes when all trips are covered by those set of routes. In constraint

(2), all trips should covered at least by one route which is rational. However, this model is a Binary

Programming Model (BP), by applying some simplification, it is convertible to Linear Programming

Model (LP). Chief advantages of this conversion listed as follows.

2

Page 3: Solving Vehicle Scheduling Problem via Column Generation

1) Linear programming is globally solvable within a reasonable time.

2) It can find a good initial solution for Binary Programming to start with.

3) We found optimal solution of BP, when optimal solution of LP become all binary.

In order to convert BP model of Eq.(1)-(3) in to LP, we just need to omit Eq.(3).

It is clear that each route corresponds to one column and combination of all routes grow exponentially.

So, solving original problem with considering all possible routes is not a good idea. To tackle to

this problem, column generation method would be a wise choice. In next section, we are going to

investigate over all needed details of solving VSP by Column Generation.

3. Column Generation

Column Generation always starts with a non-optimal feasible restricted model. This special problem

which is called Restricted Mater Problem (RMP), should satisfy all technical and non-negative

constraints. In other words, it should have at least one feasible solution for original problem. In our

survey, creating such an initial solution is elementary. Suppose we have an individual route for each

trip (pi : {Depot→ i ∈ F →Depot }). Thus, in beginning, we obtain a feasible solution that is not

optimal.

After that, we need to generate pricing subproblem. Pricing subproblem should generate a route

(which is correspond to a column in RMP) with negative reduced cost for RMP. Then, generated

route affixed to the RMP and will solved again.

If we check dual problem of VSP, generated column is a constraint in the dual model and we are

searching for a route that has most negative reduced cost (cp = cp −∑

i∈F aipui). Explicitly, pricing

subproblem is nothing else except Shortest Path Problem and we are seeking for a route that has

negative reduced cost. ui, i ∈ F could be interpreted as added value to objective function by covering

trip i. All in all, if solution of shortest path problem has no route with negative reduced cost then

we can say that we found a set of routes that covers all trips and they are optimal solution for RMP

and original problem.

For solving Shortest Path Problem, Dijkstra (1959) algorithm is employed. For using Dijkstra

algorithm, reforming cost matrix is essential. To this end, we create a cost matrix by subtracting

added value of destination node (uj) from cost of each trip from i to j (i, j ∈ F ). To avoid infeasible

path, a big number (∞) is dedicated to infeasible arcs. So, we can formulate new cost (c′ij) as follows.

c′ij =

cij − uj if aij is 1

∞, o.w.(4)

3

Page 4: Solving Vehicle Scheduling Problem via Column Generation

To create a column from given route for RMP, we just need to set aip+1 = 1 where ith trip is included

in new route (p+1). Furthermore, a decision variable yp+1 correspond to generated column is needed.

By updating dual variables in each iteration, we will find new route by Dijkstra algorithm and by

inserting new route into RMP, we will find new values for dual variables. This loop terminates when

we can not find any route with negative reduced cost, then, optimal solution for RMP is optimal

for relaxed original problem. Algorithm of solving VSP with Column Generation is mentioned in

Algorithm.1.

Algorithm 1 The Proposed Algorithm for solving VSP with Column Generation.

1: Initialize RMP for the LP relaxation of VSP2: Solve RMP and obtain the dual values3: Solve the pricing subproblem (shortest path problem)4: Initialize RMP for the LP relaxation of VSP5: while negative reduced cost column is found do6: Add the column(s) to RMP7: Solve RMP and obtain the dual values8: Solve the pricing subproblem (shortest path problem)9: end while10: Use the columns in RMP and solve the original VSP

4. Case Studies

4.1. Network with 20 entities

Our first case study belongs to a problem with 20 trips. The cost matrix and feasible arcs between

trips are given. Fig.1 depicts network structure of this problem. This problem is solved in 156

millisecond and optimal solution is binary. Therefore, it is optimal for Eq.(1)-(3). Optimal solution

with objective value of 7170 is as follows. The rest of trips which is not addressed have one trip from

depot to that nodes and from that to depot.

P : {D → 12→ 11→ 18→ D | D → 8→ 10→ D | D → 6→ 16→ D | D → 1→ 13→ 17→ D}.

4.2. Network with 50 entities

Our second case study is consist of 50 trips and the cost matrix and feasibilities are given. Our

software could resolve this problem in 203 millisecond and founded optimum value for objective

function is 12900. For the sake of simplicity, we ignore logging routes with only one trip in between.

The best set of routes for this problem is as follows.

P : {D → 6 → 10 → 30 → 22 → 49 → D | D → 12 → 11 → 18 → 20 → 50 → D | D → 8 → 13 →17→ 34→ 49→ D | D → 2→ 9→ 35→ D | D → 33→ 42→ 46→ D | D → 3→ 9→ 36→ D |D → 31 → 26 → D | D → 31 → 38 → 49 → D | D → 1 → 9 → 21 → D | D → 41 → 24 → 47 →D | D → 37→ 23→ D | D → 19→ 40→ D}.

4

Page 5: Solving Vehicle Scheduling Problem via Column Generation

Figure 1: First case study’s network

4.3. Network with 70 entities

Our third case study is consist of 70 trips and the cost matrix and matrix of feasible routes between

trips are given. Our software solved problem in 375 millisecond and founded optimum value for

objective function is 19425. To avoid complexity, we ignore logging routes with only one trip in

between. The best set of routes for this problem is as follows.

P : {D → 16 → 13 → 24 → 26 → 66 → D | D → 7 → 27 → 46 → 65 → D | D → 2 → 11 → 47 →D | D → 3→ 17→ 43→ D | D → 25→ 31→ D | D → 29→ 36→ 62→ D | D → 45→ 51→ D |D → 14 → 32 → 63 → D | D → 49 → 34 → D | D → 6 → 15 → D | D → 22 → 54 → D | D →55 → 39 → D | D → 33 → 70 → D | D → 3 → 11 → 28 → D | D → 35 → 52 → 63 → D | D →1 → 11 → 48 → D | D → 40 → 30 → 65 → D | D → 10 → 12 → 41 → 50 → 65 → D | D → 21 →56→ 62→ D | D → 42→ 30→ 65→ D}.

4.4. Network with 100 entities

For bigger problem, we select a network with 100 trips. Our software before optimization took about

11(s) to solve this problem but after optimization which will be explained in programming issues it

just takes 1.653(s). The optimal value for objective function is 26985 monetary unit and set of best

routes for this problem is written as follows.

5

Page 6: Solving Vehicle Scheduling Problem via Column Generation

P : {D → 16→ 13→ 44→ 46→ 79→ D | D → 31→ 34→ 46→ 87→ D | D → 1→ 33→ 28→56 → 83 → D | D → 32 → 72 → 71 → 91 → D | D → 22 → 54 → D | D → 3 → 17 → 43 → D |D → 23 → 52 → 84 → D | D → 6 → 12 → 39 → 56 → 95 → 99 → D | D → 7 → 25 → D | D →3 → 37 → 49 → 51 → 78 → 96 → D | D → 32 → 72 → 67 → 94 → D | D → 2 → 11 → 48 → D |D → 55 → 59 → D | D → 14 → 60 → D | D → 45 → 68 → D | D → 19 → 69 → D | D → 53 →100→ D | D → 62→ 94→ D | D → 6→ 29→ D | D → 1→ 15→ D | D → 26→ 52→ 84→ D |D → 27→ 77→ 90→ D | D → 65→ 92→ D | D → 42→ 50→ 87→ D | D → 10→ 12→ 36→50 → 87 → D | D → 41 → 50 → 87 → D | D → 61 → 94 → D | D → 85 → 91 → D | D → 7 →40 → 76 → 89 → 91 → D | D → 38 → 50 → 64 → D | D → 31 → 74 → 63 → D | D → 7 → 47 →D | D → 1 → 24 → 46 → 88 → D | D → 35 → 30 → 46 → 88 → D | D → 70 → 73 → D | D →66→ 92→ D}.

4.5. Network with 200 entities

Our last and the largest problem is a Network with 200 trips and given set of routes. Fig. 2

delineates structure of network. Depot is located in center of diagram because of its centrality. Due

to complexity of this model, i had to optimize Dijkstra class and the result was rapturous. Un-

optimized software solve this problem in 5459.177(s) but optimized program solve this problem just

in 18.236 (s). Optimal objective function is 46330 monetary unit and set of best routes for this

problem is written as follows (Again we ignore routes with one trip in between).

P : {D → 16 → 13 → 74 → 63 → 86 → 108 → 107 → 140 → 150 → 187 → D | D → 31 → 34 →70 → 73 → 86 → 108 → 131 → 174 → 179 → 190 → D | D → 7 → 25 → 70 → 73 → D | D →66 → 92 → 105 → D | D → 14 → 60 → 86 → 108 → 107 → 148 → 170 → 173 → D | D → 126 →152 → 184 → D | D → 98 → 124 → D | D → 28 → 56 → 95 → 92 → 133 → 149 → 151 → 178 →194 → D | D → 127 → 160 → D | D → 145 → 168 → D | D → 118 → 169 → D | D → 119 →163 → D | D → 3 → 11 → 48 → D | D → 65 → 92 → 135 → 130 → D | D → 162 → 196 → D |D → 97→ 129→ D | D → 1→ 17→ 43→ D | D → 27→ 52→ 84→ 86→ 108→ 131→ 134→170 → 173 → D | D → 80 → 90 → 108 → 131 → 134 → 170 → 173 → D | D → 161 → 194 → D |D → 1 → 37 → 55 → 77 → 90 → 108 → D | D → 18 → 68 → D | D → 6 → 29 → D | D → 26 →59 → D | D → 81 → 90 → 108 → D | D → 141 → 150 → 188 → D | D → 42 → 50 → 88 → D |D → 142 → 150 → 164 → D | D → 53 → 100 → D | D → 106 → 112 → 136 → 150 → 187 → D |D → 38 → 50 → 87 → 86 → 109 → D | D → 93 → 113 → 144 → D | D → 22 → 56 → 83 → D |D → 45 → 51 → 75 → 90 → 108 → D | D → 165 → 192 → D | D → 2 → 15 → D | D → 10 →12 → 36 → 50 → 64 → D | D → 128 → 156 → 195 → 199 → D | D → 123 → 154 → D | D →114 → 159 → D | D → 101 → 115 → D | D → 110 → 112 → 139 → 152 → 184 → D | D → 19 →69 → D | D → 132 → 172 → 167 → 194 → D | D → 185 → 191 → D | D → 85 → 91 → 103 →137 → 143 → D | D → 122 → 156 → 183 → D | D → 6 → 12 → 39 → 54 → 86 → 108 → 138 →176 → 189 → 191 → D | D → 23 → 52 → 84 → D | D → 102 → 117 → 155 → 177 → D | D →31 → 44 → D | D → 82 → 90 → 108 → D | D → 171 → 191 → D | D → 153 → 200 → D | D →

6

Page 7: Solving Vehicle Scheduling Problem via Column Generation

Figure 2: The largest case study with 200 trips

49 → 51 → 78 → 92 → 105 → D | D → 1 → 24 → D | D → 7 → 40 → 76 → 89 → 99 → D | D →35→ 30→ 46→ 87→ D | D → 166→ 192→ D}.

5. Programming Issues

5.1. Choosing Software Development Kit (SDK)

Choosing suitable development kit is crucial part of making a software. We need to find a good trade

off between complexity and efficiency. Our alternatives for building VSP software were MATLAB,

MAPLE, C++, and C#. Each of these softwares has some advantages and disadvantages. MATLAB

and MAPLE are easy to use and rapid to create your projects (because of third parties’ written codes

in these softwares) but they give less capability to create interface, albeit, the most troublesome

disadvantage of these softwares are the way that run codes; they interpret your codes every time not

7

Page 8: Solving Vehicle Scheduling Problem via Column Generation

compile it. So, they are indeed interpreter and we can not use these softwares to show efficiency of

our algorithms because they do not use entire capability of system.

So, we have two other choices to select, C++ or C#. C++ is most powerful and efficient

compiler which is available in MAC, PC, and even smart phones and Tablets. But, complexity of

coding complicated algorithms with C++ makes our survey unusable for who wants to understand

algorithms. Whereas, C# is something in between. It gives so much capability to create projects

without exhaustive coding, also, it complies code into machine code (Intermediate Language). Thus,

we did our VSP Solver in C#.

5.2. Post Optimality

In order to exploit column generation completely, we need to populate our model by column. By

creating model column by column, we do not need to create model from scratch and clear it after

solve and this can save computational time more than 50%. For example, in the first case study,

if we create our model in each iteration from beginning, it takes about 288 millisecond but for the

other way, it takes only 186 millisecond. Indeed, we need an object from List class to save incoming

columns in each iteration. Lack of knowledge about number of columns makes us use dynamic arrays

to preserve columns. In the following, you can find the procedure who is responsible of creating our

model based on incoming columns.

1 p r i va t e s t a t i c void PopulateByColumn ( Cplex cplex , L i s t<INumVar> var , IRange [ ] rng ,

2 c l sRoute new route , i n t var iab leCounter )

3 {4 Column column = cplex . Column( cp lex . GetObject ive ( ) , new route . co s t ) ;

5 f o r ( i n t i = 0 ; i <= sample s i z e + 1 ; i++)

6 {7 i n t a ip = 0 ;

8 f o r ( i n t j = 0 ; j < new route . Route . Length ; j++)

9 {10 i f ( new route . Route [ j ] == i )

11 {12 a ip = 1 ;

13 break ;

14 }15 }16 column = column .And( cp lex . Column( rng [ i ] , a ip ) ) ;

17 }18 var .Add( cp lex .NumVar( column , 0 , double . MaxValue ,

19 ”P” + ( var iab leCounter ) . ToString ( ) ) ) ;

20 }

5.3. Network issues

One critical point in Network programming is keeping unchanged data as much as possible and

avoid recreating same structure again and again. For example in our problem, in each iteration, the

structure of network does not change; Cost of arcs are only dynamic parts of our network that depend

on dual value of each node. So, by keeping the structure of Network, we can save time and memory.

8

Page 9: Solving Vehicle Scheduling Problem via Column Generation

But sometimes in small problem keeping readability of code is more important and in that case we

can do it. Another important thing in about Dijkstra method is to avoid making unnecessary arcs.

Do not create arcs with infinity cost to force Dijkstra to choose another path, because it calculates

that arc too, and at the end, it will decide which root is optimize. Both creating arcs with infinity

cost and neglecting infeasible arcs will give us same results but second one is much more faster.

6. Conclusion

In this survey, we employed column generation with solving a shortest path problem as pricing

subproblem to solve vehicle scheduling problem. Several issues have been addressed in this survey.

First of all, implementation problem elaborated clearly and then four different case studies are solved

with implemented software. The solution of each problem with exact computing time are reported.

My focus in this investigation was on beginners who wants to start network programming with

different development environments like C#.

Another possible future work for this survey is finding a way to do same procedure in parallel. By

doing this, we are able to deal with larger networks by employing more than one central process unit

at the same time.

References

Dantzig, G., & Wolfe, P. (1960). Decomposition principle for linear programs. Operations research,

8 , 101–111.

Desrosiers, J., Dumas, Y., Solomon, M. M., & Soumis, F. (1995). Chapter 2 Time constrained routing

and scheduling. In C. M. M.O. Ball, T.L. Magnanti, & G. Nemhauser (Eds.), Network Routing

(pp. 35 – 139). Elsevier volume 8 of Handbooks in Operations Research and Management Science.

Dijkstra, E. (1959). A note on two problems in connexion with graphs. Numerische mathematik , 1 ,

269–271.

Lubbecke, M. E., & Desrosiers, J. (2005). Selected Topics in Column Generation. Operations research,

53 , 1007–1023.

9