Decision Aid Methodologies In TransportationΒ Β· Lab VI: Case study βFreight Trains Management ....
Transcript of Decision Aid Methodologies In TransportationΒ Β· Lab VI: Case study βFreight Trains Management ....
CIVIL-557
Decision Aid Methodologies
In Transportation
Transport and Mobility Laboratory (TRANSP-OR)
Γcole Polytechnique FΓ©dΓ©rale de Lausanne EPFL
Virginie Lurkin
Lab VI:
Case study β Freight Trains Management
Solution of the previous lab
F1
Customer (service costs πππ) Fixed cost (ππ)
Facility 1 2 3
1 1000 20 30 200
2 1000 30 40 200
3 1000 160 150 200
4 50 140 120 200
Which formulation is better?
F2
UFLP problem - solution
max 30π₯1 + 17π₯2 + 14π₯3 + 11π₯4 + 9π₯5
π . π‘. 29π₯1 + 20π₯2 + 16π₯3 + 12π₯4 + 10π₯5 β€ 37
π₯π β 0,1 , βπ = 1,β¦5.
IP(1)
Knapsack problem β example of solution
ππβ ππ
β ππβ ππ
β ππβ πβ CT
0 1 1 0 0 31 12s
max 30π₯1 + 17π₯2 + 14π₯3 + 11π₯4 + 9π₯5
π . π‘. 29π₯1 + 20π₯2 + 16π₯3 + 12π₯4 + 10π₯5 β€ 37
π₯π β₯ 0, βπ = 1,β¦5.
LP(1)
Knapsack problem - example of solution
ππβ ππ
β ππβ ππ
β ππβ πβ CT
1.2759 0 0 0 0 38.28 8s
max 30π₯1 + 17π₯2 + 14π₯3 + 11π₯4 + 9π₯5
π . π‘. 29π₯1 + 20π₯2 + 16π₯3 + 12π₯4 + 10π₯5 β€ 37
π₯π β₯ 0, βπ = 1,β¦5.
LP(1)
Knapsack problem - example of solution
ππβ ππ
β ππβ ππ
β ππβ πβ CT
1.2759 0 0 0 0 38.28 8s
ππ β€ π is the Gomory cut you obtained
max 30π₯1 + 17π₯2 + 14π₯3 + 11π₯4 + 9π₯5
π . π‘. 29π₯1 + 20π₯2 + 16π₯3 + 12π₯4 + 10π₯5 β€ 37
π₯π β₯ 0, βπ = 1,β¦5.
LP(2)
Knapsack problem - example of solution
ππβ ππ
β ππβ ππ
β ππβ πβ CT
1 0 0 0.667 0 37.33 7s
ππ β€ π
max 30π₯1 + 17π₯2 + 14π₯3 + 11π₯4 + 9π₯5
π . π‘. 29π₯1 + 20π₯2 + 16π₯3 + 12π₯4 + 10π₯5 β€ 37
π₯π β₯ 0, βπ = 1,β¦5.
LP(2)
Knapsack problem - example of solution
ππβ ππ
β ππβ ππ
β ππβ πβ CT
1 0 0 0.667 0 37.33 7s
ππ + ππ β€ π is a cover cut
ππ β€ π
max 30π₯1 + 17π₯2 + 14π₯3 + 11π₯4 + 9π₯5
π . π‘. 29π₯1 + 20π₯2 + 16π₯3 + 12π₯4 + 10π₯5 β€ 37
π₯π β₯ 0, βπ = 1,β¦5.
LP(3)
Knapsack problem - solution
ππβ ππ
β ππβ ππ
β ππβ πβ CT
1 0 0 0 0.8 37.2 7s
ππ + ππ β€ π
ππ β€ π
max 30π₯1 + 17π₯2 + 14π₯3 + 11π₯4 + 9π₯5
π . π‘. 29π₯1 + 20π₯2 + 16π₯3 + 12π₯4 + 10π₯5 β€ 37
π₯π β₯ 0, βπ = 1,β¦5.
LP(4)
Knapsack problem - example of solution
ππβ ππ
β ππβ ππ
β ππβ πβ CT
0.724 0.276 0.276 0.276 0.276 35.79 7s
ππ + ππ β€ π
ππ + ππ β€ π
ππ β€ π
ππ + ππ β€ π
ππ + ππ β€ π
max 30π₯1 + 17π₯2 + 14π₯3 + 11π₯4 + 9π₯5
π . π‘. 29π₯1 + 20π₯2 + 16π₯3 + 12π₯4 + 10π₯5 β€ 37
π₯π β₯ 0, βπ = 1,β¦5.
LP(4)
Knapsack problem - example of solution
ππβ ππ
β ππβ ππ
β ππβ πβ CT
0.724 0.276 0.276 0.276 0.276 35.79 7s
ππ + ππ β€ π
ππ + ππ β€ π
ππ β€ π
ππ + ππ β€ π
ππ + ππ β€ π
Gomory cut on the optimal tableau of LP(4) gives me:1.24137931*x1 + 1.068965517*x2 + 0.413793103*x3 + 0.413793103*x4 <=1;
max 30π₯1 + 17π₯2 + 14π₯3 + 11π₯4 + 9π₯5
π . π‘. 29π₯1 + 20π₯2 + 16π₯3 + 12π₯4 + 10π₯5 β€ 37
π₯π β₯ 0, βπ = 1,β¦5.
LP(5)
Knapsack problem - example of solution
ππβ ππ
β ππβ ππ
β ππβ πβ CT
0.252 0.063 0.747 0.747 0.747 34.07 7s
ππ + ππ β€ π
ππ + ππ β€ π
ππ β€ π
ππ + ππ β€ π
ππ + ππ β€ π
1.24137931*x1 + 1.068965517*x2 + 0.413793103*x3 + 0.413793103*x4 <=1;
Lab 6
The Locomotive Fleet Fueling Problem
Overview
The locomotive fleet fueling problem
Problem description
MILP formulation
Simple example (2010 RAS Competition)
Assignment #6
Larger instance
Valid inequalities
Evalution of three models
2010 RAS Competition
Problem description
Problem description
Yards
o Tanker truck contracting cost
o Amount of dispensable fuel per tanker truck
o Fuel cost per gallon
Locomotives
o Schedule β sequence of stops
o Delay cost per stop
Problem description
Sets
o πΌ: set of locomotives (1 locomotive = 1 train)
o π½: set of stops
o πΎ: set of yards
o π: set of days
Parameters
o π·πΆππ: delay cost ($) for locomotive π and stop π
o πΆπΆ: contracting cost ($/truck) for a truck for the entire planning horizon,
same for all yards
o ππ: fuel cost ($/gallon) at yard π
Problem description
Parameters
o ππ: Tanker truck capacity (in gallons) per day, same for all trucks
o πΏπ: Capacity (in gallons) of fuel tank of a locomotive, same for all
locomotives
o πΉπΆππ: fuel consumption (in gallons) for a locomotive π to go for stop π to
stop π + 1
o ππ: set of stops for locomotive π in the planning horizon
o ππππππ: Yard used if locomotive π refuels at stop π
o π·ππ¦ππ: Day in which locomotive π is at stop π
Problem description
Decision variables
o π₯ππ = α1 ππ πππππππ‘ππ£π π ππππ’πππ ππ‘ ππ‘π π π‘ππ π0 ππ‘βπππ€ππ π
o π¦π = ππ’ππππ ππ ππ’ππ π‘ππππ π‘π ππ ππππ‘ππππ‘ππ ππ‘ π¦πππ π
o πππ = πππππππ ππ ππ’ππ πππ’ππππ ππ¦ πππππππ‘ππ£π π ππ‘ ππ‘π π π‘ππ π
o π£ππ = πππππππ ππ ππ’ππ ππ π‘βπ π‘πππ ππ πππππππ‘ππ£π π π’πππ πππππ£ππ ππ‘ ππ‘π π π‘ππ π
MILP formulation
πππ delay costs + contracting costs + fueling costs
π . π‘.
πππππππ ππ ππ’ππ ππ π‘βπ π‘πππ ππ πππππππ‘ππ£π π π’πππ πππππ£ππ ππ‘ ππ‘π π π‘ππ π
πππππππ ππ ππ’ππ ππ π‘βπ π‘πππ ππ πππππππ‘ππ£π π π’πππ πππππ£ππ ππ‘ ππ‘π π π‘ππ π β 1
πππππππ ππ ππ’ππ πππ’ππππ ππ¦ πππππππ‘ππ£π π ππ‘ ππ‘π π π‘ππ π β 1
ππ’ππ ππππ π’πππ‘πππ ππ πππππππ πππ π πππππππ‘ππ£π π π‘π ππ πππ π π‘ππ π β 1 π‘π π π‘ππ π
=
+
-
1 ππ’ππ ππππ π’πππ‘πππ
π . π‘.
πππππππ ππ ππ’ππ ππ π‘βπ π‘πππ ππ πππππππ‘ππ£π π ππ‘ πππ¦ π‘πππ
β€ Capacity (in gallons) of fuel tank of a locomotive
2 πππππππ‘π¦ ππ ππ’ππ π‘πππ
MILP formulation
πππ delay costs + contracting costs + fueling costs
π . π‘.
πβπ πππππππ ππ ππ’ππ πππ’ππππ ππ¦ πππππππ‘ππ£π π ππ‘ ππ‘π π π‘ππ π πππππππ ππ
π€βππ‘βππ π‘βπ πππππππ‘ππ£π π π π‘πππ ππ‘ π
3 ππππ’πππππ
MILP formulation
πππ delay costs + contracting costs + fueling costs
Simple example (2010 RAS Competition)
4 yards:Y1, Y2, Y3, Y4
2 trains:T1,T2
T1: [Y1,Y2,Y3,Y4]
T2: [Y4,Y2,Y1]
Distances between yards (miles):
d(Y1,Y2) = 106
d(Y2,Y3) = 146
d(Y2,Y4) = 162
d(Y3,Y4) = 16
Y1 Y2 Y3 Y4
Simple example (2010 RAS Competition)
Simple example (2010 RAS Competition)
2 locomotives: L1, L2
Each train needs to be powered by exactly one locomotive
L1 and L2 take staggered turns everyday at pulling the trains
Simple example (2010 RAS Competition)
Locomotive
Consumption: 3.5 gallons of fuel per mile
Tank capacity: 4500 gallons of fuel
Distance that can run on full tank: 1285.71 miles
Fueling truck
Capacity: 25000 gallons
Weekly operating cost: $4000
Fixed refueling cost: $250
Fuel price ($/gallon):
Y1: 3.25
Y2: 3.05
Y3: 3.15
Y4: 3.15
MILP formulation: data
Sets
πΌ = 2 (number of locomotives)
π = 35 (number of potential stops, same for both
locomotives ππ = π)
7 times T1 x 3 potential stops = 21 potential stops
7 times T2 x 2 potential stops = 14 potential stops
πΎ = 4 (number of yards)
π = 14 (number of days)
MILP formulation: data
Parameters
π·ππ = $250 (delay cost of locomotive π at stop π)
πΏπ = 4500 ππππππ (capacity of fuel tank of a locomotive)
ππ = 25000 ππππππ (tanker truck capacity of yard)
πΆπΆ = $8000 (contracting cost of a truck for 2 weeks)
πΉπΆππ : fuel consumption of locomotive π on its journey from
stop π to π + 1 L1:T2 T1 T2 T1 β¦
L1:Y1 Y2 Y3 Y4 Y2 Y1 β¦
CO
NST
AN
T
T1 T2
Y1 Y2 Y3 Y4
371 gal 511 gal 56 gal
567 gal371gal
MILP formulation: data
Parameters
Yπππ π, π : yard of stop π of
locomotive π Dππ¦ π, π : day in which stop
π of locomotive π occurs
ππ =
3.25, 3.05, 3.15, 3.15$/gal (fuel price at yard π)
Provided data: fuel_prices_small.dat: fuel prices at yards (size
πΎ) number_of_stops_small.dat: number of stops for
each locomotive (size πΌ) list_of_events_small.csv: table with all the
possible events
Read from CSV files
1 1 1 1 371 250
1 2 2 1 511 250
1 3 3 1 56 250
1 4 4 2 567 250
1 5 2 2 371 250
Locomotive
Stop
Yard
DayConsumption to next stop Delay costs
Read from CSV files
SheetConnectionsheet1("fuel_prices_small.csv");SheetConnectionsheet2("number_of_stops_small.csv");SheetConnectionsheet3("list_of_events_small.csv");
P fromSheetRead(sheet1,"'fuel_prices_small'!A1:A4"); // fuel price at yard k (in dolars/gallon)N fromSheetRead(sheet2,"'number_of_stops_small'!A1:A2"); // number of stops for each locomotive iData fromSheetRead(sheet3,"'list_of_events_small'!A1:F70"); // LocoNumber,LocoStopNumber,YardNumber,Day,ConsumptionStops,StopDelayCost
Model formulation and small instance
Write a mathematical model (MILP) designed to find the most
cost effective plan to fuel the locomotives.
Implement your model in OPL and solve it for the small
instance.
Provide an interpretation of the solution.
MILP formulation
minimize
π
πΆπΆπ β π¦π +
π,π
π·π,π β π₯π,π + ππ¦πππ π,π β ππ,π
π£π,π = π£π,πβ1 + ππ,πβ1 β πΉπΆπ,πβ1 βπ, π = 2,β¦ , ππ
π£π,π + ππ,π β€ πΏππ βπ, π
ππ,π β€ πΏπππ₯π,π βπ, π
(π,π)βΆ π¦πππ(π,π) = π,πππ¦(π,π)=π
ππ,π β€ πππ β π¦π βπ, π
π¦π integer, π₯π,π binary, ππ,π , π£π,π β₯ 0
MILP formulation
minimize
π
πΆπΆπ β π¦π +
π,π
π·π,π β π₯π,π + ππ¦πππ π,π β ππ,π
π£π,π = π£π,πβ1 + ππ,πβ1 β πΉπΆπ,πβ1 βπ, π = 2,β¦ , ππ
π£π,π + ππ,π β€ πΏππ βπ, π
ππ,π β€ πΏπππ₯π,π βπ, π
(π,π)βΆ π¦πππ(π,π) = π,πππ¦(π,π)=π
ππ,π β€ πππ β π¦π βπ, π
π¦π integer, π₯π,π binary, ππ,π , π£π,π β₯ 0
Results of the basic instance
Loc Yard StopNumber Day Gallons
2 4 1 1 0
2 2 2 1 0
2 1 3 2 0
2 2 4 2 0
2 3 5 2 0
2 4 6 3 0
2 2 7 3 0
2 1 8 4 0
2 2 9 4 0
2 3 10 4 0
2 4 11 5 0
2 2 12 5 4313
2 1 13 6 0
2 2 14 6 0
2 3 15 6 0
2 4 16 7 0
2 2 17 7 0
2 1 18 8 0
2 2 19 8 0
2 3 20 8 0
2 4 21 9 0
2 2 22 9 0
2 1 23 10 0
2 2 24 10 4263
2 3 25 10 0
2 4 26 11 0
2 2 27 11 0
2 1 28 12 0
2 2 29 12 0
2 3 30 12 0
2 4 31 13 0
2 2 32 13 0
2 1 33 14 0
2 2 34 14 0
2 3 35 14 0
Loc Yard StopNumber Day Gallons
1 1 1 1 0
1 2 2 1 0
1 3 3 1 0
1 4 4 2 0
1 2 5 2 0
1 1 6 3 0
1 2 7 3 0
1 3 8 3 0
1 4 9 4 0
1 2 10 4 0
1 1 11 5 0
1 2 12 5 2633
1 3 13 5 0
1 4 14 6 0
1 2 15 6 0
1 1 16 7 0
1 2 17 7 0
1 3 18 7 0
1 4 19 8 0
1 2 20 8 4500
1 1 21 9 0
1 2 22 9 0
1 3 23 9 0
1 4 24 10 0
1 2 25 10 0
1 1 26 11 0
1 2 27 11 0
1 3 28 11 0
1 4 29 12 0
1 2 30 12 0
1 1 31 13 0
1 2 32 13 1128
1 3 33 13 0
1 4 34 14 0
1 2 35 14 0
Results of the basic instance
Interpretation of the results:
Fueling trucks are contracted only inYard 2
Locomotive 1 stops three times:
Day 5, stop 12: 2633 gallons
Day 8, stop 20: 4500 gallons
Day 13, stop 32: 1128 gallons
Locomotive 2 stops two times:
Day 5, stop 12: 4313 gallons
Day 10, stop 24: 4263 gallons
Objective value: 60602.85
Assignment #6
The following inequalities are valid for our problem:
V1: π₯π,π β€ π¦π¦πππ π,π βπ, π
V2:
Using the large instance, run three versions of the model
separately:
M1: Standard model
M2: Standard model + V1
M3: Standard model + V2
π=1
ππ
π₯π,π β₯ ππππΉπ’πππ π βπ
ππππΉπ’πππ π =Οπ=1ππ πΉπΆπ,π
πΏππ
Assignment #6
Stop the running after 15 minutes (900 seconds): cplex.tilim = 900;
Report the following information in a table: getobjectivevalue(m)
getobjbound(m)
getobjgap(m)
getsolvetime(m)
M1 M2 M3
Best known solution
Lower bound
Optimality gap
Solution time (s) Analyze the solutions and provide conclusions
Assignment #6
Send a single file containing all the answers including your
code (format is up to you) AND mathematical formulations of
the different models.
Group/Individual work
Send your reports to virginie.lurkin(at)epfl.ch
Send your reports by 8:00 P.M. next Monday