Topic V Network Algorithms Shortest Path Minimum Spanning

  • Slides: 14
Download presentation
Topic V Network Algorithms Shortest Path Minimum Spanning Tree Maximum Flow Chapter(s): 9

Topic V Network Algorithms Shortest Path Minimum Spanning Tree Maximum Flow Chapter(s): 9

Network Algorithms • Many network optimization problems are actually special types of linear programming

Network Algorithms • Many network optimization problems are actually special types of linear programming problems – Types of network problems in this topic • Shortest-Path • Minimum Spanning Tree • Maximum Flow

Network Algorithms • Example Applications – Consider a park with a narrow, winding road

Network Algorithms • Example Applications – Consider a park with a narrow, winding road system for trams and park rangers • Problem 1: Determine which route from the park entrance to a given station has the smallest total distance for the operation of the trams • Problem 2: Determine where telephone lines should be laid to establish communication among all stations where total miles of lines is minimized • Problem 3: How to maximize the number of trips that can be made per day without violating the limits on any individual road (each road may have limit of number of tram trips per day)

Network Terminology • A network consists of a set of points and a set

Network Terminology • A network consists of a set of points and a set of lines connecting certain pairs of the points – The points are called nodes – The lines are called arcs (or links or edges) • The arcs of a network may have some type of flow through them – If flow through an arc is allowed in only one direction, the arc is said to be a directed arc • A network with only directed arcs is a directed network – If flow is allowed in either direction, the arc is said to be undirected • A network with only undirected arcs is an undirected network

Network Terminology • A path between two nodes is a sequence of distinct arcs

Network Terminology • A path between two nodes is a sequence of distinct arcs connecting these nodes – A path that begins and ends at the same node is called a cycle • Two nodes are connected if the network contains at least one path between them – A connected network is a network where every pair of nodes is connected – A connected network for all n nodes that contains no cycles is a spanning tree • Every spanning tree has n-1 arcs

Network Terminology • The maximum amount of flow that can be carried on a

Network Terminology • The maximum amount of flow that can be carried on a directed arc is referred to as the arc capacity – A supply node has the property that the flow out of the node exceeds the flow into the node – A demand node has the property where the flow into the node exceeds the flow out of the node – A transshipment node satisfies the conservation of flow, so flow in equals flow out

Shortest Path • Consider a connected network with two special nodes called the origin

Shortest Path • Consider a connected network with two special nodes called the origin and destination – Associated with each of the links is a nonnegative distance – Objective: find shortest path (minimum total distance) from the origin to the destination

Shortest Path • At each iteration, there a set of solved nodes and unsolved

Shortest Path • At each iteration, there a set of solved nodes and unsolved nodes – Solved nodes: shortest paths from origin to these nodes are known – Each link from solved node to unsolved node is a candidate • Identify unsolved node with the shortest connecting link

Shortest Path • At each iteration, there a set of solved nodes and unsolved

Shortest Path • At each iteration, there a set of solved nodes and unsolved nodes – Add the distance between the solved node and its candidate to the distance of the shortest path from the origin to the solved node • Total is shortest path to candidate node • Candidate node is now moved to solved group • Note: Should remember path by storing node that linked to the candidate – Initially, only origin is solved and other nodes are unsolved

Shortest Path • Notes – Finding shortest-path from origin to all nodes is performed

Shortest Path • Notes – Finding shortest-path from origin to all nodes is performed by iterating until all nodes are in solved group – Algorithm works with directed arcs

Minimum Spanning Tree • Minimum Spanning Tree Problem – Given nodes of a network

Minimum Spanning Tree • Minimum Spanning Tree Problem – Given nodes of a network and the potential links and positive length for each link • Design a network by inserting enough links to satisfy the requirement that there is a path between every pair of nodes • Satisfy the above requirement in a way that minimizes the total length of the links in the network

Minimum Spanning Tree • Minimum Spanning Tree Problem – Algorithm • Select any node

Minimum Spanning Tree • Minimum Spanning Tree Problem – Algorithm • Select any node arbitrarily and then connect it to the nearest distinct node • Identify the unconnected node that is closest to a connected node, and then connect these two nodes – Repeat until all nodes have been connected

Maximum Flow Problem • Maximum Flow Problem – Terminology • All flow through a

Maximum Flow Problem • Maximum Flow Problem – Terminology • All flow through a directed and connected network originates at one node called the source – Terminates at one other node called the sink – Remaining nodes are transshipment nodes • Flow through an arc is allowed only in the direction indicated by the arrowhead – Maximum amount of flow is given by the capacity of that arc – At source: all arcs point away from the node – At sink: all arcs point to the node • Objective is to maximize the total amount of flow from the source to the sink – Measured as amount leaving source or amount entering the sink

Maximum Flow Problem • After some flows have been assigned to the arcs, the

Maximum Flow Problem • After some flows have been assigned to the arcs, the residual network shows the remaining arc capacities (called residual capacities) for assigning additional flows – An augmenting path is a directed path from the source to the sink in the residual network such that every arc on this path has strictly positive residual capacity – Minimum of these paths is the residual capacity of the augmenting path because it represents the amount of flow that can feasibly be added to the entire path • The algorithm repeatedly selects some augmenting path and adds a flow equal to its residual capacity to that path in the original network • Continue until there are no more augmenting paths