Download presentation
Presentation is loading. Please wait.
1
Modeling Flows and Information
Single commodity flow problems Multicommodity Flow Conservation Weight and Cube Pass through vs Unload/Reload Tracking Information Column Generation Spring 02 Vande Vate 1
2
Modeling Tools We will rely on Solver in Excel
Instructions on installing and using Solver accessible from the class homepage Convenient: Everyone is familiar with Excel Minimal fixed costs of installing, accessing and learning syntax for a new application Inconvenient: Solver is unreliable. It says models are not linear when they are. It says it has found a solution when it hasn't, etc. It combines the problem data with the model Limited problem sizes Solver is not an industrial strength tool. So, I encourage you to learn an algebraic modeling language and implement the models we discuss in class in that language. Claudio is an excellent resource for help in developing these models. Spring 02 Vande Vate 2
3
Motor Distribution Belgium Netherlands Germany 500 500 800 800 500 400
700 400 900 200 * Belgium Germany Netherlands The Hague Amsterdam Antwerp Nancy Liege Tilburg Leipzig Miles 100 50 500 800 500 400 700 200 900 Spring 02 Vande Vate 3
4
Transportation Costs Minimize
Unit transportation costs from harbors to plants Minimize the transportation costs involved in moving the motors from the harbors to the plants Spring 02 Vande Vate 4
5
A Transportation Model
Spreadsheet embedded in presentation Spring 02 Vande Vate 5
6
Challenge Find a best answer Spring 02 Vande Vate 6
7
Building a Solver Model
Tools | Solver… Set Target Cell: The cell holding the value you want to minimize (cost) or maximize (revenue) Equal to: Choose Max to maximize or Min to minimize this By Changing Cells: The cells or variables the model is allowed to adjust In the Transportation spreadsheet that’s G19 - the total transportation cost In the Transportation spreadsheet we choose Min to minimize transport cost In the Transportation spreadsheet that is C9:F11 - the Shipment volumes Spring 02 Vande Vate 7
8
Solver Model Cont’d Subject to the Constraints: The constraints that limit the choices of the values of the adjustables. Click on Add Cell Reference is a cell that holds a value calculated from the adjustables Constraint is a cell that holds a value that constraints the Cell Reference. <=, =, => is the sense of the constraint. Choose one. In the Transportation spreadsheet for example, G9 is the total volume shipped out of Amsterdam In the Transportation spreadsheet for example, H9 is the total volume we can ship out of Amsterdam Spring 02 Vande Vate 8 <= in this case. Don’t ship more than we have in AMS
9
What are the Constraints?
Supply Constraints Amsterdam: G9 <= H9 Antwerp: G10 <= H10 The Hague: G11 <= H11 Demand Constraints Leipzig: C12 => C13 Nancy: D12 => D13 Liege: E12 => E13 Tilburg: F12 => F13 G9 is the total volume shipped from Amsterdam Short cut: G9:G11 <= H9:H11 C12 is the total volume shipped to Leipzig Short cut: C12:F12 => C13:F13 Spring 02 Vande Vate 9
10
The Model $G$9 <= $H$9 Spring 02 Vande Vate 10
11
What’s Missing? Spring 02 Vande Vate 11
12
Options Spring 02 Vande Vate 12
13
Multiple Products Same costs Different products Different supply
Different Demand 500 800 700 400 900 200 * Belgium Germany Netherlands The Hague Amsterdam Antwerp Nancy Liege Tilburg Leipzig Miles 100 50 Product 1 Product 2 800 500 800 500 500 400 300 400 700 500 200 200 900 500 Spring 02 Vande Vate 13
14
Question Can we just combine the products: The Hague Tilburg
Total Supply at each source Total Demand at each destination The Hague Total Supply: 1,100 = Tilburg Total Demand: 1,000 = Spring 02 Vande Vate 14
15
Question Can we just solve two separate problems:
One Problem for Product 1 One Problem for Product 2? Spring 02 Vande Vate 15
16
Question Can we just solve two separate problems:
One Problem for Product 1 One Problem for Product 2? When won’t this work? Different Costs? Capacities on Transportation ... Spring 02 Vande Vate 16
17
Shared Capacities Spring 02 Vande Vate 17
18
Transshipments 2 PRODUCTS 3 plants 2 distribution centers 2 customers
Minimize shipping costs Spring 02 Vande Vate 18
19
Challenge Formulate a model Spring 02 Vande Vate 19
20
Flow Conservation Conserve Flow at the DC Otherwise…
Product by Product Otherwise… Alchemy: Turn lead into gold Spring 02 Vande Vate 20
21
AMPL Model set PRODUCTS; set PLANTS; set DCS; set CUSTS;
set EDGES within (PLANTS cross DCS) union (DCS cross CUSTS); param Supply{PRODUCTS, PLANTS}; param Demand{PRODUCTS, CUSTS}; param Cost{EDGES}; param Capacity{EDGES}; Spring 02 Vande Vate 21
22
var Flow{PRODUCTS, EDGES} >= 0; minimize TotalCost:
sum {p in PRODUCTS, (f, t) in EDGES} Cost[f,t]*Flow[p, f, t]; s.t. ObserveSupply {prd in PRODUCTS, plant in PLANTS}: sum {(plant, toloc) in EDGES} Flow[prd, plant, toloc] <= Supply[prd, plant]; s.t. MeetDemand{prd in PRODUCTS, cust in CUSTS}: sum{(fromloc, cust) in EDGES} Flow[prd, fromloc, cust] >= Demand[prd, cust]; s.t. ConserveFlow{prd in PRODUCTS, dc in DCS}: sum{(fromloc, dc) in EDGES} Flow[prd, fromloc, dc] = sum{(dc, toloc) in EDGES} Flow[prd, dc, toloc]; s.t. JointCapacity{ (fromloc, toloc) in EDGES}: sum{prd in PRODUCTS} Flow[prd, fromloc, toloc] <= Capacity[fromloc, toloc]; Spring 02 Vande Vate 22
23
Weight & Cube More realistic version of “shared capacity”
Product 1: 10 lbs/unit 1 cubic ft/unit Pay by Truckload Weight Limit: 4,000 lbs Cubic Capacity: 1,000 Cu. Ft. Joint demands on transportation capacity Product 2: 1 lbs/unit 10 cubic ft/unit Spring 02 Vande Vate 23
24
Weight & Cube How many vehicles? Spring 02 Vande Vate 24
25
Modeling Weight & Cube The number of vehicles required is…
The larger of the number required for the weight and for the cube Conveyances = Max(TotalWeight/WeightLimit, TotalCube/CubeCap) Spring 02 Vande Vate 25
26
Challenge Formulate a model Do NOT use MAX
Spring 02 Vande Vate 26
27
More Detail Container at a port Container at a distribution center
Conserve flow of containers Goods in the containers don’t change Conserve flow of goods Loads change from in-bound to outbound Spring 02 Vande Vate 27
28
Challenge Formulate a model with Transloading at DC
Spring 02 Vande Vate 28
29
Without Transloading Same number of conveyances in and out
Same products in those conveyances Lose potential to improve capacity utilization How to model? Spring 02 Vande Vate 29
30
Flows on Paths Product 1 from Plant 1 to Customer 1 via DC 1
Spring 02 Vande Vate 30
31
Challenge Formulate a model WITHOUT Transloading at the DC
Spring 02 Vande Vate 31
32
AMPL Model set PLANTS; set DCS; set CUSTS; set PRODS;
set EDGES := (PLANTS cross DCS) union (DCS cross CUSTS); param Cost{EDGES}; param Weight{PRODS}; param Cube{PRODS}; param Supply {PRODS, PLANTS} default 0; param Demand {PRODS, CUSTS} default 0; param WeightLimit; param CubicCapacity; Spring 02 Vande Vate 32
33
var PathFlow {PRODS, PLANTS, DCS, CUSTS} >= 0;
var Conveys{PLANTS, DCS, CUSTS} >= 0; minimize FreightCost: sum{plant in PLANTS, dc in DCS, cust in CUSTS} (Cost[plant, dc] + Cost[dc, cust])*Conveys[plant, dc, cust]; s.t. ObserveSupply {prd in PRODS, plant in PLANTS}: sum{dc in DCS, cust in CUSTS} PathFlow[prd, plant, dc, cust] <= Supply[prd, plant]; s.t. MeetDemand {prd in PRODS, cust in CUSTS}: sum{dc in DCS, plant in PLANTS} PathFlow[prd, plant, dc, cust] >= Demand[prd, cust]; Spring 02 Vande Vate 33
34
AMPL Model s.t. ConveysByWeight {plant in PLANTS, dc in DCS, cust in CUSTS}: sum{prd in PRODS} Weight[prd]*PathFlow[prd, plant, dc, cust] <= Conveys[plant, dc, cust]*WeightLimit; s.t. ConveysByCube {plant in PLANTS, dc in DCS, cust in CUSTS}: sum{prd in PRODS} Cube[prd]*PathFlow[prd, plant, dc, cust] <= Conveys[plant, dc, cust]*CubicCapacity; Spring 02 Vande Vate 34
35
Other Uses Additional Information about the products history
Where it was made for Duties Pipeline Inventory How long it has been traveling … Extreme cases: very long involved paths Spring 02 Vande Vate 35
36
Column Generation Airlines Crew Scheduling
Complex pay and duty rules Unions FAA Tour of duty for a crew Several legs returning to base Millions of possible tours of duty Each is a variable: 1 = use it in schedule 0 = do not. Spring 02 Vande Vate 36
37
Solution Strategy Initial Tours of Duty Repeat until Done
Used in previous solutions Fillers to ensure feasibility Repeat until Done Solve small problem Use Shadow Prices to generate new tours that will improve solution When no better tours are found -- done Spring 02 Vande Vate 37
38
Column Generation Example
Multicommodity Flow Spring 02 Vande Vate 38
39
Traditional Model Minimize S S cij xkij
s.t. Sj xkij – Sj xkji = {0, supply, -demand s.t. Sk xkij capacityij xkij 0 xkij is the volume of commodity k we send directly from node i to node j Spring 02 Vande Vate 39
40
This is the sum over all the paths for commodity k
Flow on Paths Model This is the sum over all the paths for commodity k Pk is the set of paths from the source for commodity k to the destination. xp is the flow on path p cp is the cost of one unit of flow on path p For simplicity assume each commodity has a unique source and a unique destination Minimize S cp xp s.t. S xp = supply for commodity k s.t. S xp capacity of edge (i,j) xp 0 This is the sum over all the paths that cross edge (i,j) Spring 02 Vande Vate 40
41
Flows On Paths Formulation
Variable for Product 1: Each path from 1 to 5 Product 2: Each path from 2 to 4 Constraints: Capacity on each edge: Sum of flows on paths that use the edge do not exceed capacity of the edge Cost: Each unit of flow on a path pays the cost of all the edges on the path Why no Flow Conservation Constraints? Spring 02 Vande Vate 41
42
Column Generation Approach
Start with 2 paths Product 1: The edge from 1 to 5 Product 2: The edge from 2 to 4 Solve and get Shadow Prices on the capacity constraints Calculate new (shortest) paths with the best reduced costs Repeat. Spring 02 Vande Vate 42
43
Quick LP review Is there a path whose revised cost is less than the price for the commodity A solution is optimal if no variable is a candidate to enter the basis. That is if no variable prices out so that increasing the variable decreases the solution cost. To price out a variable, compare its cost with the resources it consumes cp - S shadow prices*coefficents < 0 cp - S shadow prices on edges of P – price for the commodity’s demand constraint Spring 02 Vande Vate 43
44
Column Generation Example
Multicommodity Flow Spring 02 Vande Vate 44
45
AMPL Commands In AMPL Modeling languages do more than model.
They also drive the solver. ColumnGeneration.mod Spring 02 Vande Vate 45
46
Summary Conserve Flow at lowest level of detail
Distinction between transloading and container handling Involves additional information in “Edges”, e.g., what port it passed through Extreme cases: Additional information is the entire path Very Technical: Column Generation can handle these cases (sometimes). Spring 02 Vande Vate 46
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.