Chapter 4 Network Algorithms Section 4.1 Shortest Paths Colleen Raimondi.

Slides:



Advertisements
Similar presentations
Decision Maths Networks Kruskals Algorithm Wiltshire Networks A Network is a weighted graph, which just means there is a number associated with each.
Advertisements

 Theorem 5.9: Let G be a simple graph with n vertices, where n>2. G has a Hamilton circuit if for any two vertices u and v of G that are not adjacent,
Shortest Paths Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 9.6 Based on slides from Chuck Allison, Michael T.
Discrete Math for Computer Science. Mathematical Model Real-world Problem Computerized Solution Abstract Model Transformed Model picture of the real worldpicture.
3/17/2003Tucker, Applied Combinatorics Section 4.2a 1 Network Flows Michael Duquette & Whitney Sherman Tucker, Applied Combinatorics, Section 4.2a, Group.
The Greedy Approach Chapter 8. The Greedy Approach It’s a design technique for solving optimization problems Based on finding optimal local solutions.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 8 Network models.
1 Chapter 9 Dynamic Programming General Problem-Solving strategy Was born in the 1950s (Bellman) Based on successive decomposition Leads to functional.
Design and Analysis of Algorithms Single-source shortest paths, all-pairs shortest paths Haidong Xue Summer 2012, at GSU.
3.3 Spanning Trees Tucker, Applied Combinatorics, Section 3.3, by Patti Bodkin and Tamsen Hunter.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 CHAPTER 4 - PART 2 GRAPHS 1.
1 Chapter Equivalence, Order, and Inductive Proof.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley. All rights reserved.
Chapter 3 The Greedy Method 3.
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
Applied Discrete Mathematics Week 12: Trees
CSC 2300 Data Structures & Algorithms April 17, 2007 Chapter 9. Graph Algorithms.
3 -1 Chapter 3 The Greedy Method 3 -2 The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each.
Section 4.2 Network Flows By Christina Touhey. The flow out of a equals the flow into z. Algorithm 1.Make vertex a: (0, ). 2.Scan the first vertex and.
The Theory of NP-Completeness
Shortest Path Problems Directed weighted graph. Path length is sum of weights of edges on path. The vertex at which the path begins is the source vertex.
MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 15, Friday, October 3.
3/29/05Tucker, Sec Applied Combinatorics, 4th Ed. Alan Tucker Section 4.2 Minimal Spanning Trees Prepared by Amanda Dargie and Michele Fretta.
2/28/2005Tucker, Sec Applied Combinatorics, 4th ed. Alan Tucker Section 4.1 Shortest Paths Prepared by Sarah Walker.
K-Coloring k-coloring: A k-coloring of a graph G is a labeling f: V(G)  S, where |S|=k. The labels are colors; the vertices of one color form a color.
The Shortest Path Problem
Quickest Route B St Li C La time matrix (minutes) Liskeard Launceston Callington St Austell Bodmin 32 What is the quickest route from.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley. All rights reserved.
KNURE, Software department, Ph , N.V. Bilous Faculty of computer sciences Software department, KNURE The distance.
1/22/03Tucker, Applied Combinatorics, Section EDGE COUNTING TUCKER, APPLIED COMBINATORICS, SECTION 1.3, GROUP B Michael Duquette & Amanda Dargie.
Copyright © Cengage Learning. All rights reserved.
Chapter 4: Finding the Shortest Path Lesson 1: Dijkstra’s Algorithm
Using Dijkstra’s Algorithm to Find a Shortest Path from a to z 1.
Dijkstra’s Algorithm. 2 Shortest-path Suppose we want to find the shortest path from node X to node Y It turns out that, in order to do this, we need.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
Trees and Distance. 2.1 Basic properties Acyclic : a graph with no cycle Forest : acyclic graph Tree : connected acyclic graph Leaf : a vertex of degree.
Shortest Path Problem Weight of the graph –Nonnegative real number assigned to the edges connecting to vertices Weighted graphs –When a graph.
Welcome to MM305 Unit 6 Seminar Larry Musolino
Shortest Path Problems Dijkstra’s Algorithm. Introduction Many problems can be modeled using graphs with weights assigned to their edges: Airline flight.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
Graphs A ‘Graph’ is a diagram that shows how things are connected together. It makes no attempt to draw actual paths or routes and scale is generally inconsequential.
Lecture 23 CSE 331 Oct 24, Reminder 2 points for Piazza participation 3 points for mini-project.
© The McGraw-Hill Companies, Inc., Chapter 12 On-Line Algorithms.
CSEP 521 Applied Algorithms Richard Anderson Winter 2013 Lecture 3.
Decision Maths 1 Shortest path algorithm Dijkstra’s Algorithm A V Ali :
CSE 421 Algorithms Richard Anderson Lecture 8 Optimal Caching Dijkstra’s algorithm.
11 -1 Chapter 12 On-Line Algorithms On-Line Algorithms On-line algorithms are used to solve on-line problems. The disk scheduling problem The requests.
Chapter 14 Section 3 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.
Trees.
Shortest Path Problems
COMP108 Algorithmic Foundations Greedy methods
Greedy Technique.
COMP 6/4030 ALGORITHMS Prim’s Theorem 10/26/2000.
Computability and Complexity
Discrete Mathematics and Its Applications (5th Edition)
Autumn 2016 Lecture 9 Dijkstra’s algorithm
Shortest Path.
Richard Anderson Lecture 9 Dijkstra’s algorithm
Shortest Path Problems
Discrete Mathematics and Its Applications (5th Edition)
Networks Kruskal’s Algorithm
Fundamental Data Structures and Algorithms
離散數學 DISCRETE and COMBINATORIAL MATHEMATICS
Single Source Shortest Paths Dijkstra’s Alg. (no negative lengths!)
Winter 2019 Lecture 9 Dijkstra’s algorithm
Dijkstra's Shortest Path Algorithm
The Greedy Approach Young CS 530 Adv. Algo. Greedy.
Autumn 2019 Lecture 9 Dijkstra’s algorithm
Presentation transcript:

