Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 88 to 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]()
![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |*FORM FIELD ComputationalModel*|ComputationalModel|<--/twistyPlugin twikiMakeVisibleInline-->
We can use the AMPL model file transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 . . . Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow; <--/twistyPlugin-->| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | |*FORM FIELD ComputationalModel*|ComputationalModel|<--/twistyPlugin twikiMakeVisibleInline-->
We can use the AMPL model file transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 . . . Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow; <--/twistyPlugin--> <--/twistyPlugin twikiMakeVisibleInline-->
We can define the PuLP/Dippy model using functions in transshipment_funcy.py
<--/twistyPlugin-->| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|*FORM FIELD Results*|Results|Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node (see with arcs to all the demand nodes. The optimal solution will show the "best" nodes to send the extra supply to.
|
|*FORM FIELD Conclusions*|Conclusions|In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
![]()
|
Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 88 to 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]()
![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |*FORM FIELD ComputationalModel*|ComputationalModel|We can use the AMPL model file transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 . . . Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow;| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | |*FORM FIELD ComputationalModel*|ComputationalModel|<--/twistyPlugin twikiMakeVisibleInline-->
We can use the AMPL model file transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 . . . Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow; <--/twistyPlugin-->| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|*FORM FIELD Results*|Results|Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node (see with arcs to all the demand nodes. The optimal solution will show the "best" nodes to send the extra supply to.
|
|*FORM FIELD Conclusions*|Conclusions|In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
![]()
|
Line: 1 to 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 86 to 86 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |*FORM FIELD ProblemDescription*|ProblemDescription|American Steel, an Ohio-based steel manufacturing company, produces steel at its two steel mills located at Youngstown and Pittsburgh. The company distributes finished steel to its retail customers through the distribution network of regional and field warehouses shown below:
![]()
![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | |*FORM FIELD ProblemDescription*|ProblemDescription|American Steel, an Ohio-based steel manufacturing company, produces steel at its two steel mills located at Youngstown and Pittsburgh. The company distributes finished steel to its retail customers through the distribution network of regional and field warehouses shown below:
![]()
![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|*FORM FIELD ComputationalModel*|ComputationalModel|We can use the AMPL model file transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 . . . Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow;| |*FORM FIELD Results*|Results|Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node (see with arcs to all the demand nodes. The optimal solution will show the "best" nodes to send the extra supply to.
|
|*FORM FIELD Conclusions*|Conclusions|In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
![]() |
Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 88 to 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]()
![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |*FORM FIELD ComputationalModel*|ComputationalModel|We can use the AMPL model file transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow;| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | |*FORM FIELD ComputationalModel*|ComputationalModel|We can use the AMPL model file transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 . . . Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow;| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|*FORM FIELD Results*|Results|Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node (see with arcs to all the demand nodes. The optimal solution will show the "best" nodes to send the extra supply to.
|
|*FORM FIELD Conclusions*|Conclusions|In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
![]()
|
Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | |||||||||||||||||||||||||||||||||||||||||||||||||
Line: 80 to 80 | |||||||||||||||||||||||||||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||
Line: 93 to 90 | |||||||||||||||||||||||||||||||||||||||||||||||||
|*FORM FIELD ProblemFormulation*|ProblemFormulation|The American Steel Problem can be solved as a transshipment problem. The supply at the supply nodes is the maximum production at the steel mills, i.e., 10,000 and 15,000 for Youngstown and Pittsburgh repsectively. The demand at demand nodes in given by the demand at the field warehouses and the other nodes are transshipment nodes. The costs and bounds on flow through the network are also given. The most compact formulation for this problem is a network formulation (see The Transshipment Problem for details).
![]() transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow;| |*FORM FIELD Results*|Results|Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node (see with arcs to all the demand nodes. The optimal solution will show the "best" nodes to send the extra supply to.
| | |||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||
< < | |*FORM FIELD Conclusions*|Conclusions|In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
| ||||||||||||||||||||||||||||||||||||||||||||||||
> > | |*FORM FIELD Conclusions*|Conclusions|In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
![]() | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Line: 1 to 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | ||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 80 to 80 | ||||||||||||||||||||||||||||||||||||||||||||||||||
Added: | ||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
| |||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 90 to 93 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|*FORM FIELD ProblemFormulation*|ProblemFormulation|The American Steel Problem can be solved as a transshipment problem. The supply at the supply nodes is the maximum production at the steel mills, i.e., 10,000 and 15,000 for Youngstown and Pittsburgh repsectively. The demand at demand nodes in given by the demand at the field warehouses and the other nodes are transshipment nodes. The costs and bounds on flow through the network are also given. The most compact formulation for this problem is a network formulation (see The Transshipment Problem for details).
![]() transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow;| |*FORM FIELD Results*|Results|Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node (see with arcs to all the demand nodes. The optimal solution will show the "best" nodes to send the extra supply to.
| | ||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |*FORM FIELD Conclusions*|Conclusions|In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
| |||||||||||||||||||||||||||||||||||||||||||||||||
> > | |*FORM FIELD Conclusions*|Conclusions|In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
| |||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Added: | ||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
| |||||||||||||||||||||||||||||||||||||||||||||||||
|
Line: 1 to 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 89 to 89 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|*FORM FIELD ProblemDescription*|ProblemDescription|American Steel, an Ohio-based steel manufacturing company, produces steel at its two steel mills located at Youngstown and Pittsburgh. The company distributes finished steel to its retail customers through the distribution network of regional and field warehouses shown below:
![]()
![]() transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow;| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |*FORM FIELD Results*|Results|Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node (see with arcs to all the demand nodes. The optimal solution will show the "best" nodes to send the extra supply to.
|
|*FORM FIELD Conclusions*|Conclusions|In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | |*FORM FIELD Results*|Results|Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node (see with arcs to all the demand nodes. The optimal solution will show the "best" nodes to send the extra supply to.
|
|*FORM FIELD Conclusions*|Conclusions|In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Line: 1 to 1 | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | ||||||||||||||||||||||||||||||||||||
Line: 90 to 90 | ||||||||||||||||||||||||||||||||||||
|*FORM FIELD ProblemFormulation*|ProblemFormulation|The American Steel Problem can be solved as a transshipment problem. The supply at the supply nodes is the maximum production at the steel mills, i.e., 10,000 and 15,000 for Youngstown and Pittsburgh repsectively. The demand at demand nodes in given by the demand at the field warehouses and the other nodes are transshipment nodes. The costs and bounds on flow through the network are also given. The most compact formulation for this problem is a network formulation (see The Transshipment Problem for details).
![]() transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow;| |*FORM FIELD Results*|Results|Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node (see with arcs to all the demand nodes. The optimal solution will show the "best" nodes to send the extra supply to.
| | ||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||
< < | |*FORM FIELD Conclusions*|Conclusions|In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
| |||||||||||||||||||||||||||||||||||
> > | |*FORM FIELD Conclusions*|Conclusions|In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
| |||||||||||||||||||||||||||||||||||
|
Line: 1 to 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 86 to 86 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |*FORM FIELD ProblemDescription*|ProblemDescription|American Steel, an Ohio-based steel manufacturing company, produces steel at its two steel mills located at Youngstown and Pittsburgh. The company distributes finished steel to its retail customers through the distribution network of regional and field warehouses shown below:
![]()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | |*FORM FIELD ProblemDescription*|ProblemDescription|American Steel, an Ohio-based steel manufacturing company, produces steel at its two steel mills located at Youngstown and Pittsburgh. The company distributes finished steel to its retail customers through the distribution network of regional and field warehouses shown below:
![]()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|*FORM FIELD ProblemFormulation*|ProblemFormulation|The American Steel Problem can be solved as a transshipment problem. The supply at the supply nodes is the maximum production at the steel mills, i.e., 10,000 and 15,000 for Youngstown and Pittsburgh repsectively. The demand at demand nodes in given by the demand at the field warehouses and the other nodes are transshipment nodes. The costs and bounds on flow through the network are also given. The most compact formulation for this problem is a network formulation (see The Transshipment Problem for details).
![]() transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow;| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |*FORM FIELD Results*|Results|Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node with arcs to all the demand nodes. ??? Up to here??? The optimal solution will show which nodes are "best" to get extra supply for to find the "best" nodes to t to get extrato see where we should , then the problem becomes infeasible! Even in the case of infeasibility, it is preferable to solve the transshipment problem using a dummy supply node so that we can analyse where there is a shortfall in demand. We can balance the problem by either adding a dummy supply node with arcs to all the demand nodes or adding a dummy demand node with arcs from all the supply nodes:
balance_transshipment.mod
# The following parameters are needed to use balance_transshipment.run param difference; param dummyDemandCost {NODES}; param dummySupplyCost {NODES};balance_transshipment.run let difference := (sum {s in NODES} Supply[s]) - (sum {d in NODES} Demand[d]); let NODES := NODES union {'Dummy'}; if difference > 0 then { print "Total Supply > Total Demand"; print "Solving with dummy supply node..."; let Demand['Dummy'] := difference; for {n in NODES : Supply[n] > 0} { let ARCS := ARCS union {(n, 'Dummy')}; let Cost[n, 'Dummy'] := dummyDemandCost[n]; } } else if difference < 0 then { print "WARNING: Total Supply < Total Demand, problem is infeasible!"; print "Solving with dummy demand node..."; let Demand['Dummy'] := - difference; for {n in NODES : Demand[n] > 0} { let ARCS := ARCS union {('Dummy', n)}; let Cost['Dummy', n] := dummySupplyCost[n]; } }; # else the problem is balancedsteel.run # steel.run # # Written by Mike O'Sullivan & Cameron Walker 2004 # # This file contains a script for sensitivity analysis # of the American Steel transshipment model. # # Last modified: 27/2/2004 reset; model transshipment.mod; model balance_transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; for {n in NODES} { let dummyDemandCost[n] := 0; let dummySupplyCost[n] := 0; } include balance_transshipment.run; option solver cplex; solve; display Flow;Note We also add a ???LINK??? check statement to our model file to ensure the problem is balanced:
check : sum {n in NODES} Supply[n] = sum {n in NODES} Demand[n];Our solution now shows that there is 5000 ton of steel remaining at the Pittsburgh Mill, i.e., the flow from Pittsburgh to Dummy is 5000.
POST-OPTIMAL ANALYSIS
Validation
For our solution to be valid we need it to be integer. Observing the Flow values shows that it is in fact integer. Moreover, no branch-and-bound nodes were required to make it integer. The transshipment problem is also naturally integer (like the transportation problem), so solving it as a linear programme will give integer solutions. In fact, any network flow problem with integer supplies, demands and arc capacities has naturally integer solutions.
Parametric Analysis
If ???LINK??? sensitivity analysis shows that improvements to the objective
function may be achieved by changing problem data, then we may use ???LINK??? parametric analysis to see the effect of these changes.
. . . include balance_transshipment.run; option presolve 0; option solver cplex; option cplex_options 'presolve 0 sensitivity'; solve; display Flow; display _varname, _var.down, _var.current, _var.up, _var.rc; display _conname, _con.down, _con.current, _con.up, _con.dual; ![]() ConserverFlow at Pittsburgh . However, we have variables on both sides of our constraints so we should expand our constraints to see what the right-hand side is:
![]() ConserveFlow['Pittsburgh'] can decrease without affecting our solution. Since Pittsburgh is a supply node (so the right-hand side is the negative of the supply) this means we can increase the supply at Pittsburgh without affecting our solution. This makes sense as Pittsburgh already has excess supply.
However, it seems like we can improve our objective the most by decreasing the demand at Tempe (the shadow price is 1.125), but the Allowable Minimum is such that we cannot discern what the change will be (the solution will change immediately). We can see the effect by using an ???LINK??? AMPL loop :
. . . display TotalCost; set CHANGES; param Objective {CHANGES}; param OldDemand; let OldDemand := Demand['Tempe']; let CHANGES := {100..1000 by 100}; for {i in CHANGES} { let Demand['Tempe'] := OldDemand - i; display Demand['Tempe']; # Rebalance the problem include balance_transshipment.run; solve; let Objective[i] := TotalCost; } ![]() balance_transshipment.run to consider problems that have been balanced previously:
balance_transshipment.run
let difference := (sum {s in NODES : s <> 'Dummy'} Supply[s]) - (sum {d in NODES : d <> 'Dummy'} Demand[d]); if 'Dummy' not in NODES then let NODES := NODES union {'Dummy'}; if difference > 0 then { print "Total Supply > Total Demand"; print "Solving with dummy supply node..."; let Demand['Dummy'] := difference; for {n in NODES : Supply[n] > 0} { let ARCS := ARCS union {(n, 'Dummy')}; let Cost[n, 'Dummy'] := dummyDemandCost[n]; } } else if difference < 0 then { print "WARNING: Total Supply < Total Demand, problem is infeasible!"; print "Solving with dummy demand node..."; let Demand['Dummy'] := - difference; for {n in NODES : Demand[n] > 0} { let ARCS := ARCS union {('Dummy', n)}; let Cost['Dummy', n] := dummySupplyCost[n]; } }; # else the problem is balancedThe AMPL parametric analysis shows that, by decreasing the demand for steel at Tempe, we can get a consistent reduction in our objective function, even though this was not clear from our initial sensitivity analysis. When we consider the sensitvity analysis for variable costs, we see that the only costs that affect our solution are the transportation costs from Pittsburgh and Youngstown to Chicago (all the other costs have Allowable Min and Allowable Max such that no "sensible" change would have any effect). Suppose American Steel are negotiating a new contract with the shipping company that takes their steel from Pittsburgh to Chicago. They estimate that they can get a reduction of around \$25/1000 ton of steel (taking the price from \$400/1000 ton to \$375/1000 ton), but want to know if they should negotiate for a lower price. The sensitivity analysis shows that below \$375/1000 ton the solution will change, so let's use parametric analysis to see what happens: . . . display TotalCost; set CHANGES; param Objective {CHANGES}; param OldCost; let OldCost := Cost['Pittsburgh', 'Chicago']; let CHANGES := {0..0.05 by 0.005}; for {i in CHANGES} { let Cost['Pittsburgh', 'Chicago'] := OldCost - i; display Cost['Pittsburgh', 'Chicago']; # Rebalance the problem include balance_transshipment.run; solve; let Objective[i] := TotalCost; }The parametric analysis shows that the objective function decreases at a greater rate if the price drops below $375/1000 ton, so American Steel should try and negotiate the price down even further. ![]()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | |*FORM FIELD Results*|Results|Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node (see with arcs to all the demand nodes. The optimal solution will show the "best" nodes to send the extra supply to.
|
|*FORM FIELD Conclusions*|Conclusions|In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Line: 1 to 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 89 to 89 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|*FORM FIELD ProblemDescription*|ProblemDescription|American Steel, an Ohio-based steel manufacturing company, produces steel at its two steel mills located at Youngstown and Pittsburgh. The company distributes finished steel to its retail customers through the distribution network of regional and field warehouses shown below:
![]()
![]() transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow;| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |*FORM FIELD Results*|Results|Implementing the usual script file with transshipment.mod and steel.dat (with the Cost modification) gives us the optimal Flow variables:
![]() # The following parameters are needed to use balance_transshipment.run param difference; param dummyDemandCost {NODES}; param dummySupplyCost {NODES};balance_transshipment.run let difference := (sum {s in NODES} Supply[s]) - (sum {d in NODES} Demand[d]); let NODES := NODES union {'Dummy'}; if difference > 0 then { print "Total Supply > Total Demand"; print "Solving with dummy supply node..."; let Demand['Dummy'] := difference; for {n in NODES : Supply[n] > 0} { let ARCS := ARCS union {(n, 'Dummy')}; let Cost[n, 'Dummy'] := dummyDemandCost[n]; } } else if difference < 0 then { print "WARNING: Total Supply < Total Demand, problem is infeasible!"; print "Solving with dummy demand node..."; let Demand['Dummy'] := - difference; for {n in NODES : Demand[n] > 0} { let ARCS := ARCS union {('Dummy', n)}; let Cost['Dummy', n] := dummySupplyCost[n]; } }; # else the problem is balancedsteel.run # steel.run # # Written by Mike O'Sullivan & Cameron Walker 2004 # # This file contains a script for sensitivity analysis # of the American Steel transshipment model. # # Last modified: 27/2/2004 reset; model transshipment.mod; model balance_transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; for {n in NODES} { let dummyDemandCost[n] := 0; let dummySupplyCost[n] := 0; } include balance_transshipment.run; option solver cplex; solve; display Flow;Note We also add a ???LINK??? check statement to our model file to ensure the problem is balanced:
check : sum {n in NODES} Supply[n] = sum {n in NODES} Demand[n];Our solution now shows that there is 5000 ton of steel remaining at the Pittsburgh Mill, i.e., the flow from Pittsburgh to Dummy is 5000.
POST-OPTIMAL ANALYSIS
Validation
For our solution to be valid we need it to be integer. Observing the Flow values shows that it is in fact integer. Moreover, no branch-and-bound nodes were required to make it integer. The transshipment problem is also naturally integer (like the transportation problem), so solving it as a linear programme will give integer solutions. In fact, any network flow problem with integer supplies, demands and arc capacities has naturally integer solutions.
Parametric Analysis
If ???LINK??? sensitivity analysis shows that improvements to the objective
function may be achieved by changing problem data, then we may use ???LINK??? parametric analysis to see the effect of these changes.
. . . include balance_transshipment.run; option presolve 0; option solver cplex; option cplex_options 'presolve 0 sensitivity'; solve; display Flow; display _varname, _var.down, _var.current, _var.up, _var.rc; display _conname, _con.down, _con.current, _con.up, _con.dual; ![]() ConserverFlow at Pittsburgh . However, we have variables on both sides of our constraints so we should expand our constraints to see what the right-hand side is:
![]() ConserveFlow['Pittsburgh'] can decrease without affecting our solution. Since Pittsburgh is a supply node (so the right-hand side is the negative of the supply) this means we can increase the supply at Pittsburgh without affecting our solution. This makes sense as Pittsburgh already has excess supply.
However, it seems like we can improve our objective the most by decreasing the demand at Tempe (the shadow price is 1.125), but the Allowable Minimum is such that we cannot discern what the change will be (the solution will change immediately). We can see the effect by using an ???LINK??? AMPL loop :
. . . display TotalCost; set CHANGES; param Objective {CHANGES}; param OldDemand; let OldDemand := Demand['Tempe']; let CHANGES := {100..1000 by 100}; for {i in CHANGES} { let Demand['Tempe'] := OldDemand - i; display Demand['Tempe']; # Rebalance the problem include balance_transshipment.run; solve; let Objective[i] := TotalCost; } ![]() balance_transshipment.run to consider problems that have been balanced previously:
balance_transshipment.run
let difference := (sum {s in NODES : s <> 'Dummy'} Supply[s]) - (sum {d in NODES : d <> 'Dummy'} Demand[d]); if 'Dummy' not in NODES then let NODES := NODES union {'Dummy'}; if difference > 0 then { print "Total Supply > Total Demand"; print "Solving with dummy supply node..."; let Demand['Dummy'] := difference; for {n in NODES : Supply[n] > 0} { let ARCS := ARCS union {(n, 'Dummy')}; let Cost[n, 'Dummy'] := dummyDemandCost[n]; } } else if difference < 0 then { print "WARNING: Total Supply < Total Demand, problem is infeasible!"; print "Solving with dummy demand node..."; let Demand['Dummy'] := - difference; for {n in NODES : Demand[n] > 0} { let ARCS := ARCS union {('Dummy', n)}; let Cost['Dummy', n] := dummySupplyCost[n]; } }; # else the problem is balancedThe AMPL parametric analysis shows that, by decreasing the demand for steel at Tempe, we can get a consistent reduction in our objective function, even though this was not clear from our initial sensitivity analysis. When we consider the sensitvity analysis for variable costs, we see that the only costs that affect our solution are the transportation costs from Pittsburgh and Youngstown to Chicago (all the other costs have Allowable Min and Allowable Max such that no "sensible" change would have any effect). Suppose American Steel are negotiating a new contract with the shipping company that takes their steel from Pittsburgh to Chicago. They estimate that they can get a reduction of around \$25/1000 ton of steel (taking the price from \$400/1000 ton to \$375/1000 ton), but want to know if they should negotiate for a lower price. The sensitivity analysis shows that below \$375/1000 ton the solution will change, so let's use parametric analysis to see what happens: . . . display TotalCost; set CHANGES; param Objective {CHANGES}; param OldCost; let OldCost := Cost['Pittsburgh', 'Chicago']; let CHANGES := {0..0.05 by 0.005}; for {i in CHANGES} { let Cost['Pittsburgh', 'Chicago'] := OldCost - i; display Cost['Pittsburgh', 'Chicago']; # Rebalance the problem include balance_transshipment.run; solve; let Objective[i] := TotalCost; }The parametric analysis shows that the objective function decreases at a greater rate if the price drops below $375/1000 ton, so American Steel should try and negotiate the price down even further. ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | |*FORM FIELD Results*|Results|Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node with arcs to all the demand nodes. ??? Up to here??? The optimal solution will show which nodes are "best" to get extra supply for to find the "best" nodes to t to get extrato see where we should , then the problem becomes infeasible! Even in the case of infeasibility, it is preferable to solve the transshipment problem using a dummy supply node so that we can analyse where there is a shortfall in demand. We can balance the problem by either adding a dummy supply node with arcs to all the demand nodes or adding a dummy demand node with arcs from all the supply nodes:
balance_transshipment.mod
# The following parameters are needed to use balance_transshipment.run param difference; param dummyDemandCost {NODES}; param dummySupplyCost {NODES};balance_transshipment.run let difference := (sum {s in NODES} Supply[s]) - (sum {d in NODES} Demand[d]); let NODES := NODES union {'Dummy'}; if difference > 0 then { print "Total Supply > Total Demand"; print "Solving with dummy supply node..."; let Demand['Dummy'] := difference; for {n in NODES : Supply[n] > 0} { let ARCS := ARCS union {(n, 'Dummy')}; let Cost[n, 'Dummy'] := dummyDemandCost[n]; } } else if difference < 0 then { print "WARNING: Total Supply < Total Demand, problem is infeasible!"; print "Solving with dummy demand node..."; let Demand['Dummy'] := - difference; for {n in NODES : Demand[n] > 0} { let ARCS := ARCS union {('Dummy', n)}; let Cost['Dummy', n] := dummySupplyCost[n]; } }; # else the problem is balancedsteel.run # steel.run # # Written by Mike O'Sullivan & Cameron Walker 2004 # # This file contains a script for sensitivity analysis # of the American Steel transshipment model. # # Last modified: 27/2/2004 reset; model transshipment.mod; model balance_transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; for {n in NODES} { let dummyDemandCost[n] := 0; let dummySupplyCost[n] := 0; } include balance_transshipment.run; option solver cplex; solve; display Flow;Note We also add a ???LINK??? check statement to our model file to ensure the problem is balanced:
check : sum {n in NODES} Supply[n] = sum {n in NODES} Demand[n];Our solution now shows that there is 5000 ton of steel remaining at the Pittsburgh Mill, i.e., the flow from Pittsburgh to Dummy is 5000.
POST-OPTIMAL ANALYSIS
Validation
For our solution to be valid we need it to be integer. Observing the Flow values shows that it is in fact integer. Moreover, no branch-and-bound nodes were required to make it integer. The transshipment problem is also naturally integer (like the transportation problem), so solving it as a linear programme will give integer solutions. In fact, any network flow problem with integer supplies, demands and arc capacities has naturally integer solutions.
Parametric Analysis
If ???LINK??? sensitivity analysis shows that improvements to the objective
function may be achieved by changing problem data, then we may use ???LINK??? parametric analysis to see the effect of these changes.
. . . include balance_transshipment.run; option presolve 0; option solver cplex; option cplex_options 'presolve 0 sensitivity'; solve; display Flow; display _varname, _var.down, _var.current, _var.up, _var.rc; display _conname, _con.down, _con.current, _con.up, _con.dual; ![]() ConserverFlow at Pittsburgh . However, we have variables on both sides of our constraints so we should expand our constraints to see what the right-hand side is:
![]() ConserveFlow['Pittsburgh'] can decrease without affecting our solution. Since Pittsburgh is a supply node (so the right-hand side is the negative of the supply) this means we can increase the supply at Pittsburgh without affecting our solution. This makes sense as Pittsburgh already has excess supply.
However, it seems like we can improve our objective the most by decreasing the demand at Tempe (the shadow price is 1.125), but the Allowable Minimum is such that we cannot discern what the change will be (the solution will change immediately). We can see the effect by using an ???LINK??? AMPL loop :
. . . display TotalCost; set CHANGES; param Objective {CHANGES}; param OldDemand; let OldDemand := Demand['Tempe']; let CHANGES := {100..1000 by 100}; for {i in CHANGES} { let Demand['Tempe'] := OldDemand - i; display Demand['Tempe']; # Rebalance the problem include balance_transshipment.run; solve; let Objective[i] := TotalCost; } ![]() balance_transshipment.run to consider problems that have been balanced previously:
balance_transshipment.run
let difference := (sum {s in NODES : s <> 'Dummy'} Supply[s]) - (sum {d in NODES : d <> 'Dummy'} Demand[d]); if 'Dummy' not in NODES then let NODES := NODES union {'Dummy'}; if difference > 0 then { print "Total Supply > Total Demand"; print "Solving with dummy supply node..."; let Demand['Dummy'] := difference; for {n in NODES : Supply[n] > 0} { let ARCS := ARCS union {(n, 'Dummy')}; let Cost[n, 'Dummy'] := dummyDemandCost[n]; } } else if difference < 0 then { print "WARNING: Total Supply < Total Demand, problem is infeasible!"; print "Solving with dummy demand node..."; let Demand['Dummy'] := - difference; for {n in NODES : Demand[n] > 0} { let ARCS := ARCS union {('Dummy', n)}; let Cost['Dummy', n] := dummySupplyCost[n]; } }; # else the problem is balancedThe AMPL parametric analysis shows that, by decreasing the demand for steel at Tempe, we can get a consistent reduction in our objective function, even though this was not clear from our initial sensitivity analysis. When we consider the sensitvity analysis for variable costs, we see that the only costs that affect our solution are the transportation costs from Pittsburgh and Youngstown to Chicago (all the other costs have Allowable Min and Allowable Max such that no "sensible" change would have any effect). Suppose American Steel are negotiating a new contract with the shipping company that takes their steel from Pittsburgh to Chicago. They estimate that they can get a reduction of around \$25/1000 ton of steel (taking the price from \$400/1000 ton to \$375/1000 ton), but want to know if they should negotiate for a lower price. The sensitivity analysis shows that below \$375/1000 ton the solution will change, so let's use parametric analysis to see what happens: . . . display TotalCost; set CHANGES; param Objective {CHANGES}; param OldCost; let OldCost := Cost['Pittsburgh', 'Chicago']; let CHANGES := {0..0.05 by 0.005}; for {i in CHANGES} { let Cost['Pittsburgh', 'Chicago'] := OldCost - i; display Cost['Pittsburgh', 'Chicago']; # Rebalance the problem include balance_transshipment.run; solve; let Objective[i] := TotalCost; }The parametric analysis shows that the objective function decreases at a greater rate if the price drops below $375/1000 ton, so American Steel should try and negotiate the price down even further. ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|*FORM FIELD Conclusions*|Conclusions|There is quite a bit of information to summarise and many ways to present it. Some suggestions include:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |*FORM FIELD ExtraForExperts*|ExtraForExperts|Another common network flow problem that uses almost the same model as transshipment is the maximum flow problem. The objective of this problem is to maximise flow through the network. The only changes to transshipment.mod are:
MaxOut to Demand for all nodes:
let {n in NODES} MaxOut[n] := Demand[n];then we see that currently all the demands are being met via the American Steel distribution network (the total flow out = the total demand): ![]()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Line: 1 to 1 | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | |||||||||||||||||||
Line: 93 to 93 | |||||||||||||||||||
|*FORM FIELD Conclusions*|Conclusions|There is quite a bit of information to summarise and many ways to present it. Some suggestions include:
transshipment.mod are:
MaxOut to Demand for all nodes:
let {n in NODES} MaxOut[n] := Demand[n];then we see that currently all the demands are being met via the American Steel distribution network (the total flow out = the total demand): ![]()
| |||||||||||||||||||
Changed: | |||||||||||||||||||
< < |
| ||||||||||||||||||
> > |
| ||||||||||||||||||
|
Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 88 to 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]()
![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |*FORM FIELD ComputationalModel*|ComputationalModel|We can use the AMPL model file transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown 10000 Pittsburgh 15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow;| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | |*FORM FIELD ComputationalModel*|ComputationalModel|We can use the AMPL model file transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow;| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|*FORM FIELD Results*|Results|Implementing the usual script file with transshipment.mod and steel.dat (with the Cost modification) gives us the optimal Flow variables:
![]() # The following parameters are needed to use balance_transshipment.run param difference; param dummyDemandCost {NODES}; param dummySupplyCost {NODES};balance_transshipment.run let difference := (sum {s in NODES} Supply[s]) - (sum {d in NODES} Demand[d]); let NODES := NODES union {'Dummy'}; if difference > 0 then { print "Total Supply > Total Demand"; print "Solving with dummy supply node..."; let Demand['Dummy'] := difference; for {n in NODES : Supply[n] > 0} { let ARCS := ARCS union {(n, 'Dummy')}; let Cost[n, 'Dummy'] := dummyDemandCost[n]; } } else if difference < 0 then { print "WARNING: Total Supply < Total Demand, problem is infeasible!"; print "Solving with dummy demand node..."; let Demand['Dummy'] := - difference; for {n in NODES : Demand[n] > 0} { let ARCS := ARCS union {('Dummy', n)}; let Cost['Dummy', n] := dummySupplyCost[n]; } }; # else the problem is balancedsteel.run # steel.run # # Written by Mike O'Sullivan & Cameron Walker 2004 # # This file contains a script for sensitivity analysis # of the American Steel transshipment model. # # Last modified: 27/2/2004 reset; model transshipment.mod; model balance_transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; for {n in NODES} { let dummyDemandCost[n] := 0; let dummySupplyCost[n] := 0; } include balance_transshipment.run; option solver cplex; solve; display Flow;Note We also add a ???LINK??? check statement to our model file to ensure the problem is balanced:
check : sum {n in NODES} Supply[n] = sum {n in NODES} Demand[n];Our solution now shows that there is 5000 ton of steel remaining at the Pittsburgh Mill, i.e., the flow from Pittsburgh to Dummy is 5000.
POST-OPTIMAL ANALYSIS
Validation
For our solution to be valid we need it to be integer. Observing the Flow values shows that it is in fact integer. Moreover, no branch-and-bound nodes were required to make it integer. The transshipment problem is also naturally integer (like the transportation problem), so solving it as a linear programme will give integer solutions. In fact, any network flow problem with integer supplies, demands and arc capacities has naturally integer solutions.
Parametric Analysis
If ???LINK??? sensitivity analysis shows that improvements to the objective
function may be achieved by changing problem data, then we may use ???LINK??? parametric analysis to see the effect of these changes.
. . . include balance_transshipment.run; option presolve 0; option solver cplex; option cplex_options 'presolve 0 sensitivity'; solve; display Flow; display _varname, _var.down, _var.current, _var.up, _var.rc; display _conname, _con.down, _con.current, _con.up, _con.dual; ![]() ConserverFlow at Pittsburgh . However, we have variables on both sides of our constraints so we should expand our constraints to see what the right-hand side is:
![]() ConserveFlow['Pittsburgh'] can decrease without affecting our solution. Since Pittsburgh is a supply node (so the right-hand side is the negative of the supply) this means we can increase the supply at Pittsburgh without affecting our solution. This makes sense as Pittsburgh already has excess supply.
However, it seems like we can improve our objective the most by decreasing the demand at Tempe (the shadow price is 1.125), but the Allowable Minimum is such that we cannot discern what the change will be (the solution will change immediately). We can see the effect by using an ???LINK??? AMPL loop :
. . . display TotalCost; set CHANGES; param Objective {CHANGES}; param OldDemand; let OldDemand := Demand['Tempe']; let CHANGES := {100..1000 by 100}; for {i in CHANGES} { let Demand['Tempe'] := OldDemand - i; display Demand['Tempe']; # Rebalance the problem include balance_transshipment.run; solve; let Objective[i] := TotalCost; } ![]() balance_transshipment.run to consider problems that have been balanced previously:
balance_transshipment.run
let difference := (sum {s in NODES : s <> 'Dummy'} Supply[s]) - (sum {d in NODES : d <> 'Dummy'} Demand[d]); if 'Dummy' not in NODES then let NODES := NODES union {'Dummy'}; if difference > 0 then { print "Total Supply > Total Demand"; print "Solving with dummy supply node..."; let Demand['Dummy'] := difference; for {n in NODES : Supply[n] > 0} { let ARCS := ARCS union {(n, 'Dummy')}; let Cost[n, 'Dummy'] := dummyDemandCost[n]; } } else if difference < 0 then { print "WARNING: Total Supply < Total Demand, problem is infeasible!"; print "Solving with dummy demand node..."; let Demand['Dummy'] := - difference; for {n in NODES : Demand[n] > 0} { let ARCS := ARCS union {('Dummy', n)}; let Cost['Dummy', n] := dummySupplyCost[n]; } }; # else the problem is balancedThe AMPL parametric analysis shows that, by decreasing the demand for steel at Tempe, we can get a consistent reduction in our objective function, even though this was not clear from our initial sensitivity analysis. When we consider the sensitvity analysis for variable costs, we see that the only costs that affect our solution are the transportation costs from Pittsburgh and Youngstown to Chicago (all the other costs have Allowable Min and Allowable Max such that no "sensible" change would have any effect). Suppose American Steel are negotiating a new contract with the shipping company that takes their steel from Pittsburgh to Chicago. They estimate that they can get a reduction of around \$25/1000 ton of steel (taking the price from \$400/1000 ton to \$375/1000 ton), but want to know if they should negotiate for a lower price. The sensitivity analysis shows that below \$375/1000 ton the solution will change, so let's use parametric analysis to see what happens: . . . display TotalCost; set CHANGES; param Objective {CHANGES}; param OldCost; let OldCost := Cost['Pittsburgh', 'Chicago']; let CHANGES := {0..0.05 by 0.005}; for {i in CHANGES} { let Cost['Pittsburgh', 'Chicago'] := OldCost - i; display Cost['Pittsburgh', 'Chicago']; # Rebalance the problem include balance_transshipment.run; solve; let Objective[i] := TotalCost; }The parametric analysis shows that the objective function decreases at a greater rate if the price drops below $375/1000 ton, so American Steel should try and negotiate the price down even further. ![]()
transshipment.mod are:
MaxOut to Demand for all nodes:
let {n in NODES} MaxOut[n] := Demand[n];then we see that currently all the demands are being met via the American Steel distribution network (the total flow out = the total demand): ![]() |
Line: 1 to 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 87 to 87 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]()
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |*FORM FIELD ProblemFormulation*|ProblemFormulation|The American Steel Problem can be solved as a transshipment problem. The supply at the supply nodes is the maximum production at the steel mills, i.e., 10,000 and 15,000 for Youngstown and Pittsburgh repsectively. The demand at demand nodes in given by the demand at the field warehouses and the other nodes are transshipment nodes. The costs and bounds on flow through the network are also given. The most compact formulation for this problem is a network formulation (see The Transshipment Problem for details).
|
|*FORM FIELD ComputationalModel*|ComputationalModel|nodes and arcs are shown in the network and the net demand is given in [[tab1][Table 1].
Table 1 Net Demand Amounts
Flow of goods (cases of beer in The Beer Distribution Problem, tons of steels here) through the network. In ???LINK??? A Transportation Problem all arcs from the supply nodes to the demand nodes existed (although in ???LINK??? Forestry Management we used upper bounds to removes some arcs). In The American Steel Problem, the network has transshipment nodes and arcs don't exist between all nodes. However, arcs must travel from one node to another. In AMPL we ???LINK??? declare the set of NODES and the set of ARCS between nodes:
# The set of all nodes in the network set NODES; # The set of arcs in the network set ARCS within NODES cross NODES;Now we define bounds on the flow (of our goods) along each arc: # The minimum and maximum flow allowed along the arcs param Min {ARCS} integer, default 0; param Max {(m, n) in ARCS} integer, >= Min[m, n], default Infinity;and finally declare our Flow variables:
# The flow of goods to be sent across an arc var Flow {(m, n) in ARCS} >= Min[m, n], <= Max[m, n], integer;2. FORMULATE THE OBJECTIVE FUNCTION The objective of transshipment problems in general and The American Steel Problem in particular is to minimise the cost of shipping goods through the network: # The cost of shipping 1 unit of goods (per time unit) param Cost {ARCS}; # Minimise the total shipping cost minimize TotalCost: sum {(m, n) in ARCS} Cost[m, n] * Flow[m, n];3. FORMULATE THE CONSTRAINTS All the nodes have supply and demand, demand = 0 for supply nodes, supply = 0 for demand nodes and supply = demand = 0 for transshipment nodes. Also, the supply and demand amounts must be integer to ensure a naturally integer solution (i.e., linear programming will provide an integer optimal solution). # Each node has a (non-negative, integer) supply and a (non-negative, integer) demand # Note. supply nodes have demand = 0 and vice versa, # transshipment nodes have supply = demand = 0 param Supply {NODES} >= 0, integer, default 0; param Demand {NODES} >= 0, integer, default 0;The only constraints in the transshipment problem are flow conservation constraints. These constraints simply state that the flow of goods into a node must be greater than the flow of goods out of a node. # Must conserve flow in the network (goods cannot disappear!) subject to ConserveFlow {n in NODES}: sum {m in NODES: (m, n) in ARCS} Flow[m, n] + Supply[n] => sum {p in NODES: (n, p) in ARCS} Flow[n, p] + Demand[n];For example, if a node has a supply of 10 units and has 10 units flowing in, then it can have no more than 20 units flowing out: ![]() ![]() set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be ???LINK??? defined in a number of different ways :
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ; # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;We can choose lists, tables or arrays to define the parameters for The American Steel Problem, but in this case we will use a list and ???LINK??? define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Min['Youngstown', 'Albany'] ):
param: Cost Min Max:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 before solving: let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000;| | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | |*FORM FIELD ProblemFormulation*|ProblemFormulation|The American Steel Problem can be solved as a transshipment problem. The supply at the supply nodes is the maximum production at the steel mills, i.e., 10,000 and 15,000 for Youngstown and Pittsburgh repsectively. The demand at demand nodes in given by the demand at the field warehouses and the other nodes are transshipment nodes. The costs and bounds on flow through the network are also given. The most compact formulation for this problem is a network formulation (see The Transshipment Problem for details).
![]() transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown 10000 Pittsburgh 15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow;| | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|*FORM FIELD Results*|Results|Implementing the usual script file with transshipment.mod and steel.dat (with the Cost modification) gives us the optimal Flow variables:
![]() # The following parameters are needed to use balance_transshipment.run param difference; param dummyDemandCost {NODES}; param dummySupplyCost {NODES};balance_transshipment.run let difference := (sum {s in NODES} Supply[s]) - (sum {d in NODES} Demand[d]); let NODES := NODES union {'Dummy'}; if difference > 0 then { print "Total Supply > Total Demand"; print "Solving with dummy supply node..."; let Demand['Dummy'] := difference; for {n in NODES : Supply[n] > 0} { let ARCS := ARCS union {(n, 'Dummy')}; let Cost[n, 'Dummy'] := dummyDemandCost[n]; } } else if difference < 0 then { print "WARNING: Total Supply < Total Demand, problem is infeasible!"; print "Solving with dummy demand node..."; let Demand['Dummy'] := - difference; for {n in NODES : Demand[n] > 0} { let ARCS := ARCS union {('Dummy', n)}; let Cost['Dummy', n] := dummySupplyCost[n]; } }; # else the problem is balancedsteel.run # steel.run # # Written by Mike O'Sullivan & Cameron Walker 2004 # # This file contains a script for sensitivity analysis # of the American Steel transshipment model. # # Last modified: 27/2/2004 reset; model transshipment.mod; model balance_transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; for {n in NODES} { let dummyDemandCost[n] := 0; let dummySupplyCost[n] := 0; } include balance_transshipment.run; option solver cplex; solve; display Flow;Note We also add a ???LINK??? check statement to our model file to ensure the problem is balanced:
check : sum {n in NODES} Supply[n] = sum {n in NODES} Demand[n];Our solution now shows that there is 5000 ton of steel remaining at the Pittsburgh Mill, i.e., the flow from Pittsburgh to Dummy is 5000.
POST-OPTIMAL ANALYSIS
Validation
For our solution to be valid we need it to be integer. Observing the Flow values shows that it is in fact integer. Moreover, no branch-and-bound nodes were required to make it integer. The transshipment problem is also naturally integer (like the transportation problem), so solving it as a linear programme will give integer solutions. In fact, any network flow problem with integer supplies, demands and arc capacities has naturally integer solutions.
Parametric Analysis
If ???LINK??? sensitivity analysis shows that improvements to the objective
function may be achieved by changing problem data, then we may use ???LINK??? parametric analysis to see the effect of these changes.
. . . include balance_transshipment.run; option presolve 0; option solver cplex; option cplex_options 'presolve 0 sensitivity'; solve; display Flow; display _varname, _var.down, _var.current, _var.up, _var.rc; display _conname, _con.down, _con.current, _con.up, _con.dual; ![]() ConserverFlow at Pittsburgh . However, we have variables on both sides of our constraints so we should expand our constraints to see what the right-hand side is:
![]() ConserveFlow['Pittsburgh'] can decrease without affecting our solution. Since Pittsburgh is a supply node (so the right-hand side is the negative of the supply) this means we can increase the supply at Pittsburgh without affecting our solution. This makes sense as Pittsburgh already has excess supply.
However, it seems like we can improve our objective the most by decreasing the demand at Tempe (the shadow price is 1.125), but the Allowable Minimum is such that we cannot discern what the change will be (the solution will change immediately). We can see the effect by using an ???LINK??? AMPL loop :
. . . display TotalCost; set CHANGES; param Objective {CHANGES}; param OldDemand; let OldDemand := Demand['Tempe']; let CHANGES := {100..1000 by 100}; for {i in CHANGES} { let Demand['Tempe'] := OldDemand - i; display Demand['Tempe']; # Rebalance the problem include balance_transshipment.run; solve; let Objective[i] := TotalCost; } ![]() balance_transshipment.run to consider problems that have been balanced previously:
balance_transshipment.run
let difference := (sum {s in NODES : s <> 'Dummy'} Supply[s]) - (sum {d in NODES : d <> 'Dummy'} Demand[d]); if 'Dummy' not in NODES then let NODES := NODES union {'Dummy'}; if difference > 0 then { print "Total Supply > Total Demand"; print "Solving with dummy supply node..."; let Demand['Dummy'] := difference; for {n in NODES : Supply[n] > 0} { let ARCS := ARCS union {(n, 'Dummy')}; let Cost[n, 'Dummy'] := dummyDemandCost[n]; } } else if difference < 0 then { print "WARNING: Total Supply < Total Demand, problem is infeasible!"; print "Solving with dummy demand node..."; let Demand['Dummy'] := - difference; for {n in NODES : Demand[n] > 0} { let ARCS := ARCS union {('Dummy', n)}; let Cost['Dummy', n] := dummySupplyCost[n]; } }; # else the problem is balancedThe AMPL parametric analysis shows that, by decreasing the demand for steel at Tempe, we can get a consistent reduction in our objective function, even though this was not clear from our initial sensitivity analysis. When we consider the sensitvity analysis for variable costs, we see that the only costs that affect our solution are the transportation costs from Pittsburgh and Youngstown to Chicago (all the other costs have Allowable Min and Allowable Max such that no "sensible" change would have any effect). Suppose American Steel are negotiating a new contract with the shipping company that takes their steel from Pittsburgh to Chicago. They estimate that they can get a reduction of around \$25/1000 ton of steel (taking the price from \$400/1000 ton to \$375/1000 ton), but want to know if they should negotiate for a lower price. The sensitivity analysis shows that below \$375/1000 ton the solution will change, so let's use parametric analysis to see what happens: . . . display TotalCost; set CHANGES; param Objective {CHANGES}; param OldCost; let OldCost := Cost['Pittsburgh', 'Chicago']; let CHANGES := {0..0.05 by 0.005}; for {i in CHANGES} { let Cost['Pittsburgh', 'Chicago'] := OldCost - i; display Cost['Pittsburgh', 'Chicago']; # Rebalance the problem include balance_transshipment.run; solve; let Objective[i] := TotalCost; }The parametric analysis shows that the objective function decreases at a greater rate if the price drops below $375/1000 ton, so American Steel should try and negotiate the price down even further. ![]()
transshipment.mod are:
MaxOut to Demand for all nodes:
let {n in NODES} MaxOut[n] := Demand[n];then we see that currently all the demands are being met via the American Steel distribution network (the total flow out = the total demand): ![]() |
Line: 1 to 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 86 to 86 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |*FORM FIELD ProblemDescription*|ProblemDescription|*THE AMERICAN STEEL PROBLEM*
American Steel, an Ohio-based steel manufacturing company, produces steel at its two steel mills located at Youngstown and Pittsburgh. The company distributes finished steel to its retail customers through the distribution network of regional and field warehouses shown below:
![]()
Flow of goods (cases of beer in The Beer Distribution Problem, tons of steels here) through the network. In ???LINK??? A Transportation Problem all arcs from the supply nodes to the demand nodes existed (although in ???LINK??? Forestry Management we used upper bounds to removes some arcs). In The American Steel Problem, the network has transshipment nodes and arcs don't exist between all nodes. However, arcs must travel from one node to another. In AMPL we ???LINK??? declare the set of NODES and the set of ARCS between nodes:
# The set of all nodes in the network set NODES; # The set of arcs in the network set ARCS within NODES cross NODES;Now we define bounds on the flow (of our goods) along each arc: # The minimum and maximum flow allowed along the arcs param Min {ARCS} integer, default 0; param Max {(m, n) in ARCS} integer, >= Min[m, n], default Infinity;and finally declare our Flow variables:
# The flow of goods to be sent across an arc var Flow {(m, n) in ARCS} >= Min[m, n], <= Max[m, n], integer;2. FORMULATE THE OBJECTIVE FUNCTION The objective of transshipment problems in general and The American Steel Problem in particular is to minimise the cost of shipping goods through the network: # The cost of shipping 1 unit of goods (per time unit) param Cost {ARCS}; # Minimise the total shipping cost minimize TotalCost: sum {(m, n) in ARCS} Cost[m, n] * Flow[m, n];3. FORMULATE THE CONSTRAINTS All the nodes have supply and demand, demand = 0 for supply nodes, supply = 0 for demand nodes and supply = demand = 0 for transshipment nodes. Also, the supply and demand amounts must be integer to ensure a naturally integer solution (i.e., linear programming will provide an integer optimal solution). # Each node has a (non-negative, integer) supply and a (non-negative, integer) demand # Note. supply nodes have demand = 0 and vice versa, # transshipment nodes have supply = demand = 0 param Supply {NODES} >= 0, integer, default 0; param Demand {NODES} >= 0, integer, default 0;The only constraints in the transshipment problem are flow conservation constraints. These constraints simply state that the flow of goods into a node must be greater than the flow of goods out of a node. # Must conserve flow in the network (goods cannot disappear!) subject to ConserveFlow {n in NODES}: sum {m in NODES: (m, n) in ARCS} Flow[m, n] + Supply[n] => sum {p in NODES: (n, p) in ARCS} Flow[n, p] + Demand[n];For example, if a node has a supply of 10 units and has 10 units flowing in, then it can have no more than 20 units flowing out: ![]() ![]() set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be ???LINK??? defined in a number of different ways :
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ; # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;We can choose lists, tables or arrays to define the parameters for The American Steel Problem, but in this case we will use a list and ???LINK??? define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Min['Youngstown', 'Albany'] ):
param: Cost Min Max:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 before solving: let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000;|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | |*FORM FIELD ProblemDescription*|ProblemDescription|American Steel, an Ohio-based steel manufacturing company, produces steel at its two steel mills located at Youngstown and Pittsburgh. The company distributes finished steel to its retail customers through the distribution network of regional and field warehouses shown below:
![]()
Flow of goods (cases of beer in The Beer Distribution Problem, tons of steels here) through the network. In ???LINK??? A Transportation Problem all arcs from the supply nodes to the demand nodes existed (although in ???LINK??? Forestry Management we used upper bounds to removes some arcs). In The American Steel Problem, the network has transshipment nodes and arcs don't exist between all nodes. However, arcs must travel from one node to another. In AMPL we ???LINK??? declare the set of NODES and the set of ARCS between nodes:
# The set of all nodes in the network set NODES; # The set of arcs in the network set ARCS within NODES cross NODES;Now we define bounds on the flow (of our goods) along each arc: # The minimum and maximum flow allowed along the arcs param Min {ARCS} integer, default 0; param Max {(m, n) in ARCS} integer, >= Min[m, n], default Infinity;and finally declare our Flow variables:
# The flow of goods to be sent across an arc var Flow {(m, n) in ARCS} >= Min[m, n], <= Max[m, n], integer;2. FORMULATE THE OBJECTIVE FUNCTION The objective of transshipment problems in general and The American Steel Problem in particular is to minimise the cost of shipping goods through the network: # The cost of shipping 1 unit of goods (per time unit) param Cost {ARCS}; # Minimise the total shipping cost minimize TotalCost: sum {(m, n) in ARCS} Cost[m, n] * Flow[m, n];3. FORMULATE THE CONSTRAINTS All the nodes have supply and demand, demand = 0 for supply nodes, supply = 0 for demand nodes and supply = demand = 0 for transshipment nodes. Also, the supply and demand amounts must be integer to ensure a naturally integer solution (i.e., linear programming will provide an integer optimal solution). # Each node has a (non-negative, integer) supply and a (non-negative, integer) demand # Note. supply nodes have demand = 0 and vice versa, # transshipment nodes have supply = demand = 0 param Supply {NODES} >= 0, integer, default 0; param Demand {NODES} >= 0, integer, default 0;The only constraints in the transshipment problem are flow conservation constraints. These constraints simply state that the flow of goods into a node must be greater than the flow of goods out of a node. # Must conserve flow in the network (goods cannot disappear!) subject to ConserveFlow {n in NODES}: sum {m in NODES: (m, n) in ARCS} Flow[m, n] + Supply[n] => sum {p in NODES: (n, p) in ARCS} Flow[n, p] + Demand[n];For example, if a node has a supply of 10 units and has 10 units flowing in, then it can have no more than 20 units flowing out: ![]() ![]() set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be ???LINK??? defined in a number of different ways :
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ; # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;We can choose lists, tables or arrays to define the parameters for The American Steel Problem, but in this case we will use a list and ???LINK??? define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Min['Youngstown', 'Albany'] ):
param: Cost Min Max:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 before solving: let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000;| | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|*FORM FIELD Results*|Results|Implementing the usual script file with transshipment.mod and steel.dat (with the Cost modification) gives us the optimal Flow variables:
![]() # The following parameters are needed to use balance_transshipment.run param difference; param dummyDemandCost {NODES}; param dummySupplyCost {NODES};balance_transshipment.run let difference := (sum {s in NODES} Supply[s]) - (sum {d in NODES} Demand[d]); let NODES := NODES union {'Dummy'}; if difference > 0 then { print "Total Supply > Total Demand"; print "Solving with dummy supply node..."; let Demand['Dummy'] := difference; for {n in NODES : Supply[n] > 0} { let ARCS := ARCS union {(n, 'Dummy')}; let Cost[n, 'Dummy'] := dummyDemandCost[n]; } } else if difference < 0 then { print "WARNING: Total Supply < Total Demand, problem is infeasible!"; print "Solving with dummy demand node..."; let Demand['Dummy'] := - difference; for {n in NODES : Demand[n] > 0} { let ARCS := ARCS union {('Dummy', n)}; let Cost['Dummy', n] := dummySupplyCost[n]; } }; # else the problem is balancedsteel.run # steel.run # # Written by Mike O'Sullivan & Cameron Walker 2004 # # This file contains a script for sensitivity analysis # of the American Steel transshipment model. # # Last modified: 27/2/2004 reset; model transshipment.mod; model balance_transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; for {n in NODES} { let dummyDemandCost[n] := 0; let dummySupplyCost[n] := 0; } include balance_transshipment.run; option solver cplex; solve; display Flow;Note We also add a ???LINK??? check statement to our model file to ensure the problem is balanced:
check : sum {n in NODES} Supply[n] = sum {n in NODES} Demand[n];Our solution now shows that there is 5000 ton of steel remaining at the Pittsburgh Mill, i.e., the flow from Pittsburgh to Dummy is 5000.
POST-OPTIMAL ANALYSIS
Validation
For our solution to be valid we need it to be integer. Observing the Flow values shows that it is in fact integer. Moreover, no branch-and-bound nodes were required to make it integer. The transshipment problem is also naturally integer (like the transportation problem), so solving it as a linear programme will give integer solutions. In fact, any network flow problem with integer supplies, demands and arc capacities has naturally integer solutions.
Parametric Analysis
If ???LINK??? sensitivity analysis shows that improvements to the objective
function may be achieved by changing problem data, then we may use ???LINK??? parametric analysis to see the effect of these changes.
. . . include balance_transshipment.run; option presolve 0; option solver cplex; option cplex_options 'presolve 0 sensitivity'; solve; display Flow; display _varname, _var.down, _var.current, _var.up, _var.rc; display _conname, _con.down, _con.current, _con.up, _con.dual; ![]() ConserverFlow at Pittsburgh . However, we have variables on both sides of our constraints so we should expand our constraints to see what the right-hand side is:
![]() ConserveFlow['Pittsburgh'] can decrease without affecting our solution. Since Pittsburgh is a supply node (so the right-hand side is the negative of the supply) this means we can increase the supply at Pittsburgh without affecting our solution. This makes sense as Pittsburgh already has excess supply.
However, it seems like we can improve our objective the most by decreasing the demand at Tempe (the shadow price is 1.125), but the Allowable Minimum is such that we cannot discern what the change will be (the solution will change immediately). We can see the effect by using an ???LINK??? AMPL loop :
. . . display TotalCost; set CHANGES; param Objective {CHANGES}; param OldDemand; let OldDemand := Demand['Tempe']; let CHANGES := {100..1000 by 100}; for {i in CHANGES} { let Demand['Tempe'] := OldDemand - i; display Demand['Tempe']; # Rebalance the problem include balance_transshipment.run; solve; let Objective[i] := TotalCost; } ![]() balance_transshipment.run to consider problems that have been balanced previously:
balance_transshipment.run
let difference := (sum {s in NODES : s <> 'Dummy'} Supply[s]) - (sum {d in NODES : d <> 'Dummy'} Demand[d]); if 'Dummy' not in NODES then let NODES := NODES union {'Dummy'}; if difference > 0 then { print "Total Supply > Total Demand"; print "Solving with dummy supply node..."; let Demand['Dummy'] := difference; for {n in NODES : Supply[n] > 0} { let ARCS := ARCS union {(n, 'Dummy')}; let Cost[n, 'Dummy'] := dummyDemandCost[n]; } } else if difference < 0 then { print "WARNING: Total Supply < Total Demand, problem is infeasible!"; print "Solving with dummy demand node..."; let Demand['Dummy'] := - difference; for {n in NODES : Demand[n] > 0} { let ARCS := ARCS union {('Dummy', n)}; let Cost['Dummy', n] := dummySupplyCost[n]; } }; # else the problem is balancedThe AMPL parametric analysis shows that, by decreasing the demand for steel at Tempe, we can get a consistent reduction in our objective function, even though this was not clear from our initial sensitivity analysis. When we consider the sensitvity analysis for variable costs, we see that the only costs that affect our solution are the transportation costs from Pittsburgh and Youngstown to Chicago (all the other costs have Allowable Min and Allowable Max such that no "sensible" change would have any effect). Suppose American Steel are negotiating a new contract with the shipping company that takes their steel from Pittsburgh to Chicago. They estimate that they can get a reduction of around \$25/1000 ton of steel (taking the price from \$400/1000 ton to \$375/1000 ton), but want to know if they should negotiate for a lower price. The sensitivity analysis shows that below \$375/1000 ton the solution will change, so let's use parametric analysis to see what happens: . . . display TotalCost; set CHANGES; param Objective {CHANGES}; param OldCost; let OldCost := Cost['Pittsburgh', 'Chicago']; let CHANGES := {0..0.05 by 0.005}; for {i in CHANGES} { let Cost['Pittsburgh', 'Chicago'] := OldCost - i; display Cost['Pittsburgh', 'Chicago']; # Rebalance the problem include balance_transshipment.run; solve; let Objective[i] := TotalCost; }The parametric analysis shows that the objective function decreases at a greater rate if the price drops below $375/1000 ton, so American Steel should try and negotiate the price down even further. ![]()
transshipment.mod are:
MaxOut to Demand for all nodes:
let {n in NODES} MaxOut[n] := Demand[n];then we see that currently all the demands are being met via the American Steel distribution network (the total flow out = the total demand): ![]() |
Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 84 to 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]()
Flow of goods (cases of beer in The Beer Distribution Problem, tons of steels here) through the network. In ???LINK??? A Transportation Problem all arcs from the supply nodes to the demand nodes existed (although in ???LINK??? Forestry Management we used upper bounds to removes some arcs). In The American Steel Problem, the network has transshipment nodes and arcs don't exist between all nodes. However, arcs must travel from one node to another. In AMPL we ???LINK??? declare the set of NODES and the set of ARCS between nodes:
# The set of all nodes in the network set NODES; # The set of arcs in the network set ARCS within NODES cross NODES;Now we define bounds on the flow (of our goods) along each arc: # The minimum and maximum flow allowed along the arcs param Min {ARCS} integer, default 0; param Max {(m, n) in ARCS} integer, >= Min[m, n], default Infinity;and finally declare our Flow variables:
# The flow of goods to be sent across an arc var Flow {(m, n) in ARCS} >= Min[m, n], <= Max[m, n], integer;2. FORMULATE THE OBJECTIVE FUNCTION The objective of transshipment problems in general and The American Steel Problem in particular is to minimise the cost of shipping goods through the network: # The cost of shipping 1 unit of goods (per time unit) param Cost {ARCS}; # Minimise the total shipping cost minimize TotalCost: sum {(m, n) in ARCS} Cost[m, n] * Flow[m, n];3. FORMULATE THE CONSTRAINTS All the nodes have supply and demand, demand = 0 for supply nodes, supply = 0 for demand nodes and supply = demand = 0 for transshipment nodes. Also, the supply and demand amounts must be integer to ensure a naturally integer solution (i.e., linear programming will provide an integer optimal solution). # Each node has a (non-negative, integer) supply and a (non-negative, integer) demand # Note. supply nodes have demand = 0 and vice versa, # transshipment nodes have supply = demand = 0 param Supply {NODES} >= 0, integer, default 0; param Demand {NODES} >= 0, integer, default 0;The only constraints in the transshipment problem are flow conservation constraints. These constraints simply state that the flow of goods into a node must be greater than the flow of goods out of a node. # Must conserve flow in the network (goods cannot disappear!) subject to ConserveFlow {n in NODES}: sum {m in NODES: (m, n) in ARCS} Flow[m, n] + Supply[n] => sum {p in NODES: (n, p) in ARCS} Flow[n, p] + Demand[n];For example, if a node has a supply of 10 units and has 10 units flowing in, then it can have no more than 20 units flowing out: ![]() ![]() set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be ???LINK??? defined in a number of different ways :
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ; # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;We can choose lists, tables or arrays to define the parameters for The American Steel Problem, but in this case we will use a list and ???LINK??? define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Min['Youngstown', 'Albany'] ):
param: Cost Min Max:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 before solving: let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000;| |
Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 84 to 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]()
Flow of goods (cases of beer in The Beer Distribution Problem, tons of steels here) through the network. In ???LINK??? A Transportation Problem all arcs from the supply nodes to the demand nodes existed (although in ???LINK??? Forestry Management we used upper bounds to removes some arcs). In The American Steel Problem, the network has transshipment nodes and arcs don't exist between all nodes. However, arcs must travel from one node to another. In AMPL we ???LINK??? declare the set of NODES and the set of ARCS between nodes:
# The set of all nodes in the network set NODES; # The set of arcs in the network set ARCS within NODES cross NODES;Now we define bounds on the flow (of our goods) along each arc: # The minimum and maximum flow allowed along the arcs param Min {ARCS} integer, default 0; param Max {(m, n) in ARCS} integer, >= Min[m, n], default Infinity;and finally declare our Flow variables:
# The flow of goods to be sent across an arc var Flow {(m, n) in ARCS} >= Min[m, n], <= Max[m, n], integer;2. FORMULATE THE OBJECTIVE FUNCTION The objective of transshipment problems in general and The American Steel Problem in particular is to minimise the cost of shipping goods through the network: # The cost of shipping 1 unit of goods (per time unit) param Cost {ARCS}; # Minimise the total shipping cost minimize TotalCost: sum {(m, n) in ARCS} Cost[m, n] * Flow[m, n];3. FORMULATE THE CONSTRAINTS All the nodes have supply and demand, demand = 0 for supply nodes, supply = 0 for demand nodes and supply = demand = 0 for transshipment nodes. Also, the supply and demand amounts must be integer to ensure a naturally integer solution (i.e., linear programming will provide an integer optimal solution). # Each node has a (non-negative, integer) supply and a (non-negative, integer) demand # Note. supply nodes have demand = 0 and vice versa, # transshipment nodes have supply = demand = 0 param Supply {NODES} >= 0, integer, default 0; param Demand {NODES} >= 0, integer, default 0;The only constraints in the transshipment problem are flow conservation constraints. These constraints simply state that the flow of goods into a node must be greater than the flow of goods out of a node. # Must conserve flow in the network (goods cannot disappear!) subject to ConserveFlow {n in NODES}: sum {m in NODES: (m, n) in ARCS} Flow[m, n] + Supply[n] => sum {p in NODES: (n, p) in ARCS} Flow[n, p] + Demand[n];For example, if a node has a supply of 10 units and has 10 units flowing in, then it can have no more than 20 units flowing out: ![]() ![]() set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be ???LINK??? defined in a number of different ways :
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ; # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;We can choose lists, tables or arrays to define the parameters for The American Steel Problem, but in this case we will use a list and ???LINK??? define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Min['Youngstown', 'Albany'] ):
param: Cost Min Max:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 before solving: let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000;| |
Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | |||||||||||||||||||||||||||||||||||||||||||||||||
Line: 40 to 40 | |||||||||||||||||||||||||||||||||||||||||||||||||
Return to top | |||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||
< < | Computational Model | ||||||||||||||||||||||||||||||||||||||||||||||||
> > | Computational Model | ||||||||||||||||||||||||||||||||||||||||||||||||
<--/twistyPlugin twikiMakeVisibleInline-->
We can use the AMPL model file transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 . . . Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow; <--/twistyPlugin--> <--/twistyPlugin twikiMakeVisibleInline-->
We can define the PuLP/Dippy model using functions in transshipment_funcy.py
<--/twistyPlugin--> | |||||||||||||||||||||||||||||||||||||||||||||||||
Line: 48 to 48 | |||||||||||||||||||||||||||||||||||||||||||||||||
Return to top | |||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||
< < | Results | ||||||||||||||||||||||||||||||||||||||||||||||||
> > | Results | ||||||||||||||||||||||||||||||||||||||||||||||||
Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node (see with arcs to all the demand nodes. The optimal solution will show the "best" nodes to send the extra supply to. | |||||||||||||||||||||||||||||||||||||||||||||||||
Line: 56 to 56 | |||||||||||||||||||||||||||||||||||||||||||||||||
Return to top | |||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||
< < | Conclusions | ||||||||||||||||||||||||||||||||||||||||||||||||
> > | Conclusions | ||||||||||||||||||||||||||||||||||||||||||||||||
In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
![]() |
Line: 1 to 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 26 to 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Operations Research Topics: LinearProgramming, IntegerProgramming, NetworkOptimisation, TransshipmentProblemApplication Areas: LogisticsContents | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Problem DescriptionAmerican Steel, an Ohio-based steel manufacturing company, produces steel at its two steel mills located at Youngstown and Pittsburgh. The company distributes finished steel to its retail customers through the distribution network of regional and field warehouses shown below:![]()
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 36 to 34 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return to top
Problem Formulation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | The American Steel Problem can be solved as a transshipment problem. The supply at the supply nodes is the maximum production at the steel mills, i.e., 10,000 and 15,000 for Youngstown and Pittsburgh respectively. The demand at demand nodes in given by the demand at the field warehouses and the other nodes are transshipment nodes. The costs and bounds on flow through the network are also given. The most compact formulation for this problem is a network formulation (see The Transshipment Problem for details). <img width= | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
The American Steel Problem can be solved as a transshipment problem. The supply at the supply nodes is the maximum production at the steel mills, i.e., 10,000 and 15,000 for Youngstown and Pittsburgh respectively. The demand at demand nodes in given by the demand at the field warehouses and the other nodes are transshipment nodes. The costs and bounds on flow through the network are also given. The most compact formulation for this problem is a network formulation (see The Transshipment Problem for details).
![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return to top
Computational Model | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | <div class= | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
<--/twistyPlugin twikiMakeVisibleInline-->
We can use the AMPL model file transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 . . . Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow; <--/twistyPlugin--> <--/twistyPlugin twikiMakeVisibleInline-->
We can define the PuLP/Dippy model using functions in transshipment_funcy.py
<--/twistyPlugin--> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return to top
Results | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
<img width= | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node (see with arcs to all the demand nodes. The optimal solution will show the "best" nodes to send the extra supply to. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return to top
Conclusions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3. <a name= | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return to top | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | <-- --> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | <-- | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 1 to 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 26 to 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Operations Research Topics: LinearProgramming, IntegerProgramming, NetworkOptimisation, TransshipmentProblemApplication Areas: LogisticsContents | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Problem DescriptionAmerican Steel, an Ohio-based steel manufacturing company, produces steel at its two steel mills located at Youngstown and Pittsburgh. The company distributes finished steel to its retail customers through the distribution network of regional and field warehouses shown below:![]()
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Problem Formulation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Problem Formulation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | The American Steel Problem can be solved as a transshipment problem. The supply at the supply nodes is the maximum production at the steel mills, i.e., 10,000 and 15,000 for Youngstown and Pittsburgh respectively. The demand at demand nodes in given by the demand at the field warehouses and the other nodes are transshipment nodes. The costs and bounds on flow through the network are also given. The most compact formulation for this problem is a network formulation (see The Transshipment Problem for details).
![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | The American Steel Problem can be solved as a transshipment problem. The supply at the supply nodes is the maximum production at the steel mills, i.e., 10,000 and 15,000 for Youngstown and Pittsburgh respectively. The demand at demand nodes in given by the demand at the field warehouses and the other nodes are transshipment nodes. The costs and bounds on flow through the network are also given. The most compact formulation for this problem is a network formulation (see The Transshipment Problem for details). <img width= | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Return to top
Computational Model | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Return to top | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | <--/twistyPlugin twikiMakeVisibleInline-->
We can use the AMPL model file transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 . . . Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow; <--/twistyPlugin--> <--/twistyPlugin twikiMakeVisibleInline-->
We can define the PuLP/Dippy model using functions in transshipment_funcy.py
<--/twistyPlugin--> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Computational Model | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Return to top
Results | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | <div class= | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node (see with arcs to all the demand nodes. The optimal solution will show the "best" nodes to send the extra supply to. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Return to top | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Return to top
Conclusions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Results | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
<img width= | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Return to top | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Return to top
ConclusionsIn order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3. <a name= Return to top | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Student Tasks | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Return to top | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Added: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]()
|
Line: 1 to 1 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
<-- Under Construction --> | ||||||||||
Line: 73 to 73 | ||||||||||
Return to top
| ||||||||||
Changed: | ||||||||||
< < |
| |||||||||
> > |
| |||||||||
| ||||||||||
Line: 93 to 93 | ||||||||||
| ||||||||||
Added: | ||||||||||
> > |
|
Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < |
<-- This topic can only be changed by:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | The American Steel Transshipment Problem | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | <-- This topic can only be changed by:
Case Study: The American Steel Transshipment Problem | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Submitted: 15 Feb 2008 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Operations Research Areas: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Operations Research Topics: LinearProgramming, IntegerProgramming, NetworkOptimisation, TransshipmentProblem | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Application Areas: Logistics | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Problem Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | ContentsProblem Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
American Steel, an Ohio-based steel manufacturing company, produces steel at its two steel mills located at Youngstown and Pittsburgh. The company distributes finished steel to its retail customers through the distribution network of regional and field warehouses shown below:
![]()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Problem Formulation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
Return to top
Problem Formulation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The American Steel Problem can be solved as a transshipment problem. The supply at the supply nodes is the maximum production at the steel mills, i.e., 10,000 and 15,000 for Youngstown and Pittsburgh respectively. The demand at demand nodes in given by the demand at the field warehouses and the other nodes are transshipment nodes. The costs and bounds on flow through the network are also given. The most compact formulation for this problem is a network formulation (see The Transshipment Problem for details).
![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Computational Model | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
Return to top
Computational Model | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<--/twistyPlugin twikiMakeVisibleInline-->
We can use the AMPL model file transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 . . . Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow; <--/twistyPlugin--> <--/twistyPlugin twikiMakeVisibleInline-->
We can define the PuLP/Dippy model using functions in transshipment_funcy.py
<--/twistyPlugin--> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Results | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
Return to top
Results | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Using transshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node (see with arcs to all the demand nodes. The optimal solution will show the "best" nodes to send the extra supply to.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Conclusions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
Return to top
Conclusions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3.
Table 3 Optimal Shipment Plan
![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Return to top | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Student Tasks | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
Student Tasks | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Return to top | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]()
Flow of goods (cases of beer in The Beer Distribution Problem, tons of steels here) through the network. In ???LINK??? A Transportation Problem all arcs from the supply nodes to the demand nodes existed (although in ???LINK??? Forestry Management we used upper bounds to removes some arcs). In The American Steel Problem, the network has transshipment nodes and arcs don't exist between all nodes. However, arcs must travel from one node to another. In AMPL we ???LINK??? declare the set of NODES and the set of ARCS between nodes:
# The set of all nodes in the network set NODES; # The set of arcs in the network set ARCS within NODES cross NODES;Now we define bounds on the flow (of our goods) along each arc: # The minimum and maximum flow allowed along the arcs param Min {ARCS} integer, default 0; param Max {(m, n) in ARCS} integer, >= Min[m, n], default Infinity;and finally declare our Flow variables:
# The flow of goods to be sent across an arc var Flow {(m, n) in ARCS} >= Min[m, n], <= Max[m, n], integer;2. FORMULATE THE OBJECTIVE FUNCTION The objective of transshipment problems in general and The American Steel Problem in particular is to minimise the cost of shipping goods through the network: # The cost of shipping 1 unit of goods (per time unit) param Cost {ARCS}; # Minimise the total shipping cost minimize TotalCost: sum {(m, n) in ARCS} Cost[m, n] * Flow[m, n];3. FORMULATE THE CONSTRAINTS All the nodes have supply and demand, demand = 0 for supply nodes, supply = 0 for demand nodes and supply = demand = 0 for transshipment nodes. Also, the supply and demand amounts must be integer to ensure a naturally integer solution (i.e., linear programming will provide an integer optimal solution). # Each node has a (non-negative, integer) supply and a (non-negative, integer) demand # Note. supply nodes have demand = 0 and vice versa, # transshipment nodes have supply = demand = 0 param Supply {NODES} >= 0, integer, default 0; param Demand {NODES} >= 0, integer, default 0;The only constraints in the transshipment problem are flow conservation constraints. These constraints simply state that the flow of goods into a node must be greater than the flow of goods out of a node. # Must conserve flow in the network (goods cannot disappear!) subject to ConserveFlow {n in NODES}: sum {m in NODES: (m, n) in ARCS} Flow[m, n] + Supply[n] => sum {p in NODES: (n, p) in ARCS} Flow[n, p] + Demand[n];For example, if a node has a supply of 10 units and has 10 units flowing in, then it can have no more than 20 units flowing out: ![]() ![]() set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be ???LINK??? defined in a number of different ways :
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ; # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;We can choose lists, tables or arrays to define the parameters for The American Steel Problem, but in this case we will use a list and ???LINK??? define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Min['Youngstown', 'Albany'] ):
param: Cost Min Max:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 before solving: let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000;| |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
|
Line: 1 to 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Added: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
<-- This topic can only be changed by:
<-- This template controls both the look and functionality of case study topics. You should not need to alter the layout, only edit the data using the form above. Set the view and edit templates: Comment out the next line to use the TWiki default view
The American Steel Transshipment ProblemSubmitted: 15 Feb 2008Operations Research Areas:Application Areas: LogisticsProblem DescriptionAmerican Steel, an Ohio-based steel manufacturing company, produces steel at its two steel mills located at Youngstown and Pittsburgh. The company distributes finished steel to its retail customers through the distribution network of regional and field warehouses shown below:![]()
Problem FormulationThe American Steel Problem can be solved as a transshipment problem. The supply at the supply nodes is the maximum production at the steel mills, i.e., 10,000 and 15,000 for Youngstown and Pittsburgh respectively. The demand at demand nodes in given by the demand at the field warehouses and the other nodes are transshipment nodes. The costs and bounds on flow through the network are also given. The most compact formulation for this problem is a network formulation (see The Transshipment Problem for details).![]() Computational Model<--/twistyPlugin twikiMakeVisibleInline-->
We can use the AMPL model file transshipment.mod (see The Transshipment Problem in AMPL for details) to solve the American Steel Transshipment Problem. We need a data file to describe the nodes, arcs, costs and bounds. The node set is simply a list of the node names:
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be defined in a number of different ways:
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + . . . # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;Since the node set is small and the arc set is "dense", i.e., many of the node pairs are represented in the arc set, we choose a table to define ARCS: set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ;The NetDemand can be defined easily from the supply and demand. Since the default is 0 we don't need to define NetDemand for the transshipment nodes:
param NetDemand := Youngstown -10000 Pittsburgh -15000 Albany 3000 Houston 7000 Tempe 4000 Gary 6000 ;We can use lists, tables or arrays to define the parameters for the American Steel Transhippment Problem, but in this case we will use a list and define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Lower for Youngstown and Albany ):
param: Cost Lower Upper:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 . . . Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 in our script file before solving: reset; model transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; option solver cplex; solve; display Flow; <--/twistyPlugin--> <--/twistyPlugin twikiMakeVisibleInline-->
We can define the PuLP/Dippy model using functions in transshipment_funcy.py
<--/twistyPlugin--> ResultsUsingtransshipment.mod , and the data and script files defined in Computational Model we can solve the American Steel Transshipment Problem to get the optimal Flow variables:
![]() transshipment.mod we check that sum {n in NODES} NetDemand[n] <= 0 to ensure a problem is feasible before solving.
If total supply is less than demand (hence the problem is infeasible) we can add a dummy supply node (see with arcs to all the demand nodes. The optimal solution will show the "best" nodes to send the extra supply to.
ConclusionsIn order to minimise the monthly shipment costs, American Steel should follow the shipment plan shown in Table 3. Table 3 Optimal Shipment Plan
![]() Student Tasks
![]()
Flow of goods (cases of beer in The Beer Distribution Problem, tons of steels here) through the network. In ???LINK??? A Transportation Problem all arcs from the supply nodes to the demand nodes existed (although in ???LINK??? Forestry Management we used upper bounds to removes some arcs). In The American Steel Problem, the network has transshipment nodes and arcs don't exist between all nodes. However, arcs must travel from one node to another. In AMPL we ???LINK??? declare the set of NODES and the set of ARCS between nodes:
# The set of all nodes in the network set NODES; # The set of arcs in the network set ARCS within NODES cross NODES;Now we define bounds on the flow (of our goods) along each arc: # The minimum and maximum flow allowed along the arcs param Min {ARCS} integer, default 0; param Max {(m, n) in ARCS} integer, >= Min[m, n], default Infinity;and finally declare our Flow variables:
# The flow of goods to be sent across an arc var Flow {(m, n) in ARCS} >= Min[m, n], <= Max[m, n], integer;2. FORMULATE THE OBJECTIVE FUNCTION The objective of transshipment problems in general and The American Steel Problem in particular is to minimise the cost of shipping goods through the network: # The cost of shipping 1 unit of goods (per time unit) param Cost {ARCS}; # Minimise the total shipping cost minimize TotalCost: sum {(m, n) in ARCS} Cost[m, n] * Flow[m, n];3. FORMULATE THE CONSTRAINTS All the nodes have supply and demand, demand = 0 for supply nodes, supply = 0 for demand nodes and supply = demand = 0 for transshipment nodes. Also, the supply and demand amounts must be integer to ensure a naturally integer solution (i.e., linear programming will provide an integer optimal solution). # Each node has a (non-negative, integer) supply and a (non-negative, integer) demand # Note. supply nodes have demand = 0 and vice versa, # transshipment nodes have supply = demand = 0 param Supply {NODES} >= 0, integer, default 0; param Demand {NODES} >= 0, integer, default 0;The only constraints in the transshipment problem are flow conservation constraints. These constraints simply state that the flow of goods into a node must be greater than the flow of goods out of a node. # Must conserve flow in the network (goods cannot disappear!) subject to ConserveFlow {n in NODES}: sum {m in NODES: (m, n) in ARCS} Flow[m, n] + Supply[n] => sum {p in NODES: (n, p) in ARCS} Flow[n, p] + Demand[n];For example, if a node has a supply of 10 units and has 10 units flowing in, then it can have no more than 20 units flowing out: ![]() ![]() set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;Note that Kansas City must be enclosed in ' and ' because of the whitespace in the name.
The arc set is 2-dimensional and can be ???LINK??? defined in a number of different ways :
# List of arcs set ARCS := (Youngstown, Albany), (Youngstown, Cincinnati), ... , (Chicago, Gary) ; # Table of arcs set ARCS: Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary := Youngstown + + + + - - - Pittsburgh + + + - - - + Cincinnati - - - + + - - 'Kansas City' - - - - + + - Chicago - - - - - + + ; # Array of arcs set ARCS := (Youngstown, *) Cincinnati 'Kansas City' Chicago Albany (Pittsburgh, *) Cincinnati 'Kansas City' Chicago Gary . . . (Chicago, *) Tempe Gary ;We can choose lists, tables or arrays to define the parameters for The American Steel Problem, but in this case we will use a list and ???LINK??? define multiple parameters at once. This allows us to "cut-and-paste" the parameters from the problem description. Note the use of . for parameters where the defaults will suffice (e.g., Min['Youngstown', 'Albany'] ):
param: Cost Min Max:= Youngstown Albany 500 . 1000 Youngstown Cincinnati 350 . 3000 Youngstown 'Kansas City' 450 1000 5000 Youngstown Chicago 375 . 5000 Pittsburgh Cincinnati 350 . 2000 Pittsburgh 'Kansas City' 450 2000 3000 Pittsburgh Chicago 400 . 4000 Pittsburgh Gary 450 . 2000 Cincinnati Albany 350 1000 5000 Cincinnati Houston 550 . 6000 'Kansas City' Houston 375 . 4000 'Kansas City' Tempe 650 . 4000 Chicago Tempe 600 . 2000 Chicago Gary 120 . 4000 ;Note that the cost is in $/1000 ton, so we must divide the cost by 1000 before solving: let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000;|
transshipment.mod and steel.dat (with the Cost modification) gives us the optimal Flow variables:
![]() # The following parameters are needed to use balance_transshipment.run param difference; param dummyDemandCost {NODES}; param dummySupplyCost {NODES};balance_transshipment.run let difference := (sum {s in NODES} Supply[s]) - (sum {d in NODES} Demand[d]); let NODES := NODES union {'Dummy'}; if difference > 0 then { print "Total Supply > Total Demand"; print "Solving with dummy supply node..."; let Demand['Dummy'] := difference; for {n in NODES : Supply[n] > 0} { let ARCS := ARCS union {(n, 'Dummy')}; let Cost[n, 'Dummy'] := dummyDemandCost[n]; } } else if difference < 0 then { print "WARNING: Total Supply < Total Demand, problem is infeasible!"; print "Solving with dummy demand node..."; let Demand['Dummy'] := - difference; for {n in NODES : Demand[n] > 0} { let ARCS := ARCS union {('Dummy', n)}; let Cost['Dummy', n] := dummySupplyCost[n]; } }; # else the problem is balancedsteel.run # steel.run # # Written by Mike O'Sullivan & Cameron Walker 2004 # # This file contains a script for sensitivity analysis # of the American Steel transshipment model. # # Last modified: 27/2/2004 reset; model transshipment.mod; model balance_transshipment.mod; data steel.dat; let {(m, n) in ARCS} Cost[m, n] := Cost[m, n] / 1000; for {n in NODES} { let dummyDemandCost[n] := 0; let dummySupplyCost[n] := 0; } include balance_transshipment.run; option solver cplex; solve; display Flow;Note We also add a ???LINK??? check statement to our model file to ensure the problem is balanced:
check : sum {n in NODES} Supply[n] = sum {n in NODES} Demand[n];Our solution now shows that there is 5000 ton of steel remaining at the Pittsburgh Mill, i.e., the flow from Pittsburgh to Dummy is 5000.
POST-OPTIMAL ANALYSIS
Validation
For our solution to be valid we need it to be integer. Observing the Flow values shows that it is in fact integer. Moreover, no branch-and-bound nodes were required to make it integer. The transshipment problem is also naturally integer (like the transportation problem), so solving it as a linear programme will give integer solutions. In fact, any network flow problem with integer supplies, demands and arc capacities has naturally integer solutions.
Parametric Analysis
If ???LINK??? sensitivity analysis shows that improvements to the objective
function may be achieved by changing problem data, then we may use ???LINK??? parametric analysis to see the effect of these changes.
. . . include balance_transshipment.run; option presolve 0; option solver cplex; option cplex_options 'presolve 0 sensitivity'; solve; display Flow; display _varname, _var.down, _var.current, _var.up, _var.rc; display _conname, _con.down, _con.current, _con.up, _con.dual; ![]() ConserverFlow at Pittsburgh . However, we have variables on both sides of our constraints so we should expand our constraints to see what the right-hand side is:
![]() ConserveFlow['Pittsburgh'] can decrease without affecting our solution. Since Pittsburgh is a supply node (so the right-hand side is the negative of the supply) this means we can increase the supply at Pittsburgh without affecting our solution. This makes sense as Pittsburgh already has excess supply.
However, it seems like we can improve our objective the most by decreasing the demand at Tempe (the shadow price is 1.125), but the Allowable Minimum is such that we cannot discern what the change will be (the solution will change immediately). We can see the effect by using an ???LINK??? AMPL loop :
. . . display TotalCost; set CHANGES; param Objective {CHANGES}; param OldDemand; let OldDemand := Demand['Tempe']; let CHANGES := {100..1000 by 100}; for {i in CHANGES} { let Demand['Tempe'] := OldDemand - i; display Demand['Tempe']; # Rebalance the problem include balance_transshipment.run; solve; let Objective[i] := TotalCost; } ![]() balance_transshipment.run to consider problems that have been balanced previously:
balance_transshipment.run
let difference := (sum {s in NODES : s <> 'Dummy'} Supply[s]) - (sum {d in NODES : d <> 'Dummy'} Demand[d]); if 'Dummy' not in NODES then let NODES := NODES union {'Dummy'}; if difference > 0 then { print "Total Supply > Total Demand"; print "Solving with dummy supply node..."; let Demand['Dummy'] := difference; for {n in NODES : Supply[n] > 0} { let ARCS := ARCS union {(n, 'Dummy')}; let Cost[n, 'Dummy'] := dummyDemandCost[n]; } } else if difference < 0 then { print "WARNING: Total Supply < Total Demand, problem is infeasible!"; print "Solving with dummy demand node..."; let Demand['Dummy'] := - difference; for {n in NODES : Demand[n] > 0} { let ARCS := ARCS union {('Dummy', n)}; let Cost['Dummy', n] := dummySupplyCost[n]; } }; # else the problem is balancedThe AMPL parametric analysis shows that, by decreasing the demand for steel at Tempe, we can get a consistent reduction in our objective function, even though this was not clear from our initial sensitivity analysis. When we consider the sensitvity analysis for variable costs, we see that the only costs that affect our solution are the transportation costs from Pittsburgh and Youngstown to Chicago (all the other costs have Allowable Min and Allowable Max such that no "sensible" change would have any effect). Suppose American Steel are negotiating a new contract with the shipping company that takes their steel from Pittsburgh to Chicago. They estimate that they can get a reduction of around \$25/1000 ton of steel (taking the price from \$400/1000 ton to \$375/1000 ton), but want to know if they should negotiate for a lower price. The sensitivity analysis shows that below \$375/1000 ton the solution will change, so let's use parametric analysis to see what happens: . . . display TotalCost; set CHANGES; param Objective {CHANGES}; param OldCost; let OldCost := Cost['Pittsburgh', 'Chicago']; let CHANGES := {0..0.05 by 0.005}; for {i in CHANGES} { let Cost['Pittsburgh', 'Chicago'] := OldCost - i; display Cost['Pittsburgh', 'Chicago']; # Rebalance the problem include balance_transshipment.run; solve; let Objective[i] := TotalCost; }The parametric analysis shows that the objective function decreases at a greater rate if the price drops below $375/1000 ton, so American Steel should try and negotiate the price down even further. ![]()
transshipment.mod are:
MaxOut to Demand for all nodes:
let {n in NODES} MaxOut[n] := Demand[n];then we see that currently all the demands are being met via the American Steel distribution network (the total flow out = the total demand): ![]()
|