Facilities Planning Objectives and Agenda: 1. Examples of Shortest Path Problem 2. Finding shortest paths: Dijkstra’s method 3. Other applications of Shortest.

Slides:



Advertisements
Similar presentations
Single Source Shortest Paths
Advertisements

* Bellman-Ford: single-source shortest distance * O(VE) for graphs with negative edges * Detects negative weight cycles * Floyd-Warshall: All pairs shortest.
DIJKSTRA’s Algorithm. Definition fwd search Find the shortest paths from a given SOURCE node to ALL other nodes, by developing the paths in order of increasing.
Graphs: MSTs and Shortest Paths David Kauchak cs161 Summer 2009.
CS138A Single Source Shortest Paths Peter Schröder.
Design and Analysis of Algorithms Single-source shortest paths, all-pairs shortest paths Haidong Xue Summer 2012, at GSU.
chapter Single-Source Shortest Paths Problem Definition Shortest paths and Relaxation Dijkstra’s algorithm (can be viewed as a greedy algorithm)
Logistics Routing Plans: Max Flow Problem Objectives and Agenda: 1. Examples for flow of materials over limited capacity channels 2. Finding maximum flows:
1 Greedy 2 Jose Rolim University of Geneva. Algorithmique Greedy 2Jose Rolim2 Examples Greedy  Minimum Spanning Trees  Shortest Paths Dijkstra.
Chapter 9 Graph algorithms. Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
Shortest Path Problems
CSE 421 Algorithms Richard Anderson Dijkstra’s algorithm.
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.
Chapter 9 Graph algorithms Lec 21 Dec 1, Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
Graph Algorithms: Shortest Path We are given a weighted, directed graph G = (V, E), with weight function w: E R mapping.
CSE 780 Algorithms Advanced Algorithms SSSP Dijkstra’s algorithm SSSP in DAGs.
Facilities Planning Objectives and Agenda: 1. Different types of Facilities Planning Problems 2. Intro to Graphs as a tool for deterministic optimization.
© 2004 Goodrich, Tamassia Shortest Paths1 Shortest Paths (§ 13.6) Given a weighted graph and two vertices u and v, we want to find a path of minimum total.
CS 206 Introduction to Computer Science II 03 / 30 / 2009 Instructor: Michael Eckmann.
Dijkstra’s Algorithm Slide Courtesy: Uwash, UT 1.
CS 253: Algorithms Chapter 24 Shortest Paths Credit: Dr. George Bebis.
1 Shortest Path Algorithms. 2 Routing Algorithms Shortest path routing What is a shortest path? –Minimum number of hops? –Minimum distance? There is a.
The Shortest Path Problem
Graphs – Shortest Path (Weighted Graph) ORD DFW SFO LAX
Shortest Path Algorithms. Kruskal’s Algorithm We construct a set of edges A satisfying the following invariant:  A is a subset of some MST We start with.
1 GRAPHS - ADVANCED APPLICATIONS Minimim Spanning Trees Shortest Path Transitive Closure.
9/10/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova, K. Wayne Adam Smith Algorithm Design and Analysis L ECTURE 8 Greedy Graph.
CISC 235: Topic 11 Shortest Paths Algorithms. CISC 235 Topic 112 Outline Single-Source Shortest Paths Algorithm for Unweighted Graphs Algorithm for Weighted,
Week -7-8 Topic - Graph Algorithms CSE – 5311 Prepared by:- Sushruth Puttaswamy Lekhendro Lisham.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
Dijkstras Algorithm Named after its discoverer, Dutch computer scientist Edsger Dijkstra, is an algorithm that solves the single-source shortest path problem.
Shortest Paths C B A E D F
COSC 2007 Data Structures II Chapter 14 Graphs III.
Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2012 Lecture 10.
TCP Traffic and Congestion Control in ATM Networks
The single-source shortest path problem (SSSP) input: a graph G = (V, E) with edge weights, and a specific source node s. goal: find a minimum weight (shortest)
CSE 2331 / 5331 Topic 12: Shortest Path Basics Dijkstra Algorithm Relaxation Bellman-Ford Alg.
Lecture 23 CSE 331 Oct 24, Reminder 2 points for Piazza participation 3 points for mini-project.
Suppose G = (V, E) is a directed network. Each edge (i,j) in E has an associated ‘length’ c ij (cost, time, distance, …). Determine a path of shortest.
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
Single Source Shortest Paths Chapter 24 CSc 4520/6520 Fall 2013 Slides adapted from George Bebis, University of Reno, Nevada.
COMP108 Algorithmic Foundations Greedy methods
Shortest Paths and Minimum Spanning Trees
Single-Source Shortest Path
Lecture 23 CSE 331 Oct 26, 2016.
Disjoint Path Routing Algorithms
Minimum Spanning Trees
Algorithms (2IL15) – Lecture 5 SINGLE-SOURCE SHORTEST PATHS
Announcement 2: A 2 hour midterm (open book) will be given on March (Tuesday) during the lecture time. 2018/12/4.
Page 620 Single-Source Shortest Paths
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
CSE 373: Data Structures and Algorithms
Lecture 23 CSE 331 Oct 25, 2017.
Lecture 24 CSE 331 Oct 29, 2012.
Lecture 23 CSE 331 Oct 24, 2011.
Route Inspection Which of these can be drawn without taking your pencil off the paper and without going over the same line twice? If we introduce a vertex.
Slide Courtesy: Uwash, UT
Lecture 14 Shortest Path (cont’d) Minimum Spanning Tree
Chapter 24: Single-Source Shortest Paths
Weighted Graphs & Shortest Paths
Advanced Algorithms Analysis and Design
Slide Courtesy: Uwash, UT
Graph Algorithms: Shortest Path
Lecture 23 CSE 331 Oct 24, 2011.
Chapter 24: Single-Source Shortest Paths
Single-Source Shortest Path & Minimum Spanning Trees
Lecture 13 Shortest Path (cont’d) Minimum Spanning Tree
Chapter 9 Graph algorithms
More Graphs Lecture 19 CS2110 – Fall 2009.
Lecture 24 CSE 331 Oct 29, 2018.
Presentation transcript:

