Resource Constrained Shortest Paths with Side Constraints and Non Linear Costs Stefano Gualandi [email protected] http://www-dimat.unipv.it/~gualandi twitter: @famo2spaghi Thursday, September 19, 13 Outline 1. Introduction 2. Non Linear Costs 3. Iterated Preprocessing 4. Lower bounding via Lagrangian Relaxation 5. Computational Results Thursday, September 19, 13 Column GenerationPersepective Overview Column Generation: Algorithmic What is F in Crew Scheduling problems? Thursday, September 19, 13 Constrained Shortest Path Column orResource Variable Generation The problem of putting together a set of pieces of work into a single duty, that is a column or variable of problem (LP-MP), is formalized as a Resource Constrained Shortest Path Problem Example 12 pieces of works, 3 depots Thursday, September 19, 13 Introduction Regional Transit Resource Constraint Shortest Path Resource Constrained Shortest Path Resource Constraint Shortest Path Let G = (N, A) be the compatibility graph, weighted, directed, and acyclic: N = P fi {{s h , t h }|h œ D} a node for each PoW, and a pair of nodes for each depot A has an arc for each pair (i, j) of compatible PoW, and (s h , i) (pull-out) and (i, t h ) (pull-in) ’h œ D and i œ P Thursday, September 19, 13 N = P fiResource {{s h , t h }|h œConstrained D} Shortest Path A has an arcoffor eachtogether pair (i, aj)set of ofcompatible PoW, (s h , i) The problem putting pieces of work into and a single duty, that is and a column variable of’h problem (LP-MP), (pull-out) (i, t hor ) (pull-in) œ D and i œ Pis formalized as a k each arc (i, j) has associated a set of resources r ij , for each k œ K , Resource Constrained Shortest Path Problem e.g. working time, driving time, and break time (other resources may be used to model workingonregulation) Example: A possible path/duty G Tuesday, June 4, 13 Thursday, September 19, 13 Example of Crew Schedules (with reosurces) Example of Crew Schedule (Resources) Resources: 1 spread time (red) 2 driving time (light blue), corresponds to PoW Tuesday, June 4, 13 3 out-of-service time (yellow) 4 long break (grey) 5 breaks (green), very important how they are located Thursday, September 19, 13 Non Linear Costs Thursday, September 19, 13 Non Linear Costs Thursday, September 19, 13 600 400 0 200 f(t(P)) = step(t(P)) + (t(P))^2 800 Non Linear Costs 0 60 120 180 240 300 360 Time Thursday, September 19, 13 420 480 540 600 660 720 Lagrangian Relaxation: Arc-Flow Formulation Resource Constrained Shortest Paths (RCSP) 3 4 Arc-flow IP formulation with non linear costs fh · : min s.t. ÿ eœA ÿ w e xe + eœ”i+ ÿ eœA xe ≠ ÿ ÿ kœK hœH ÿ eœ”i≠ rek xe Æ U k fh 3ÿ eœA xe = bi = rek xe 4 Y _ ] +1 if i = s ≠1 if i = t _ [ 0 otherwise ’i œ N ’k œ K + side non linear constraints xe œ {0, 1} Thursday, September 19, 13 ’e œ A. Resource Constrained Shortest Paths (RCSP) w e, t e a 5, 1 5, 1 s 5, 1 5, 1 i 10, 0 Thursday, September 19, 13 b 5, 0 c t 10, 0 5, 0 d Definition (Path Super Additivity) Resource Constrained Shortest Paths (RCSP) A (path) cost function is super additive iff: We restrict to super additive functions: c(P1 fi P2 ) Ø c(P1 ) + c(P2 ) We consider here a specific type of super additive 3 c(P) = w (P) + f t(P) w e, t e a 5, 1 s 10, 0 Thursday, September 19, 13 b 5, 1 5, 1 !i " = ÿ eœP w5,e 1+ f 4 3ÿ eœP t te 4 where f · is a super additive function. Since w ( c(P) is also super additive. 5, 0 10, 0 5, 0 c d we,$te$ a b Additivity) 5,1 (Path Super 5,1 5,1 5,1 Definition Resource Constrained Shortest Paths (RCSP) A (path) cost function is super additive iff: i t s c(P1 fi P5,02 ) Ø c(P1 ) + c(P2 ) 10,0 10,0to super 5,0 We restrict additive functions: c d ! " q !q "2 Example: Consider c(P) = w (P) f P = we + typeeœP Example: We + consider here eœP a specific of tsuper additive e There are 4 paths: 3 4 ! " c(P) P1 = {s, a, i, b, t}, w (P1 ) = 20, f P1 = 16, c(P1= ) = w36(P) + f t(P) ! " w e, t e 3ÿ 4 a w (P2 ) = 25, f P2 = 4, c(P2 )b = 29 ÿ P2 = {s, c, i, b, t}, 5, 1 = w5,e 1+ f te 5, 1 ! "5, 1 P3 = {s, a, i, d, t}, w (P3 ) = 25, f P3 = 4, c(P3 ) = 29 eœP eœP s t !i! " " P4 = {s, c, i, d, t}, w (P4 )where = 30,ff ·P4is=a 0, c(P ) = 30 4 super additive function. Since w ( c(P) is also super additive. 5, 0 10, 0 5, 0 10, 0 Thursday, September 19, 13 c d we,$te$ a b Additivity) 5,1 (Path Super 5,1 5,1 5,1 Definition Resource Constrained Shortest Paths (RCSP) A (path) cost function is super additive iff: i t s c(P1 fi P5,02 ) Ø c(P1 ) + c(P2 ) 10,0 10,0to super 5,0 We restrict additive functions: c d ! " q !q "2 Example: Consider c(P) = w (P) f P = we + typeeœP Example: We + consider here eœP a specific of tsuper additive e There are 4 paths: 3 4 ! " c(P) P1 = {s, a, i, b, t}, w (P1 ) = 20, f P1 = 16, c(P1= ) = w36(P) + f t(P) ! " w e, t e 3ÿ 4 a w (P2 ) = 25, f P2 = 4, c(P2 )b = 29 ÿ P2 = {s, c, i, b, t}, 5, 1 = w5,e 1+ f te 5, 1 ! "5, 1 P3 = {s, a, i, d, t}, w (P3 ) = 25, f P3 = 4, c(P3 ) = 29 eœP eœP s t !i! " " P4 = {s, c, i, d, t}, w (P4 )where = 30,ff ·P4is=a 0, c(P ) = 30 4 super additive function. Since w ( c(P) is also super additive. 5, 0 10, 0 5, 0 10, 0 c d Optimal Path: P2 = {s, c, i, b, t}, c(P2) = 25 + 4 = 29 Thursday, September 19, 13 we,$te$ a b Additivity) 5,1 (Path Super 5,1 5,1 5,1 Definition Resource Constrained Shortest Paths (RCSP) A (path) cost function is super additive iff: i t s c(P1 fi P5,02 ) Ø c(P1 ) + c(P2 ) 10,0 10,0to super 5,0 We restrict additive functions: c d ! " q !q "2 Example: Consider c(P) = w (P) f P = we + typeeœP Example: We + consider here eœP a specific of tsuper additive e There are 4 paths: 3 4 ! " c(P) P1 = {s, a, i, b, t}, w (P1 ) = 20, f P1 = 16, c(P1= ) = w36(P) + f t(P) ! " w e, t e 3ÿ 4 14 a w (P2 ) = 25, f P2 = 4, c(P2 )b = 29 ÿ P2 = {s, c, i, b, t}, 5, 1 = w5,e 1+ f te 5, 1 ! "5, 1 P3 = {s, a, i, d, t}, w (P3 ) = 25, f P3 = 4, c(P3 ) = 29 eœP eœP s t !i! " " P4 = {s, c, i, d, t}, w (P4 )where = 30,ff ·P4is=a 0, c(P ) = 30 4 super additive function. Since w ( c(P) is also super additive. 5, 0 10, 0 5, 0 10, 0 c 15 d Optimal Path: P2 = {s, c, i, b, t}, c(P2) = 25 + 4 = 29 Thursday, September 19, 13 we,$te$ a b Additivity) 5,1 (Path Super 5,1 5,1 5,1 Definition Resource Constrained Shortest Paths (RCSP) A (path) cost function is super additive iff: i t s c(P1 fi P5,02 ) Ø c(P1 ) + c(P2 ) 10,0 10,0to super 5,0 We restrict additive functions: c d ! " q !q "2 Example: Consider c(P) = w (P) f P = we + typeeœP Example: We + consider here eœP a specific of tsuper additive e There are 4 paths: 3 4 ! " c(P) P1 = {s, a, i, b, t}, w (P1 ) = 20, f P1 = 16, c(P1= ) = w36(P) + f t(P) ! " w e, t e 3ÿ 4 14 a w (P2 ) = 25, 14f P2 = 4, c(P2 )b = 29 ÿ P2 = {s, c, i, b, t}, 5, 1 = w5,e 1+ f te 5, 1 ! "5, 1 P3 = {s, a, i, d, t}, w (P3 ) = 25, f P3 = 4, c(P3 ) = 29 eœP eœP s t !i! " " P4 = {s, c, i, d, t}, w (P4 )where = 30,ff ·P4is=a 0, c(P ) = 30 4 super additive function. Since w ( c(P) is also super additive. 5, 0 10, 0 5, 0 10, 0 c 15 d Optimal Path: P2 = {s, c, i, b, t}, c(P2) = 25 + 4 = 29 Thursday, September 19, 13 we,$te$ a b Additivity) 5,1 (Path Super 5,1 5,1 5,1 Definition Resource Constrained Shortest Paths (RCSP) A (path) cost function is super additive iff: i t s c(P1 fi P5,02 ) Ø c(P1 ) + c(P2 ) 10,0 10,0to super 5,0 We restrict additive functions: c d ! " q !q "2 Example: Consider c(P) = w (P) f P = we + typeeœP Example: We + consider here eœP a specific of tsuper additive e There are 4 paths: 3 4 ! " c(P) P1 = {s, a, i, b, t}, w (P1 ) = 20, f P1 = 16, c(P1= ) = w36(P) + f t(P) ! " w e, t e 3ÿ 4 36 a w (P2 ) = 25, f P2 = 4, c(P2 )b = 29 ÿ P2 = {s, c, i, b, t}, 5, 1 = w5,e 1+ f te 5, 1 ! "5, 1 P3 = {s, a, i, d, t}, w (P3 ) = 25, f P3 = 4, c(P3 ) = 29 eœP eœP s t !i! " " P4 = {s, c, i, d, t}, w (P4 )where = 30,ff ·P4is=a 0, c(P ) = 30 4 super additive function. Since w ( c(P) is also super additive. 5, 0 10, 0 5, 0 10, 0 c d Path: P3 = {s, a, i, b, t}, c(P2) = 20 + 16 = 36 Thursday, September 19, 13 we,$te$ a b Additivity) 5,1 (Path Super 5,1 5,1 5,1 Definition Resource Constrained Shortest Paths (RCSP) A (path) cost function is super additive iff: i t s c(P1 fi P5,02 ) Ø c(P1 ) + c(P2 ) 10,0 10,0to super 5,0 We restrict additive functions: c d ! " q !q "2 Example: Consider c(P) = w (P) f P = we + typeeœP Example: We + consider here eœP a specific of tsuper additive e There are 4 paths: 3 4 ! " c(P) P1 = {s, a, i, b, t}, w (P1 ) = 20, f P1 = 16, c(P1= ) = w36(P) + f t(P) ! " w e, t e 3ÿ 4 a w (P2 ) = 25, 14f P2 = 4, c(P2 )b = 29 ÿ P2 = {s, c, i, b, t}, 5, 1 = w5,e 1+ f te 5, 1 ! "5, 1 P3 = {s, a, i, d, t}, w (P3 ) = 25, f P3 = 4, c(P3 ) = 29 eœP eœP s t !i! " " P4 = {s, c, i, d, t}, w (P4 )where = 30,ff ·P4is=a 0, c(P ) = 30 4 super additive function. Since w ( c(P) is also super additive. 5, 0 10, 0 5, 0 10, 0 c 15 d Bellmann’s optimality conditions do not hold! Thursday, September 19, 13 Outline 1. Introduction 2. Non Linear Costs 3. Iterated Preprocessing 4. Lower bounding via Lagrangian Relaxation 5. Computational Results Thursday, September 19, 13 Resource-basedResource-based Filtering Preprocessing ⌫ (Beasley and Christofides, 1989; Dumitrescu and Boland, 2003; Sellmann et al., 2007) if r k (Psiú ) + rek + r k (Pjtú ) > U k then remove arc e = (i, j) where Psiú and Pjtú are shortest (k-th resource) paths. Resource consumption of each arc. Upper resource bound U = 7. 6 a b 1 2 2 3 s 1 4 2 c Thursday, September 19, 13 t 1 d Resource-basedResource-based Filtering Preprocessing ⌫ (Beasley and Christofides, 1989; Dumitrescu and Boland, 2003; Sellmann et al., 2007) if r k (Psiú ) + rek + r k (Pjtú ) > U k then remove arc e = (i, j) where Psiú and Pjtú are shortest (k-th resource) paths. Resource consumption of each arc. Upper resource bound U = 7. 6 a re a 2 2 s 3 3 s 4 4 b b 2 2 1 1 1 1 t 2 c c Thursday, September 19, 13 6 d 1 1 d 2 t Resource-basedResource-based Filtering Preprocessing ⌫ (Beasley and Christofides, 1989; Dumitrescu and Boland, 2003; Sellmann et al., 2007) if r k (Psiú ) + rek + r k (Pjtú ) > U k then remove arc e = (i, j) where Psiú and Pjtú are shortest (k-th resource) paths. Resource consumption of each arc. Upper resource bound U = 7. 6 a re a 2 2 s 3 3 s 4 4 b b 2 2 1 1 1 1 t 2 c c Thursday, September 19, 13 6 d 1 1 d 2 t Resource-basedResource-based Filtering Preprocessing ⌫ (Beasley and Christofides, 1989; Dumitrescu and Boland, 2003; Sellmann et al., 2007) if r k (Psiú ) + rek + r k (Pjtú ) > U k then remove arc e = (i, j) where Psiú and Pjtú are shortest (k-th resource) paths. Resource consumption of each arc. Upper resource bound U = 7. 6 a re a 2 2 s 3 3 s 4 4 b b 2 2 1 1 1 1 t 2 c c Thursday, September 19, 13 6 d 1 1 d 2 t Resource-basedResource-based Filtering Preprocessing ⌫ (Beasley and Christofides, 1989; Dumitrescu and Boland, 2003; Sellmann et al., 2007) if r k (Psiú ) + rek + r k (Pjtú ) > U k then remove arc e = (i, j) where Psiú and Pjtú are shortest (k-th resource) paths. Resource consumption of each arc. Upper resource bound U = 7. 6 a re a 2 2 s 3 3 s 4 4 b b 2 2 1 1 1 1 t 2 c c Thursday, September 19, 13 6 d 1 1 d 2 t Resource-basedResource-based Filtering Preprocessing ⌫ (Beasley and Christofides, 1989; Dumitrescu and Boland, 2003; Sellmann et al., 2007) if r k (Psiú ) + rek + r k (Pjtú ) > U k then remove arc e = (i, j) where Psiú and Pjtú are shortest (k-th resource) paths. Resource consumption of each arc. Upper resource bound U = 7. 6 a re a 2 2 s 3 3 s 4 4 b b 2 2 1 1 1 1 t 2 c c Thursday, September 19, 13 6 d 1 1 d 2 t Cost-based Preprocessing UB=7 ce 2 a 3 4 b 1 s Thursday, September 19, 13 6 2 1 t 2 c 1 d Cost-based Preprocessing UB=7 ce 2 a 3 4 b 1 s Thursday, September 19, 13 6 2 1 t 2 c 1 d Cost-based Preprocessing ⌫ if LB(c(P ú e )) Ø UB then remove arc e s≠ æt ú where P e is a shortest path from s to t via arc e. s≠ æt There are at least three methods to compute such lower bound (see our poster!) UB=7 ce 6 a b 1 The most2 effective is based on a Lagrangian Relaxation s 3 4 Thursday, September 19, 13 2 1 t 2 c 1 d Outline 1. Introduction 2. Non Linear Costs 3. Iterated Preprocessing 4. Lower bounding via Lagrangian Relaxation 5. Computational Results Thursday, September 19, 13 Lagrangian Relaxation: Arc-Flow Formulation Resource Constrained Shortest Paths (RCSP) ! " Arc-flow IP formulation with non linear costs f · ÿ min eœA ÿ s.t. w e xe + eœ”i+ ÿ eœA xe ≠ ÿ ÿ kœK hœH ÿ eœ”i≠ rek xe Æ U k fh 3ÿ eœA xe = bi = rek xe 4 h: Y _ ] +1 if i = s ≠1 if i = t _ [ 0 otherwise ’i œ N ’k œ K + side non linear constraints xe œ {0, 1} Thursday, September 19, 13 ’e œ A. Lagrangian Relaxation: Arc-Flow Formulation Resource Constrained Shortest Paths (RCSP) ! " Arc-flow IP formulation with non linear costs f · : min ÿ w e xe + f eœA ÿ s.t. eœ”i+ ÿ eœA xe ≠ 3ÿ ÿ eœ”i≠ rek xe Æ U k eœA re1 xe 4 xe = bi = Y _ ] +1 if i = s ≠1 if i = t _ [ 0 otherwise xe œ {0, 1} [G. Tsaggouris and C. Zaroliagis, ESA2004] Thursday, September 19, 13 ’i œ N ’k œ K ’e œ A. Resource Constrained Shortest Paths (RCSP) Lagrangian Relaxation: Arc-Flow Formulation ! " Arc-flow IP formulation with non linear costs f · : min s.t. ÿ eœA ÿ 3 4 w e xe + f z eœ”i+ ÿ eœA ÿ eœA xe ≠ ÿ eœ”i≠ rek xe Æ U k ≠1 if i = t _ [ 0 otherwise ’i œ N ’k œ K re1 xe = z xe œ {0, 1} Thursday, September 19, 13 xe = bi = Y _ ] +1 if i = s ’e œ A. Lower Bounding: Lagrangian Relaxation The arc-flow LP relaxation of RCSP with a super additive cost ! " function f · is: min s.t. ÿ eœA w e xe + f z ÿ eœ”i+ multiplier –k Æ 0 multiplier — Æ 0 æ æ ÿ eœA ÿ eœA xe ≠ ÿ eœ”i≠ rek xe Æ U k xe = bi (8) ’i œ N (9) ’k œ K (10) t e xe Æ z xe Ø 0 Thursday, September 19, 13 ! " (11) ’e œ A. (12) LagrangianLower Relaxation: Bounding:Arc-Flow LagrangianFormulation Relaxation Iti is possible to formulate the following Lagrangian dual: ÿ (–, —) = ≠ –k U k + kœK + min s.t. ÿ eœ”i+ ÿ eœA xe ≠ xe Ø 0 A we + ÿ eœ”i≠ ÿ kœK xe = bi –k rek + —te B ’i œ N ! " xe + f z ≠—z ’e œ A. This problem decomposes into two subproblems and is solved via a subgradient optimization algorithm: 1 The x variables define a shortest path problem 2 The z variable defines an unconstrained optimization problem Thursday, September 19, 13 ⌫ Cost-based Preprocessing via Lagrangian Lower Bounds if LB(c(P ú e )) Ø UB then remove arc e s≠ æt ú where P e is a shortest path from s to t via arc e. ⌫ s≠ æt if LB(c(P ú e )) Ø UB then remove arc e s≠ æt ú There where are at Pleast three methods to compute is a shortest path from s tosuch t vialower arc e.bound e s≠ æt (see our poster!) The are most is based on to a Lagrangian Relaxation There at effective least three methods compute such lower bound (see our poster!) ⌫ ! " ú ú ¯ c(P e ) Ø w̄ (P e ) + min{f z ≠ —z} The most effective is based Relaxation s≠ æt s≠ æton a Lagrangian q ¯ e] [with reduced costs w̄e = we + kœK – ¯ k rek + —t Thursday, September 19, 13 Filter and Dive Algorithm 1: FilterAndDive(G, LB, U B, F g , B g , U g ) 1 2 3 4 5 6 7 Input: G = (N, A) directed graph and distance function g(·) Input: (LB, U B) lower and upper bounds on the optimal path Input: F g , B g forward and backward shortest path tree as function of g(·) Input: U g upper bound on the path length as function of g(·) Output: An optimum path, or updated U B, or a reduced graph foreach i 2 N do if Fig + Big > U g then N N \ {i} FILTER... else foreach e = (i, j) 2 A do if Fig + g(e) + Bjg > U g then A A \ {e} 8 9 10 11 12 13 14 15 Thursday, September 19, 13 ...DIVE else if PathCost(Fig , e, Bjg ) < U B^ PathFeasible(Fig , e, Bjg ) then ⇤ Pst MakePath(Fig , e, Bjg ); ⇤ Update U B and store Pst ; check for side if LB U B then constraints ⇤ return Pst (that is an optimum path) else A A \ {e} Closing the Duality Gap Near Shortest Path Enumeration After reaching a fixpoint, if LB < UB then, we apply a near shortest path enumeration algorithm (Carlyle et al., 2008). We compute shortest reversed distances for every resource and for reduced costs Then we perform a depth-first search from s. When a vertex i is visited, the algorithm backtracks if 1 for any resource k, the consumption of Psi plus the reversed (resource) distance to t exceeds U k 2 the reduced cost of Psi plus the reversed (reduced cost) distance to t exceeds UB 3 the cost c(Psi ) Ø UB Thursday, September 19, 13 Outline 1. Introduction 2. Non Linear Costs 3. Iterated Preprocessing 4. Lower bounding via Lagrangian Relaxation 5. Computational Results Thursday, September 19, 13 Constrained Path Solver: Scalability Thursday, September 19, 13 Computational Results: Stepwise Function Resource and Cost-based Preprocessing Non linear costs: extra allowances Each row gives the averages over 16 instances, with 7 resources. is percentage of removed arcs Gap is UB≠Opt Opt ◊ 100 Graphs Resource Reduced Cost Exact n m Time Time Gap Time 4137 135506 0.77 22.5% 3.12 30.2% 0.0% 75.1 2835 132468 0.59 40.3% 2.35 45.4% 0.0% 30.6 3792 134701 0.92 30.2% 2.87 37.4% 0.0% 69.3 Thursday, September 19, 13 Crew Scheduling: Real Life Instances Instance 158TG 171TG 182TG 217TG 233TG 254TG 274TG 300TG 425TG 560TG Pieces 684 802 846 967 1067 1169 1240 1369 1865 2314 Glob. Const. 4 6 7 8 8 10 11 12 32 21 Depots 3 6 7 8 8 10 11 12 16 10 Non linear component: step-wise on single resource Side constraints: non linear constraint on break distribution Thursday, September 19, 13 Logo vettoriale MAIOR Orizzontale Logo vettoriale MAIOR Verticale m. (%) costi sol. e tempi Impact on Column Generation-based Heuristic Miglioram costo (%) 1.00% 0.80% 0.60% 0.40% 0.20% 0.00% 158TG 171TG 182TG 217TG 233TG 254TG 274TG 300TG Logo vettoriale MAIOR Orizzontale 425TG -0.20% -0.40% Logo vettoriale MAIOR Verticale Miglioram Tempo (%) Labeling-heuristic vs. Exact New Algorithm 100.00% Difference of cost solution obtained via column generation 90.00% 80.00% Thursday, September 19, 13 560TG -0.40% Impact on Column Generation-based Heuristic Miglioram Tempo (%) 100.00% 90.00% 80.00% 70.00% 60.00% 50.00% 40.00% 30.00% Logo vettoriale MAIOR Orizzontale 20.00% 10.00% 0.00% 158TG 171TG 182TG 217TG 233TG 254TG 274TG 300TG Labeling-heuristic vs. Exact New Algorithm Difference of run time obtained via column generation Thursday, September 19, 13 425TG Logo vettoriale MAIOR Verticale 560TG 5
© Copyright 2026 Paperzz