chapter 8 network models part 1 - ieu.edu.trhomes.ieu.edu.tr/ctacoglu/slides/ch08_01.pdfexample:...

66
Chapter 8 Network Models – Part 1 Prof. Dr. Arslan M. ÖRNEK

Upload: others

Post on 29-Jan-2021

23 views

Category:

Documents


0 download

TRANSCRIPT

  • Chapter 8 Network Models – Part 1

    Prof. Dr. Arslan M. ÖRNEK

  • 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

  • 3

    Network Optimization Models

    • Many network models: Special type of LP

    – Minimum cost network flow problem (MCNFP)

    • In this chapter:

    – Shortest path problem

    – Minimum spanning tree problem

    – Maximum flow problem

    – Project scheduling

  • 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

  • – 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

  • 8.1. Basic Definitions

    6

  • – 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

  • 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.

  • 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.

  • – 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

  • – 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

  • 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.

  • 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.

  • 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:

  • 8.2. Shortest Path Problems Dijkstra’s Algorithm

  • 8.2. Shortest Path Problems Dijkstra’s Algorithm

  • 8.2. Shortest Path Problems Dijkstra’s Algorithm

  • 8.2. Shortest Path Problems Dijkstra’s Algorithm

  • 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

  • Network Representation

    The Shortest Path Problem Example

    20

  • [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

  • [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

  • [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

  • Network with Optimal Routes

    The Shortest Path Problem Example

    24

  • Shortest Travel Time from Origin to Each Destination

    The Shortest Path Problem Example

    25

  • 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

  • 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

    0 $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

  • 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

  • 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!

  • 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.

  • 8.3. Maximum Flow Problems Example: Sunco Oil wants to ship the maximum possible amount of 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.

  • 8.3. Maximum Flow Problems Example (cont.):

  • 8.3. Maximum Flow Problems Example (cont.):

    Artificial

    arc

  • 8.3. Maximum Flow Problems Example (cont.):

  • 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.

  • 8.3. Maximum Flow Problems Network for the problem:

    Exercise: Write the LP for the model.

  • 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.

  • 8.3. Maximum Flow Problems Network:

  • 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

  • 8.3. Maximum Flow Problems The Ford–Fulkerson Method

  • 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.

  • 8.3. Maximum Flow Problems The Ford–Fulkerson Method

  • 8.3. Maximum Flow Problems The Ford–Fulkerson Method

  • 8.3. Maximum Flow Problems The Ford–Fulkerson Method

  • 8.3. Maximum Flow Problems The Ford–Fulkerson Method

  • 8.3. Maximum Flow Problems The Ford–Fulkerson Method

  • 8.3. Maximum Flow Problems The Ford–Fulkerson Method

  • 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.

  • 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.

  • 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.

  • 8.3. Maximum Flow Problems Example: Sunco Oil

  • 8.3. Maximum Flow Problems Example:

  • 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).

  • 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

  • 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

  • 56

    Augmenting Path Algorithm

  • Example 1 Iteration

    0

    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

  • Iteration 5

    O-C-E-D-T

    Iteration 6

    O-C-E-T

    Iteration 7

    O-C-E-B-D-T

  • Example 2

    Network of a railway system: Maximize the number of trains from Omaha to St. Louis.

  • Augmenting path: 1-2-5-6, Flow = 4

    Example 2

  • Augmenting path: 1-4-6, Flow = 4 + 4 =8

    Example 2

  • Augmenting path: 1-3-6, Flow = 8 + 6 = 14

    Example 2

  • Augmenting path: 1-3-4-6, Flow = 14 + 1 = 15

    Example 2

  • Optimal Solution: Maximum Flow = 15

    Example 2

  • 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!

  • Max-flow-min-cut Theorem Applied to Seervada Park Example

    Maximum Flow = Minimum Cut = 14