Facilities Planning Objectives and Agenda: 1. Examples of Shortest Path Problem 2. Finding shortest paths: Dijkstra’s method 3. Other applications of Shortest path problem

Example (Shortest Path Problem) What is the shortest route from Point A to Point B ? What if some roads are specified as 1-way only ?

A Graph-model of the Shortest Route problem Given a directed, weighted graph, G(V, E), start node s, end node v, Find the minimum total weight path from s to v Legend: Edge  direct road weight  road length nodes  road intersections ust = HKUST tko = Tseung Kwan O kt = Kowloon Tong ch = Choi Hung tkw = To Kwa Wan pe = Prince Edward hh = Hung Hom

Finding shortest paths: Dijkstra’s method Strategy: Find shortest path to one node; [all other nodes remain] Find shortest path to one of the remaining nodes; Repeat … until done Key concept: Relaxation How? Upper bound on distance from s to u: d[u] If Node k has the MIN upper bound  d[k] is the shortest distance from s to k Select node k to update upper bounds on remaining nodes

Relaxation.. 4 x y x y 1014 Relax( x, y) 4 x y x y Relax( x, y) cyan edge => current immediate predecessor of y is x Two cases of relaxation

Dijkstra’s method.. d[v i ] =  for each vertex; d[s] = 0; Make two lists: S = { }; Q = V Find the node, u, in Q with minimum d[u] Remove u from Q, and add u to S For each edge (u, v), Relax (u, v); update IP(v) Q = { } no yes DONE

Dijkstra’s method, Example Find shortest path from ust to hh

Dijkstra’s method, Example.. S = set of nodes for which we know the shortest distance from s Q = remaining nodes in the graph d[ust] = d*[ust] = 0 relax ust

Dijkstra’s method, Example... mark IP’s of tko, ch MIN d[u] in Q is tko d*[tko] = 6 relax tko

Dijkstra’s method, Example…. MIN d[u] in Q is ch d*[ch] = 7 relax ch NOTE: what happens to IP of kt?

Dijkstra’s method, Example….. MIN d[u] in Q is kt d*[kt] = 9 relax kt

Dijkstra’s method, Example…... MIN d[u] in Q is pe d*[pe] = 10 relax pe NOTE: what happens to IP of hh?

Dijkstra’s method, Example ….... MIN d[u] in Q is tkw d*[tkw] = 11 relax tkw

Dijkstra’s method, Example…….. Shortest path: reverse(hh  tkw  ch  ust) MIN d[u] in Q is hh d*[hh] = 12 relax hh DONE!

Dijkstra’s method, Proof PROPERTIES OF RELAXATION (i) d[u] is non-increasing: relaxation cannot increase d[u] (ii) d[u] cannot go below the shortest distance from s to u. connected graph  there is a shortest distance from s to u = d*[u] d[u] ≥ d*[u] (i) and (ii) =>Once we have found the shortest path to node u, d[u] will never change.

Dijkstra’s method, Proof.. What are such nodes ? (2) Next candidate: select min d[u] node from nodes in set Q (1) The elements of set S why? Q Q Let: d[v] be minimum among all nodes in Q There are two possibilities for the shortest path from s to v so … ?

Dijkstra’s method, concluding remarks What if the graph is undirected ? Replace each undirected edge with two directed edges 4 x y 4 x y 4  What if the some edge weights are negative?

Shortest path, Applications - Telephone routes - Which communication links to activate when a user makes a phone call, e.g. from HK to New York, USA. - Road systems design Problem: how to determine the no. of lanes in each road? Given: expected traffic between each pair of locations Method: Estimate total traffic on each road link assuming each passenger will use shortest path - Many other applications, including: - Finance (arbitrage), - Assembly line inspection systems design, …

Prof Edsger Dijkstra [ ] next topic: transportation flow planning – max flow