SLIDE 1 Chapter 8 Network Models – Part 1
- Prof. Dr. Arslan M. ÖRNEK
SLIDE 2 2
Network Optimization Models
- Networks arise in numerous settings:
– Transportation – Electrical and communication networks – Production planning problems – Distribution problems – Project management – Facilities location – Financial planning etc.
- Recent developments in OR: Efficient network
algorithms
SLIDE 3 3
Network Optimization Models
- Many network models: Special type of LP
– Minimum cost network flow problem (MCNFP)
– Shortest path problem – Minimum spanning tree problem – Maximum flow problem – Project scheduling
SLIDE 4 8.1. Basic Definitions
A graph or network is defined by two sets of symbols:
- Nodes: A set of points or vertices (call it V) are called
nodes (or vertices) of a graph or network.
- Arcs: An arc consists of an ordered pair of vertices and
represents a possible direction of motion (flow) that may occur between vertices.
Node (vertex) 1 2 Arc (1,2) Node
SLIDE 5 – Edges (links, branches, undirected arcs) : Lines connecting certain pairs of nodes in a network. The flow through an edge is allowed in both directions.
8.1. Basic Definitions
5
SLIDE 6 8.1. Basic Definitions
6
SLIDE 7 – On an edge, the flow will be in only one direction at a time, a simultaneous flow to both directions requires two directed arcs in both directions. – A network with only directed arcs: A directed network – A network with only undirected arcs: An undirected network – You can convert a network with both directed and undirected arcs to a directed network. (How?)
8.1. Basic Definitions
7
SLIDE 8
8.1. Basic Definitions
V = {1, 2, 3, 4} and A = {(1, 2), (2, 3), (3, 4), (4, 3), (4, 1)} For any arc (j, k), node j is the initial node, and node k is the terminal node. The arc ( j, k) is said to go from node j to node k.
SLIDE 9
8.1. Basic Definitions
A sequence of arcs such that every arc has exactly one vertex in common with the previous arc is called a chain (or undirected path). A path is a directed chain in which the terminal node of each arc is identical to the initial node of the next arc.
SLIDE 10 – A path from node i to node j has a sequence of arcs whose directions are towards node j. – A chain from node i to node j has a sequence of arcs whose directions are either towards or away from node j.
8.1. Basic Definitions
10
SLIDE 11 – Nodes A and B are factories, Nodes D and E are warehouses, and Node C is a distribution center, arcs represent shipping channels. – A B CE : path from A to E (We can send a flow from A to E on this path) – B C AD : undirected path (chain) from B to D (cannot send flow)
8.1. Basic Definitions
11
SLIDE 12
8.2. Shortest Path Problems
Assume that each arc in the network has a length associated with it. Suppose we start at a particular node (say, node 1). The problem of finding the shortest path (path of minimum length) from node 1 to any other node in the network is called a shortest path problem.
SLIDE 13
8.2. Shortest Path Problems
Example 1: Suppose that when power is sent from plant 1 (node 1) to city 1 (node 6), it must pass through substations (nodes 2 to 5). For any pair of nodes between which power can be transported, distances (in miles) between the nodes are shown. Powerco wants the power sent from plant 1 to city 1 to travel the minimum possible distance.
SLIDE 14
8.2. Solution: Dijkstra’s Algorithm
Find the shortest path from a node (say, node 1) to all other nodes. To begin, we label node 1 with a permanent label of “0”. Then we label each node i that is connected to node 1 by a single arc with a temporary label equal to the length of the arc joining node 1 to node i. Each other node (except, of course, for node 1) will have a temporary label of “∞”. Choose the node with the smallest temporary label and make this label permanent. See the rest on the example:
SLIDE 15
8.2. Shortest Path Problems Dijkstra’s Algorithm
SLIDE 16
8.2. Shortest Path Problems Dijkstra’s Algorithm
SLIDE 17
8.2. Shortest Path Problems Dijkstra’s Algorithm
SLIDE 18
8.2. Shortest Path Problems Dijkstra’s Algorithm
SLIDE 19 Problem: Determine the shortest routes from the origin to all
- destinations. The arc lengths are times of travel between cities.
The Shortest Path Problem Example 2
19
SLIDE 20 Network Representation
The Shortest Path Problem Example
20
SLIDE 21 [0*, 16, 9, 35, inf., inf., inf.] Label 3 as permanent: [0*, 16, 9*, 35, inf., inf., inf.] Update labels for connected nodes: [0*, 16, 9*, 24, inf., 31, inf.] Label 2 as permanent: [0*, 16*, 9*, 24, inf., 31, inf.] Update labels for connected nodes: [0*, 16*, 9*, 24, 41, 31, inf.] Label 4 as permanent:
The Shortest Path Problem Example
21
SLIDE 22 [0*, 16*, 9*, 24*, 41, 31, inf.] Update labels for connected nodes: [0*, 16*, 9*, 24*, 38, 31, 43] Label 6 as permanent: [0*, 16*, 9*, 24*, 38, 31*, 43] Update labels for connected nodes: [0*, 16*, 9*, 24*, 38, 31*, 43] Label 5 as permanent: [0*, 16*, 9*, 24*, 38*, 31*, 43] Update labels for connected nodes:
The Shortest Path Problem Example
22
SLIDE 23 [0*, 16*, 9*, 24*, 38*, 31*, 43*]. Work backwards: 43-31 = 8 NO, 43-38 = 5 NO, 43-24 = 19 YES Go back to node 4: 24-9 = 15 YES Go back to node 3: 9-0 = 9 YES Shortest path from node 1 to node 7 : 1-3-4-7 with length 43.
The Shortest Path Problem Example
23
SLIDE 24 Network with Optimal Routes
The Shortest Path Problem Example
24
SLIDE 25 Shortest Travel Time from Origin to Each Destination
The Shortest Path Problem Example
25
SLIDE 26 Formulation as a 0 - 1 integer programming problem: xij = 1 if branch (i,j) is selected as part of the shortest route, and 0 if it is not selected. Minimize Z = 16x12 + 9x13 + 35x14 + 12x24 + 25x25 + 15x34 + 22x36 + 14x45 + 17x46 + 19x47 + 8x57 + 14x67 subject to: x12 + x13 + x14= 1 x12 - x24 - x25 = 0 x13 - x34 - x36 = 0 x14 + x24 + x34 - x45 - x46 - x47 = 0 x25 + x45 - x57 = 0 x36 + x46 - x67 = 0 x47 + x57 + x67 = 1 xij = 0 or 1
The Shortest Path Problem Example – Mathematical Model
26
SLIDE 27 8.2. Shortest Path Problems
Example 3: I have just purchased (at time 0) a new car for $12,000. To avoid the high maintenance costs associated with an older car, I may trade in my car and purchase a new car. At any time, it costs $12,000 to purchase a new car. My goal is to minimize the net cost (purchasing costs + maintenance costs - money received in trade-ins) incurred during the next five years. Formulate this problem as a shortest-path problem.
Age of Car (Years) Annual Maintenance cost Age of Car (Years) Trade-in Price
$2,000 1 $7,000 1 $4,000 2 $6,000 2 $5,000 3 $2,000 3 $9,000 4 $1,000 4 $12,000 5 $0
SLIDE 28 8.2. Shortest Path Problems
Example 3 solution: Our goal is to minimize the net cost incurred during the next five
- years. Our network will have six nodes. Node i is the beginning of
year i and for i<j, an arc (i,j) corresponds to purchasing a new car at the beginning of year i and keeping it until the beginning of year j. The length of arc (i,j) (call it cij) is the total net cost incurred from year i to j. etc.
SLIDE 29
8.2. Shortest Path Problems
Example 3 solution: We now see that the length of any path from node 1 to node 6 is the net cost incurred during the next five years corresponding to a particular trade-in strategy. For example, suppose I trade in the car at the beginning of year 3 and next trade in the car at the end of year 5 (the beginning of year 6). This strategy corresponds to the path 1–3–6 in the graph. Exercise: Solve this shortest path problem using Dijkstra’s!
SLIDE 30
8.3. Maximum Flow Problems
Many situations can be modeled by a network in which the arcs may be thought of as having a capacity that limits the quantity of a product that may be shipped through that arc. In these situations, it is often desired to transport the maximum amount of flow from a starting point (called the source) to a terminal point (called the sink). Such problems are called maximum flow problems. We will see the LP model and Ford-Fulkerson/Augmented Path method for solving the maximum flow problems.
SLIDE 31 8.3. Maximum Flow Problems
Example: Sunco Oil wants to ship the maximum possible amount
- f oil (per hour) via pipeline from node so to node si. The various
arcs represent pipelines of different diameters. The maximum number of barrels of oil (millions of barrels per hour) that can be pumped through each arc is shown. Formulate an LP that can be used to determine the maximum number of barrels of oil per hour.
SLIDE 32
8.3. Maximum Flow Problems
Example (cont.):
SLIDE 33
8.3. Maximum Flow Problems
Example (cont.): Artificial arc
SLIDE 34
8.3. Maximum Flow Problems
Example (cont.):
SLIDE 35
8.3. Maximum Flow Problems
Example: Fly-by-Night Airlines must determine how many connecting flights can be arranged between Juneau, Alaska, and Dallas, Texas daily. Connecting flights must stop in Seattle and then stop in Los Angeles or Denver. Because of limited landing space, Fly-by-Night is limited to making the number of daily flights between pairs of cities shown in Table 9. Set up a maximum-flow problem whose solution will tell the airline how to maximize the number of connecting flights daily from Juneau to Dallas.
SLIDE 36
8.3. Maximum Flow Problems
Network for the problem: Exercise: Write the LP for the model.
SLIDE 37 8.3. Maximum Flow Problems
Example: Five men and five women are at a dance. The goal of the matchmaker is to match each woman with a man in a way that maximizes the number of people who are matched with compatible mates. Table 10 describes the compatibility of the
- couples. Draw a network that makes it possible to represent the
problem of maximizing the number of compatible pairings as a maximum-flow problem.
SLIDE 38
8.3. Maximum Flow Problems
Network:
SLIDE 39 8.3. Maximum Flow Problems
- The Ford–Fulkerson Method
Assume a feasible flow has been found. Given a feasible flow, how can we tell if it is an optimal flow (max x0), if it is nonoptimal, how can we modify it to increase the flow?
39
SLIDE 40
8.3. Maximum Flow Problems
The Ford–Fulkerson Method
SLIDE 41 8.3. Maximum Flow Problems
The Ford–Fulkerson Method
If the labeling process results in the sink being labeled, then there will be a chain of arcs (call it C) leading from the source to the sink. By adjusting the flow of the arcs in C, we can increase the total flow from source to sink. Note: Labeling a node means establishing a chain from the source to the node.
SLIDE 42
8.3. Maximum Flow Problems
The Ford–Fulkerson Method
SLIDE 43
8.3. Maximum Flow Problems
The Ford–Fulkerson Method
SLIDE 44
8.3. Maximum Flow Problems
The Ford–Fulkerson Method
SLIDE 45
8.3. Maximum Flow Problems
The Ford–Fulkerson Method
SLIDE 46
8.3. Maximum Flow Problems
The Ford–Fulkerson Method
SLIDE 47
8.3. Maximum Flow Problems
The Ford–Fulkerson Method
SLIDE 48 8.3. Maximum Flow Problems
Example: Sunco Oil
- Try to label the sink: Label the source, and then arc (so, 1) and
node 1; then label arc (1, 2) and node 2; finally, label arc (2, si) and node si.
- Thus, C = (so, 1)–(1, 2)–(2, si). Each arc in C is a forward arc, so
increase the flow through each arc in C by min (2, 3, 2) = 2 units.
SLIDE 49
8.3. Maximum Flow Problems
Example: Sunco Oil Label arc (so, 2) and node 2 (thus (so, 2) is a forward arc). Then label arc (1, 2) and node 1. Arc (1, 2) is a backward arc, because node 1 was unlabeled before we labeled arc (1, 2), and arc (1, 2) is in R. Nodes 1 and 2 are labeled, so label arc (1, 3) and node 3. Arc (1, 3) is a forward arc, because node 3 has not yet been labeled. Finally label arc (3, si) and node si. Arc (3, si) is a forward arc, because node si has not yet been labeled.
SLIDE 50 8.3. Maximum Flow Problems
Example: Sunco Oil We have now labeled the sink via the chain C = (so, 2) - (1, 2) - (1, 3)
- (3, si). Except arc (1, 2), all arcs in the chain are forward arcs.
Because i(so, 2) = 3; i(1, 3) = 4; i(3, si) = 1; and r(1, 2) = 2, increase the flow on all forward arcs in C by 1 and decrease the flow in all backward arcs by 1.
SLIDE 51
8.3. Maximum Flow Problems
Example: Sunco Oil
SLIDE 52
8.3. Maximum Flow Problems
Example:
SLIDE 53
8.3. Maximum Flow Problems
Example: The minimum cut (with capacity 7) corresponds to nodes 1, 3, and si and consists of arcs (so, 1), (so, 3) and (2, 3).
SLIDE 54
Problem: How many tram trips can we make from location O to location T if the number of tram trips between any two stations is limited?
8.3. Maximum Flow Problems
SLIDE 55
An augmenting path: Directed path from source to sink in the residual network such that every arc on it has positive residual capacity. Residual capacity of the augmenting path: The minimum residual (remaining) arc capacity on the augmenting path. This is the maximum amount that we can send through that path from source to the sink.
Augmenting Path Algorithm
SLIDE 56 56
Augmenting Path Algorithm
SLIDE 57 Example 1
Iteration Iteration 1 O-B-E-T Iteration 2 O-A-D-T
Iteration 3 O-A-B-D-T Iteration 4 O-B-D-T
SLIDE 58
Iteration 5 O-C-E-D-T Iteration 6 O-C-E-T Iteration 7 O-C-E-B-D-T
SLIDE 59
Example 2
Network of a railway system: Maximize the number of trains from Omaha to St. Louis.
SLIDE 60
Augmenting path: 1-2-5-6, Flow = 4
Example 2
SLIDE 61
Augmenting path: 1-4-6, Flow = 4 + 4 =8
Example 2
SLIDE 62
Augmenting path: 1-3-6, Flow = 8 + 6 = 14
Example 2
SLIDE 63
Augmenting path: 1-3-4-6, Flow = 14 + 1 = 15
Example 2
SLIDE 64
Optimal Solution: Maximum Flow = 15
Example 2
SLIDE 65 Finding an Augmented Path
- Find all nodes directly connected to the source with arcs
having positive residual capacities.
- From each of these nodes, find new ones that are directly
connected to them with such arcs.
- Continue to fan-out in this manner, if an augmenting path
exists, you will find it!
SLIDE 66
Max-flow-min-cut Theorem Applied to Seervada Park Example
Maximum Flow = Minimum Cut = 14