Title: Network Modeling
1Network Modeling
Chapter 5
2Introduction
- A number of business problems can be represented
graphically as networks. - Advantages of Network Models versus LPs
- Networks are convenient way to think about and
model many problems - Network flow models yield integer solutions
naturally as long as the supply and demand data
is integer - Specialized extremely fast algorithms have been
developed for network problems ? Critical for
very large problems. However, Solver does
include these algorithm and we shall simply use
the regular LP simplex algorithm available - We will focus on a few such problems
- Transshipment
- Shortest Path
- Transportation/Assignment
- Maximal Flow
3Network Flow Problem Characteristics
- General network flow problems (transshipment
problems) can be represented as a collection of
nodes connected by arcs. - There are three types of nodes
- Supply
- Demand
- Transshipment
- Well use negative numbers to represent supplies
and positive numbers to represent demand. - There exists efficient algorithms for the
transshipment problem that are one or more
orders of magnitude faster than the standard
Simplex LP solver however, Solver only has one
generic Simplex solver for all LP problems
4A Transshipment ProblemThe Bavarian Motor
Company
100
30
Boston
2
50
-200
Newark
1
Columbus
60
40
3
40
35
Richmond
30
80
Atlanta
4
170
5
25
50
45
35
Mobile
70
J'ville
-300
6
50
7
5Defining the Decision Variables
- For each arc in a network flow model
- we define a decision variable as
- Xij the amount being shipped (or flowing) from
node i to node j
For example X12 the of cars shipped from
node 1 (Newark) to node 2 (Boston) X56 the of
cars shipped from node 5 (Atlanta) to node 6
(Mobile)
- Notes
- The number of arcs determines the number of
variables - Lower and upper bounds could be placed on the flow
6Defining the Objective Function
- Minimize total shipping costs.
- MIN 30X12 40X14 50X23 35X35
- 40X53 30X54 35X56 25X65
- 50X74 45X75 50X76
7Constraints for Network Flow ProblemsBalance-of-
Flow Concepts or Rules
8Motivation Behind Rules
Consider the following two cases for a
hypothetical node 1 (rest of network not shown)
Case B
Case A
9Illustration of Rule 1
Case A
Case B
Total Supply gt Total Demand which means, in
general, we should be able to meet all the demand
? Inflow-Outflow gt Supply or Demand
Case A X21X41-X13-X15gt-100, or
-X21-X41X13X15lt100 (i.e., not all supply
from node 1 has to be used)
Case B X21X41-X13-X15gt100, or
X21X41-X13-X15100 (i.e., all demand at node 1
has to be met)
10Illustration of Rule 2
Case A
Case B
Total Supply lt Total Demand which means, we
cannot to meet all the demand even if use all the
supply ? Inflow-Outflow Supply Inflow Outflow
lt Demand
Case A X21X41-X13-X15-100, or
-X21-X41X13X15100 (i.e., all supply from
node 1 is used) Note that -X21-X41X13X15gt
100 is wrong!
Case B X21X41-X13-X15lt100, or (i.e., not
all demand at node 1 has to be met)
11Illustration of Rule 3
Case A
Case B
Total Supply Total Demand which means, we
should be able to exactly meet all the demand ?
Inflow-Outflow Supply or Demand
Case A X21X41-X13-X15-100, or
-X21-X41X13X15 100 (i.e., all supply from
node 1 is used)
Case B X21X41-X13-X15100, or (i.e., all
demand at node 1 is met)
12A Word of Caution
- These rules are there to help us write the proper
flow balance constraints. - In reality, the essential underlying rule is that
what comes into a node (via arcs or external
supply) comes out of the node (again via arcs or
external demand). - Note that the stated rules make the implicit
assumption that the supplies, regardless at what
nodes they occur at, can be routed through the
network to meet demands at their appropriate
nodes. - This assumption may not always be true.
- When this assumption is untrue, we may have an
infeasible model - We will look later on at one way to handle the
infeasibility
13Defining the Constraints
- In the BMC problem
- Total Supply 500 cars
- Total Demand 480 cars
- For each supply or demand node we need a
constraint like this - Inflow - Outflow gt Supply or Demand
- Constraint for node 1
- X12 X14 gt 200 (Note there is no inflow
for node 1) - This is equivalent to
- X12 X14 lt 200
(Supply gt Demand)
14Defining the Constraints
- Flow constraints
- X12 X14 gt 200 node 1
- X12 X23 gt 100 node 2
- X23 X53 X35 gt 60 node 3
- X14 X54 X74 gt 80 node 4
- X35 X65 X75 X53 X54 X56 gt 170 node
5 - X56 X76 X65 gt 70 node 6
- X74 X75 X76 gt 300 node 7
- Nonnegativity conditions
- Xij gt 0 for all ij
15Implementing the Model
16Optimal Solution to the BMC Problem
100
30
Boston
2
50
-200
Newark
1
Columbus
60
40
3
40
Richmond
80
Atlanta
4
170
5
45
Mobile
70
J'ville
-300
6
50
7
17The Shortest Path Problem
- Many decision problems boil down to determining
the shortest (or least costly) route or path
through a network. - Ex. Emergency Vehicle Routing
- This is a special case of a transshipment problem
where - There is one supply node with a supply of -1
- There is one demand node with a demand of 1
- All other nodes have supply/demand of 0
- There exists efficient algorithms for the
shortest path problem that can solve huge
networks (say, with 10,000 nodes and 1 million
variables) in a matter of seconds however,
Solver only has one generic Simplex solver for
all LP problems.
18 The American Car Association
0
3.3 hrs
1
L'burg
5 pts
9
Va Bch
11
5.0 hrs
9 pts
2.0 hrs
4 pts
4.7 hrs
2.7 hrs
0
9 pts
0
4 pts
1.1 hrs
K'ville
3 pts
G'boro
Raliegh
5
2.0 hrs
3.0 hrs
8
9 pts
10
4 pts
0
1.7 hrs
5 pts
A'ville
1.5 hrs
0
6
2.3 hrs
3 pts
0
3 pts
Chatt.
2.8 hrs
7 pts
3
Charl.
2.0 hrs
7
8 pts
0
1.7 hrs
3.0 hrs
4 pts
4 pts
1.5 hrs
G'ville
2 pts
4
Atlanta
0
B'ham
2.5 hrs
2
3 pts
1
2.5 hrs
0
3 pts
-1
19Solving the Problem
- There are two possible objectives for this
problem - Finding the quickest route (minimizing travel
time) - Finding the most scenic route (maximizing the
scenic rating points) - See file Fig5-7.xls
20The Equipment Replacement Problem
- The problem of determining when to replace
equipment is another common business problem. - It can also be modeled as a shortest path problem
21The Compu-Train Company
- Compu-Train provides hands-on software training.
- Computers must be replaced at least every two
years. - Two lease contracts are being considered
- Each requires 62,000 initially
- Contract 1
- Prices increase 6 per year
- 60 trade-in for 1 year old equipment
- 15 trade-in for 2 year old equipment
- Contract 2
- Prices increase 2 per year
- 30 trade-in for 1 year old equipment
- 10 trade-in for 2 year old equipment
22Network for Contract 1
Cost on arc cost of new computers minus salvage
value for traded in computers Costs for arcs out
of node 1 Cost of trading after 1 year (arc
to node 2) 1.0662,000 - 0.662,000
28,520 Cost of trading after 2 years
(arc to node 3) 1.06262,000 - 0.1562,000
60,363 Costs for arcs out of node 2 Cost
of trading after 1 year (arc to node 3)
1.06262,000 - 0.61.0662,000 30,231
Cost of trading after 2 years (arc to node 4)
1.06362,000 - 0.151.0662,000 63,985 And
so on
23Solving the Problem
24Transportation Assignment Problems
- Some network flow problems dont have
trans-shipment nodes only supply and demand
nodes. These are termed transportation
problems (Example covered in Chapter 3). - Transportation problems with flows that are
either zero or 1 are called assignment problems
(e.g., assigning jobs to machines on next slide).
- There exists efficient algorithms for each of
these two different problems that are one or more
orders of magnitude faster than generic LP
solvers however, Solver only has one generic
Simplex solver for all LP problems.
These problems are implemented more effectively
using the approach in Chapter 3 (Fig 3-24.xls).
25Assignment Problems
- Assignment models are used to assign, on a
one-to-one basis, members of one set to members
of another set in a least-cost (or least-time)
manner. - Assignment models are special cases of
transportation models where all flows are 0 or 1. - It is identical to the transportation model
except with different inputs.
26Example
- There are four jobs that must be completed by
five machines. Machines 1, 3 and 5 can hold at
most one job each, whereas machines 2 and 4 can
handle two jobs each.
1
14
Machine 1
1
Job 1
5
2
Machine 2
8
1
Job 2
1
Machine 3
7
1
Job 3
. . .
2
Machine 4
1
Job 4
1
Machine 5
27Assignment Problem Example - Continued
- The objective is to minimize the overall cost.
- Refer to Assignment.xls file referenced under
Lecture.
28The Maximal Flow Problem
- In some network problems, the objective is to
determine the maximum amount of flow that can
occur through a network. - The arcs in these problems have upper and lower
flow limits. - Examples
- How much water can flow through a network of
pipes? - How many cars can travel through a network of
streets? - There exists efficient algorithms for the maximal
problem that can solve huge networks (say, with
10,000 nodes and 1 million variables) in a matter
of seconds however, Solver only has one generic
Simplex solver for all LP problems.
29The Northwest Petroleum Company
Pumping
Pumping
Station 3
Station 1
UB 3
4
2
UB 6
UB 6
UB 2
Oil Field
1
6
Refinery
UB 2
UB 4
UB 4
5
3
UB 5
Pumping
Pumping
Station 2
Station 4
30The Northwest Petroleum Company
Pumping
Pumping
Station 3
Station 1
UB 3
4
2
UB 6
UB 6
UB 2
Oil Field
1
6
Refinery
UB 2
UB 4
UB 4
5
3
UB 5
Pumping
Pumping
Station 2
Station 4
31Formulation of the Max Flow Problem
- MAX X61
- Subject to X61 - X12 - X13 0
- X12 - X24 - X25 0
- X13 - X34 - X35 0
- X24 X34 - X46 0
- X25 X35 - X56 0
- X46 X56 - X61 0
- with the following bounds on the decision
variables - 0 lt X12 lt 6 0 lt X25 lt 2 0 lt X46 lt 6
- 0 lt X13 lt 4 0 lt X34 lt 2 0 lt X56 lt 4
- 0 lt X24 lt 3 0 lt X35 lt 5 0 lt X61 lt inf
32Implementing the Model
33Optimal Solution
Pumping
Pumping
Station 3
Station 1
3
3
4
2
5
6
5
2
2
6
Oil Field
1
6
Refinery
2
4
2
4
4
4
5
3
5
2
Pumping
Pumping
Station 2
Station 4
34Special Modeling ConsiderationsFlow Aggregation
0
3
5
1
3
5
-100
75
3
4
5
4
2
4
6
50
-100
5
6
0
Suppose the total flow into nodes 3 4 must be
at least 50 and 60, respectively. How would you
model this?
35Special Modeling ConsiderationsFlow Aggregation
0
0
3
5
1
3
5
-100
75
30
L.B.50
4
3
4
5
2
4
6
50
40
-100
L.B.60
5
6
0
0
Nodes 30 40 aggregate the total flow into nodes
3 4, respectively. This allows us to place
lower bounds on the aggregate flows into these
nodes.
36Special Modeling ConsiderationsMultiple Arcs
Between Nodes
8
1
-75
2
50
6
U.B. 35
Two (or more) arcs can share the same beginning
and ending nodes. You just need to label them
differently in the algebraic formulation e.g.,
X121 and X122. Implementation in Excel would be
identical to before. The book also offers an
alternative scheme
37Special Modeling ConsiderationsCapacity
Restrictions on Total Supply
- Supply exceeds demand, but the upper bounds
prevent the demand from being met. - Note that this situation may even happen without
the capacity restrictions. It may be that the
network is not connected in a fashion to allow
the available supply to reach the required demand.
38Special Modeling ConsiderationsCapacity
Restrictions on Total Supply
75
-100
5, UB40
1
3
999, UB100
4, UB30
200
0
6, UB35
2
4
999, UB100
3, UB35
80
-100
- Now, demand exceeds total supply and you can use
Rule 2. - As much real demand as possible will be met in
the least costly way.
39End of Chapter 5