Download presentation
Presentation is loading. Please wait.
1
Chapter 6 Network Flow Models
2
Introduction Arrangement of paths connected at various points
Applications are highway systems, telephone networks, railroad systems, and television networks A railroad network consists of a number of fixed rail routes (paths) connected by terminals at various junctions 70% of the real world mathematical problems can be represented by network models Solved more efficiently through a variety of network optimization algorithms Different types of network models such as minimal spanning tree problem, shortest route problem, maximal flow problem, and critical path (CPM) problem and their solution algorithms as well.
3
Network Definitions Consists of two main components: nodes and arcs Nodes represent junction points arcs are used to connect the nodes and reflect the flow from one point to another Nodes are shown by circles, and arcs are represented by lines Denoted by (N,A) Network shown here is described as N={1,2,3,4} A={(1,2), (1,3), (2,3), (3,4), (4,2)} A value that represents a flow, distance, length of time, or cost is assigned to each arc A arc is directed if it allows positive flow in one direction and zero flow in the opposite direction Directed network has all directed arcs 3 4 1 2
4
Minimal Spanning Tree Algorithm
25 5 2 Objective is to connect all the nodes so that the total arc lengths are minimized Consider the following example Assume seven different communities in a city Design a rail system that connects all seven communities with the minimal amount of track Numbers on arcs represent the distance 8 16 12 14 35 19 1 4 7 15 14 17 9 3 22 6
5
Minimal Spanning Tree Algorithm
25 5 Starts at any node in the network, but conventionally at node 1 Choose the closest node to join our spanning tree Shortest arc from node 1 is node 3, with a length of 9 miles Indicate this arc with a heavy line Spanning tree consists of two nodes: 1 and 3 Next, select the closest node not presently in the spanning tree and that would be node 4 Repeat the process of selecting the closest node and that would be node 2 Spanning tree now consists of nodes 1, 2, 3, and 4 Next closest node is node 5 Next selection is node 7 Not connected node is node 6 Closest node is node 6 Completes the spanning tree, which connects all seven communities with 72 miles Same results could have been obtained if we had started at any of the six nodes other than node 1 2 8 16 12 14 35 19 1 4 7 15 14 17 9 3 22 6 1. node1 2. node3 3. node4 4. node2 5. node5 6. Node7 7. Node6
6
Summary of Steps Use following steps: Start with any node
Choose the closest node to the starting node Select the closest node not presently in the spanning tree Repeat step 3 until all nodes are joined
7
Computer Solution With TORA
Can use TORA to solve a minimal spanning tree problem Main Menu Network Models Minimal Spanning Tree Solve/Modify Menu Solve Problem Output Screen Select a Starting Node Use Next Iteration or All Iterations to generate the successive iterations
8
Shortest Route Problem
Objective is to determine the shortest distance between an originating point and several destination points A salesman travels each week from his office to six cities Different routes and the length of time are shown as: Wants to know the best routes to take to reach his destinations Network is identical to the network of the minimal spanning tree problem Because it is desired to see the difference between the results of the two types of network models 25 5 2 8 16 12 14 35 19 1 4 7 15 14 9 17 3 22 6
9
Shortest Route Algorithm Step 1
2 Two algorithms that solve the shortest route problems: Dijkstra’s algorithm and Floyd’s algorithm Dijkstra’s algorithm determines the shortest routes between the origin node and every other node Floyd’s algorithm determines the shortest route between any two nodes in the network Present an algorithm similar to Dijkstra’s algorithm but much more simpler Starts at node 1 (the origin) and determines the shortest time required to get to a directly connected node. Place node 1 in the permanent set to indicate that all routes to this node have been found Nodes 2, 3, and 4 are the nodes that are directly connected to node 1 and the shortest time from node 1 to these nodes would be 9 hours Determined our first shortest route from node 1 to node 3 in the network as indicated by a heavy line Enclose the shortest value in a box right close to node 3 and show it in the table by * 16 35 1 4 9 3 9 Permanent arc Time [1] 1-3 9* 1-4 35
10
Step 2 2 16 35 1 4 15 9 22 3 6 16 9 Permanent arc Time [1,3] 1-2 16*
Determine all the nodes that are directly connected to the nodes in the permanent set Nodes 2, 4, and 6 are directly connected to nodes 1 and 3 Determine the shortest route to the three nodes. Now focus on the arcs that start from the nodes in the permanent set Two arcs start from node and two arcs start from node 3 arc 1-2 with the shortest time of 16 hours will be selected Become part of the permanent set Travel times to node 6 and node 4 are 31 and 24 hours, respectively Determined by adding the arcs time of 22 and 15 hours to the shortest route time of 9 hours at node 3 Permanent set consists of nodes 1, 2, and 3 16 35 1 4 15 9 22 3 6 9 Permanent arc Time [1,3] * 1-4 35 3-4 24 3-6 31
11
Step 3 16 Determine the nodes are directly connected to the permanent set nodes Nodes 4, 5 and 6 are the nodes that are directly connected to the permanent set nodes Shortest route would be arc 3-4 with a time of 24 hours Shortest route to node 4 is from node 1 through node 3 Determined the shortest route to node 4, therefore it becomes part of the permanent set 25 2 5 16 12 35 1 4 15 24 9 22 3 6 9 Permanent arc Time [1, 2, 3] 2-4 28 2-5 41 3-4 24* 3-6 31
12
Step 4 16 Repeat the process of determining the nodes that are directly connected to the permanent set nodes These directly connected nodes are 5, 6, and 7 Five arcs lead from the permanent set nodes to their directly connected nodes 5, 6, and 7 arc 3-6 has the shortest cumulative of 31 hours Node 6 joins the permanent set. Eliminated the arcs from nodes 1 and 2 to node 4 Never consider arcs from the nodes within the permanent set 25 2 5 16 14 19 1 4 7 17 15 24 9 22 3 6 9 31 Permanent set arc Time [1, 2, 3, 4] 3-6 31* 4-5 38 4-7 43 4-6 41
13
Step 5 16 38 Observe that the nodes that are directly connected to our permanent set are nodes 5 and 7 arc 4-5 would be the shortest route, with cumulative time of 38 hours Node 5 joins the permanent set Determined the routes with the shortest times to nodes 1, 2, 3, 4, 5, and 6 2 5 16 14 19 1 4 7 15 24 14 43 9 22 3 6 9 31 Permanent set arc Time [1, 2, 3, 4, 6] 4-5 38* 4-7 43 6-7 45
14
Step 6 Only remaining node is node 7.
16 38 Only remaining node is node 7. Three arcs connect node 7 to the permanent set arc 4-7 has the shortest time of 43 hours Node 7 joins the permanent set 2 5 8 16 14 19 1 4 7 15 24 14 43 9 22 3 6 9 31 Permanent set arc Time [1, 2, 3, 4, 5, 6] * 6-7 45 5-7 46
15
Summary 16 38 Salesman should take the following routes from LA to each of the other six cities nodes with the following travel times 2 5 16 14 19 1 4 7 15 24 43 9 22 3 6 From LA to: Route Total Hours City 2 (node City 3 (node 3) City 4 (node 4) City 5 (node 5) City 6 (node 6) City 7 (node 7) 9 31
16
Summary of the Steps Establish a permanent set with the origin node and direct routes from the origin. Select the node with the shortest direct route from the origin and place it in the permanent set Determine all the nodes that are directly connected to the permanent set nodes Select the node with the shortest route from the group of nodes that are directly connected to the permanent set nodes Repeat steps 3 and 4 until all nodes have become part of the permanent set
17
Differences Reveal the differences between the minimal spanning tree and the shortest route models Shortest route network represents the shortest paths between the origin and each of the destination nodes, whereas the minimal spanning tree network shows how to connect all seven nodes so that the total distance is minimized
18
LP Formulation of the Shortest Rule Problem
Formulated as a 0-1 integer linear programming problem First define a set of decision variables for arcs in the network: xij= 0 if arc i-j is not selected as part of the shortest route and 1 if arc i-j is selected Objective function is formulated by minimizing the sum of the products of each arc value times the travel time Objective function is: Min Z= 16x12+9x13+ 35x14+12x24+ 25x25+15x34+ 22x36+9x13+ 14x45 +17x46+ 19x47+8x57+ 14x67 25 5 2 8 16 12 14 35 19 1 4 7 15 14 9 17 3 22 6
19
LP Formulation of the Shortest Rule Problem-Cont.
One constraint is constructed at each node indicating whatever comes into a node must also go out Referred to as conservation of flow Means that the salesman leaves node1 either through arc 1-2, arc 1-3, or arc 1-4 We have: x12+x13+ x14=1 At node 2, salesman enters through arc 1-2 and departs through arc 2-4 or arc 2-5 Conservation of flow at node 2 is: x12=x24+ x25 Constraints at nodes 3, 4, 5, 6, and 7 are constructed similarly using the conservation of flow . Thus, the resulting complete linear programming model, is summarized as follows: 25 5 2 8 16 12 14 35 19 1 4 7 15 14 9 17 3 22 6
20
LP Formulation of the Shortest Rule Problem-Cont.
Complete linear programming model is: Min Z= 16x12+9x13+ 35x14+12x24+ 25x25+15x34+ 22x36+9x13+ 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 25 5 2 8 16 12 14 35 19 1 4 7 15 14 9 17 3 22 6
21
Maximal Flow Problems Shortest route problem searched the shortest routes from the origin to other destinations, the minimal spanning tree found the shortest connected nodes Neither of these problems dealt with the capacity of an arc limited to a specific value Consider a net work problem in which arcs of the network have limited flow capacities Flow of water, gas, or oil through a network of pipelines; flow of forms through an office; flow of traffic through a road network; or flow of products through a production line system. Arcs of the network have limited flow capacities in each direction Known as maximal flow problems Objective is to maximize the total amount of flow from an origin to a destination Assume that the flow out of a node is equal to the flow into the node
22
An Example 2 5 output input 6 1 4 3
Consider the following example A network of pipes that transfers liquid chemical products Pipe has flow capacities in gallons per minute Node 1 represents the first processing center and node 5 is the final processing center Flow capacities are based on the direction of the flow Arc 1-2 shows a flow of 6 gallons per minute, arc 2-5 has a flow capacity of 8 gallons per minute, arc 4-6 has a flow capacity of 5 gallons per minute and so on Number on each arc to the immediate left of each node is the flow capacity in the opposite direction. Flow capacity from node 4 to node 3 is 2 gallons per minutes and zero from node 4 to node 1 Arc from node 1 to node 2 is referred to as a directed arc whereas arcs 2-4 and 3-4 are called undirected arcs Wants to know the maximum flow capacity in the system that can be transferred from processing centers 1 to 6. 8 2 3 5 4 output input 6 3 5 4 6 1 4 7 2 2 3 6
23
Maximal Flow Algorithm-1st Step
Choose any path arbitrarily from source (node 1) to final destination (node 6) and transfer as much as possible on that path Select the path as indicated by a heavy line. The maximum possible flow that can be transferred through this path is 4 gallon per minute because this amount is allowed from node 5 to 6. Thus the input of node 1 and the output of node 6 are increased by 4 gallons per minute. This actual flow along the path is also enclosed in a box at each node. 8 4 2 3 5 4 4 4 output input 6 3 5 4 6 4 1 4 4 7 2 2 3 6
24
Maximal Flow Algorithm-1st Step-Cont.
As part of this step, we adjust the remaining capacities along this path; that is two gallons per minute from node 1 to node 2, four gallons per minute from node 2 to node 5, and zero from node 5 to node 6. We also add this amount of actual flow to the values at the immediate left of each node (i.e. the flows in the opposite direction) on this path. Thus, the value of 4 is added to the zeros at nodes 2, 5, and 6. The reason for this is to compute the net flow along each arc. 4 4 2 4 3 4 5 4 output input 2 3 4 4 5 4 6 4 1 4 4 7 2 2 3 6
25
Step 2 Arbitrarily select another path
Select path 1-4-6, as shown by a heavy line The maximum flow is also 4 Increase the total flow through the network to 8 Update the available capacity to the immediate left and right of each node for each arc on this path 4 4 2 4 3 5 output input 2 3 4 4 1 4 6 8 1 4 8 4 4 7 2 2 3 6
26
Step 3 Arbitrarily select another path
Choose path 1-3-6, with a maximum possible flow of 6 Added to the previous flow of 8, which results in a total flow of 14 Subtracted from the arcs along path and added to the arcs in the opposite direction Number of paths are going to be restricted Cannot take the arc from node 3 to node 6 4 4 2 4 3 5 input output 2 3 4 4 1 4 6 1 4 14 14 1 2 6 6 2 6 6 3
27
Step 4 2 5 input output 1 6 1 4 15 15 1 1 3 Next path is 1-3-4-6
Available capacity along this path is one This increases the total amount flow from 14 gallons to 15 gallons per minutes. Updating the values to the immediate right and left of each node on this path would leave us any other path with available capacity. This completes the maximal flow algorithm for our example problem. Therefore, the maximum flow of liquid chemical is 15 gallons per minutes. The values in boxes also show the flows that will occur along each arc. 4 4 2 4 3 5 input output 2 3 4 4 1 1 4 6 1 4 15 15 1 2 6 1 1 2 6 3
28
Summary Find arbitrarily any path from the origin (source) node to the output (destination) node Choose the maximum possible flow along this path Add it to the values of input and output nodes Adjust the arc capacities at each node Add the maximal flow to the flow in the opposite direction Stop when it is no longer possible to find a path from source node to output node with flow capacities greater than zero
29
LP Formulation of the Maximum Flow Problem
Formulated as LP problem the same way as the shortest route problem Decision variables are as follows xij = flow along arc i-j and integer Assume the flows in the opposite directions are zero Create a new arc from node 6 back to node 1, x61 Reason is to have the same of amount flow along this arc and then back through the network to node 6 A continual flow through the network so that the most that comes out at node 6 is the most that can enter at node 1 Objective is to maximize the amount that flows from node 6 back to node 1, or Max x61
30
LP Formulation of the Shortest Rule Problem-Cont
In constructing the constraints, we follow the same premise as the shortest route problem At node 1, we have: x61=x12+x13+x14 Can be written as: x61-x12-x13-x14=0 Similarly, the constraint at node 2: x12-x24-x25=0 Must develop a set of constraints reflecting this restriction as: x12 ≤6, x13 ≤7, x14 ≤4, x24 ≤3, x25 ≤8, x34 ≤2, x36≤6. x46 ≤5, x56 ≤4, and x61 ≤17 Capacity for x61 can be any relatively large number
31
Complete Model Complete LP: Max x61 Subject to x61-x12-x13-x14=0
xij ≥0 and integer
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.