Introduction into Vehicle Routing Problems and other basic mixed-integer problems Martin Branda Charles University in Prague Faculty of Mathematics and Physics Department of Probability and Mathematical Statistics Computational Aspects of Optimization Martin Branda (KPMS MFF UK) 04-04-2016 1 / 28
Martin Branda (KPMS MFF UK) 04-04-2016 2 / 28
Totally unimodular matrices Totally unimodular matrices Definition A matrix A is totally unimodular (TU) iff every square submatrix of A has determinant +1, -1, or 0. The linear program has an integral optimal solution for all integer r.h.s. b if and only if A is TU. Martin Branda (KPMS MFF UK) 04-04-2016 3 / 28
Totally unimodular matrices Totally unimodular matrices A set of sufficient conditions: a ij { 1, 0, 1} for all i, j Each column contains at most two nonzero coefficients, i.e. m i=1 a ij 2, There exists a partitioning M 1 M 2 = of the rows 1,..., m such that each column j containing two nonzero coefficients satisfies a ij = a ij. i M 1 i M 2 If A is TU, then A T and (A I ) are TU. Martin Branda (KPMS MFF UK) 04-04-2016 4 / 28
Totally unimodular matrices Minimum cost network flow problem G = (V, A) graph with vertices V and (oriented) arcs A h ij arc capacity c ij flow cost b i demand, ASS. i bi = 0 V + (i) = {k : (i, k) A} successors of i V (i) = {k : (k, i) A} predecessors of i min x ij s.t. (i,j) A k V + (i) c ij x ij x ik k V (i) 0 x ij h ij, (i, j) A. x ki = b i, i V, Martin Branda (KPMS MFF UK) 04-04-2016 5 / 28
Totally unimodular matrices Wolsey (1998), Ex. 3.1 (M 1 = {1,..., m}, M 2 = ) Martin Branda (KPMS MFF UK) 04-04-2016 6 / 28
Special cases Totally unimodular matrices The shortest path problem The transportation problem Martin Branda (KPMS MFF UK) 04-04-2016 7 / 28
Traveling salesman problem Traveling salesman problem n town and in one of them there is a traveling salesman. Traveling salesman must visit all towns and return back. For each pair of towns he/she knows the traveling costs and he is looking for the cheapest route. = Finding a Hamilton cycle in a graph with edge prices. Martin Branda (KPMS MFF UK) 04-04-2016 8 / 28
Assignment problem Traveling salesman problem min i=1 j=1 c ij x ij (1) x ij = 1, j = 1,..., n, (2) i=1 x ij = 1, i = 1,..., n, (3) j=1 x ij {0, 1}. (4) We minimize the traveling costs, we arrive to j from exactly one i, we leave i to exactly one j. Martin Branda (KPMS MFF UK) 04-04-2016 9 / 28
Traveling salesman problem Example 5 towns cycle and subcycles (subroute) Kafka (2013) Martin Branda (KPMS MFF UK) 04-04-2016 10 / 28
Traveling salesman problem Subroute elimination conditions I x ii = 0, c ii = x ij + x ji 1 x ij + x jk + x ki 2... i S j S x ij S 1, S {1,..., n}, 2 S n 1 Approximately 2 n inequalities, it is possible to reduce to S n/2. Martin Branda (KPMS MFF UK) 04-04-2016 11 / 28
Traveling salesman problem Subroute elimination conditions II u i u j + nx ij n 1, i, j = 2,..., n Eliminate subroutes: There is at least one route which does not go through vertex 1, denote this route by C and the number of edges by E(C). If we sum these inequalities over all edges {i, j}, which are in C, i.e. the corresponding variables x ij = 1, we obtain which is a contradiction. n E(C) (n 1) E(C), (5) Martin Branda (KPMS MFF UK) 04-04-2016 12 / 28
Traveling salesman problem Subroute elimination conditions III u i u j + nx ij n 1, i, j = 2,..., n Hamilton cycle is feasible: let the vertices be ordered as v 1 = 1, v 2,..., v n. We set u i = l, if v l = i, i.e. u i represent the order. For each edge of the cycle {i, j} it holds u i u j = 1, i.e. u i u j + nx ij = 1 + n n 1. (6) For edges, which are not in the cycle, the inequality holds too: u i u j n 1 a x ij = 0. Martin Branda (KPMS MFF UK) 04-04-2016 13 / 28
Traveling salesman problem Traveling Salesman Problem with Time Windows t i time when customer i is visited T ij time necessary to reach j from i l i, u i lower and upper bound (time window) for visiting customer i M large constant min x ij,t i i=1 j=1 c ijx ij (7) x ij = 1, j = 1,..., n, (8) i=1 x ij = 1, i = 1,..., n, (9) j=1 t i + T ij t j M(1 x ij) i, j = 1,..., n, (10) l i t i u i, i = 1,..., n, (11) x ij {0, 1}. Martin Branda (KPMS MFF UK) 04-04-2016 14 / 28
Traveling salesman problem Capacitated Vehicle Routing Problem Parameters n number of customers 0 depo (starting and finishing point of each vehicle) K number of vehicles (homogeneous) d j 0 customer demand, for depo d 0 = 0 Q > 0 vehicle capacity ( KQ n j=1 d j) c ij transportation costs from i to j (usually c ii = 0) Decision variables x ij equal to 1, if j follows after i on the route, 0 otherwise u j upper bound on transported amount after visiting customer j Martin Branda (KPMS MFF UK) 04-04-2016 15 / 28
Traveling salesman problem Capacitated Vehicle Routing Problem min x ij,u i i=0 j=0 c ijx ij (12) x ij = 1, j = 1,..., n, (13) i=0 x ij = 1, i = 1,..., n, (14) j=0 x i0 = K, (15) i=1 x 0j = K, (16) j=1 u i u j + d j Q(1 x ij) i, j = 1,..., n, (17) d i u i Q, i = 1,..., n, (18) x ij {0, 1}. Martin Branda (KPMS MFF UK) 04-04-2016 16 / 28
Traveling salesman problem Capacitated Vehicle Routing Problem (12) minimization of transportation costs (13) exactly one vehicle arrives to customer j (14) exactly one vehicle leaves customer i (15) exactly K vehicles return to depot 0 (16) exactly K vehicles leave depot 0 (17) balance conditions of transported amount (subroute elimination conditions) (18) bounds on the vehicle capacity (All vehicles are employed.) Martin Branda (KPMS MFF UK) 04-04-2016 17 / 28
Traveling salesman problem Basic heuristics for VRP Insertion heuristic: Start with empty routes. FOR all customers DO: Insert the customer to the place in a route where it causes the lowest increase of the traveled distance. Clustering: Cluster the customers according to their geographic positions ( angles ). Solve 1 the traveling salesman problem in each cluster. Possible difficulties: time windows, vehicle capacities,... 1..exactly, if the clusters are not large. Martin Branda (KPMS MFF UK) 04-04-2016 18 / 28
Tabu search for VRP Traveling salesman problem For a given number of iteration, run the following steps: Find the best solution in a neighborhood of the current solution. Such solution can be worse than the current one or even infeasible (use penalty function). Forbid moving back for a random number of steps by actualizing the tabu list. Remember the best solution. The tabu search algorithm enables moving from local solutions (compared with a simple hill climbing alg. ). Martin Branda (KPMS MFF UK) 04-04-2016 19 / 28
Norway... Real problem Martin Branda (KPMS MFF UK) 04-04-2016 20 / 28
Real problem Rich Vehicle Routing Problems Goal maximization of the ship filling rate (operational planning), optimization of fleet composition, i.e. number and capacity of the ships (strategic planning) Rich Vehicle Routing Problem time windows heterogeneous fleet (vehicles with different capacities and speed) several depots with inter-depot trips several routes during the planning horizon non-euclidean distances (fjords) Mixed-integer programming :-(, constructive heuristics for getting an initial feasible solution and tabu search M. Branda, K. Haugen, J. Novotný, A. Olstad, Downstream logistics optimization at EWOS Norway. Research report. Martin Branda (KPMS MFF UK) 04-04-2016 21 / 28
Real problem Rich Vehicle Routing Problems Our approach Mathematical formulation GAMS implementation Heuristic (insertion, tabu search) implementation Decision Support System (DSS) Martin Branda (KPMS MFF UK) 04-04-2016 22 / 28
Other applications of MIP Facility Location Problem i warehouses (facilities), j customers x ij sent quantity y i a warehouse is built c ij unit supplying costs f i fixed costs K i warehouse capacity D j demand min x ij,y i s.t. m c ijx ij + f iy i j=1 i m x ij K iy i, i = 1,..., n, i=1 j=1 x ij = D j, j = 1,..., m, i=1 x ij 0, y i {0, 1}. Martin Branda (KPMS MFF UK) 04-04-2016 23 / 28
Other applications of MIP Scheduling to Minimize the Makespan i machines, j jobs, y machine makespan, x ij assignment variable t ij time necessary to process job j on machine i, min y x ij,y s.t. m x ij = 1, j = 1,..., n, i=1 x ij t ij y, i = 1,..., m. j=1 (19) Martin Branda (KPMS MFF UK) 04-04-2016 24 / 28
Lot Sizing Problem Uncapacitated single item LSP Other applications of MIP x t production at period t y t on/off decision at period t s t inventory at the end of period t (s 0 0 fixed) D t (predicted) expected demand at period t p t unit production costs at period t f t setup cost at period t h t inventory cost at period t M large constant min x t,y t,s t T (p tx t + f ty t + h ts t) t=1 s.t. s t 1 + x t D t = s t, t = 1,..., T, x t My t, x t, s t 0, y t {0, 1}. ASS. Wagner-Whitin costs p t+1 p t + h t. Martin Branda (KPMS MFF UK) 04-04-2016 25 / 28 (20)
Lot Sizing Problem Capacitated single item LSP Other applications of MIP x t production at period t y t on/off decision at period t s t inventory at the end of period t (s 0 0 fixed) D t (predicted) expected demand at period t p t unit production costs at period t f t setup cost at period t h t inventory cost at period t C t production capacity at period t min x t,y t,s t T (p tx t + f ty t + h ts t) t=1 s.t. s t 1 + x t D t = s t, t = 1,..., T, x t C ty t, x t, s t 0, y t {0, 1}. ASS. Wagner-Whitin costs p t+1 p t + h t. Martin Branda (KPMS MFF UK) 04-04-2016 26 / 28 (21)
Other applications of MIP Unit Commitment Problem y it on/off decision for unit i at period t x it production level for unit i at period t D t (predicted) expected demand at period t pi min, pi max minimal/maximal production capacity of unit i c it (fixed) start-up costs f it variable production costs min x it,y it s.t. i=1 t=1 T (c it x it + f it y it ) x it D t, t = 1,..., T, i=1 pi min y it x it pi max y it, x it 0, y it {0, 1}. (22) Martin Branda (KPMS MFF UK) 04-04-2016 27 / 28
Literature Other applications of MIP O. Kafka: Optimální plánování rozvozu pomocí dopravních prostředků, Diploma thesis MFF UK, 2013. (IN CZECH) P. Toth, D. Vigo (2002). The vehicle routing problem, SIAM, Philadelphia. L.A. Wolsey (1998). Integer Programming. Wiley, New York. L.A. Wolsey, G.L. Nemhauser (1999). Integer and combinatorial optimization. Wiley, New York. Martin Branda (KPMS MFF UK) 04-04-2016 28 / 28