Chapter 4 Network Algorithms Section 4.1 Shortest Paths Colleen Raimondi

Section 4.1 Shortest Paths In this chapter we present algorithms for the solution of two important network optimization problems. Network: a graph with a positive integer k(e) assigned to each edge e, it will typically represent the “length” of an edge, in units such as miles, or represent “capacity” of an edge, in units such as megawatts or gallons per minute. a b d c e Note: Edge (a,b) has a “capacity” of 5, so k(a,b)=5.

Section 4.1 Shortest Paths We begin with an algorithm for a relatively simple problem, finding a shortest path in a network from point a to point z. We say a shortest path because, in general, there may be more than one shortest path from a to z. So when we find a shortest path, we must be able to prove it is shortest without explicitly comparing it with all over a-z paths. Although the problem is now starting to sound difficult, there is still a straightforward algorithmic solution.

Section 4.1 Shortest Path Let variable m be a “distance counter.” For increasing values of m, label vertices whose minimal distance from a vertex a is m. The first label of a vertex will be the previous vertex on the shortest path from a to x. The second label of x will be the length of the shortest path from a to x. Dijkstra’s algorithm

Section 4.1 Shortest Path Shortest Path Algorithm 1.Set m=1 and label vertex a with (-,0) (the “-” represents a blank). 2.Check each edge e=(p,q) from some labeled vertex p to some unlabeled vertex q. Suppose p’s labels are [r,d(p)]. If d(p)+k(e)=m, label q with (p,m). 3.If all vertices are not yet labeled, increment m by one and go to Step 2. Otherwise go to Step 4. If we are only interested in a shortest path to z, then we go to Step 4 when z is labeled. 4.For any vertex y, a shortest path from a to y has length d(y), the second label of y. Such a path may be found by backtracking from y (using the first labels).

Section 4.1 Shortest Path a b d c e We want to find the shortest path from a to c. a(-,0) d(a,1) e(d,3) c(d,5) m=1; m=3; m=5; The shortest path would be a-d-c.

Section 4.1 Shortest Paths Note: The algorithm given previously has one significant inefficiency: if all sums d(p)+k(e) in Step 2 have values of at least m’>m, then the distance counter m should be increased immediately to m’.

Section 4.1 Example Example 1 Pg. 134 We want to find a shortest path from point a to point h. f i a r k j e d g h a(-,0) i(a,1) f(i,3) j(a,4) e(f,4) g(e,5) r(a,6) k(j,6) h(g,7) The shortest path is a-i-e-g-h. m=1; m=3; m=4; m=5; m=6; m=7

Section 4.1 Class Work As seen on page 135 #1 Use the shortest path algorithm to find the shortest path between vertex c and vertex m. i n b m r k j e d g h c 10 f f m(-,0) j(m,2) f(i,10) e(g,10) d(h,12) c(d,14) h(k,10) i(m,6) k(j,5) r(m,5)g(j,7) m=2; m=5; m=6; m=7; m=10; m=12; m=14 The shortest path is m-j-k-h-d-c.