Shortest Paths Discrete Mathematics and Its Applications (7th Edition)

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
22C:19 Discrete Math Graphs Fall 2014 Sukumar Ghosh.
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.
1Other Network ModelsLesson 6 LECTURE SIX Other Network Models.
1 Network Models Chapter 4 2 For a given network find the path of minimum distance, time, or cost from a starting point, the start node, to a destination,
CS 206 Introduction to Computer Science II 03 / 27 / 2009 Instructor: Michael Eckmann.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 CHAPTER 4 - PART 2 GRAPHS 1.
ITEC200 – Week 12 Graphs. 2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study.
1 Processing & Analysis of Geometric Shapes Shortest path problems Shortest path problems The discrete way © Alexander & Michael Bronstein, ©
CSC 213 Lecture 23: Shortest Path Algorithms. Weighted Graphs Each edge in weighted graph has numerical weight Weights can be distances, building costs,
Chapter 9: Greedy Algorithms The Design and Analysis of Algorithms.
The Theory of NP-Completeness
1 Graphs ORD DFW SFO LAX Many slides taken from Goodrich, Tamassia 2004.
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
Chapter 9 Graph algorithms Lec 21 Dec 1, Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
Euler and Hamilton Paths
22C:19 Discrete Math Graphs Spring 2014 Sukumar Ghosh.
Ch. 11: Optimization and Search Stephen Marsland, Machine Learning: An Algorithmic Perspective. CRC 2009 some slides from Stephen Marsland, some images.
May 5, 2015Applied Discrete Mathematics Week 13: Boolean Algebra 1 Dijkstra’s Algorithm procedure Dijkstra(G: weighted connected simple graph with vertices.
1 Network Models Chapter 4 2 For a given network find the path of minimum distance, time, or cost from a starting point, the start node, to a destination,
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
EECS 203: It’s the end of the class and I feel fine. Graphs.
Graph Theory Hamilton Paths and Hamilton Circuits.
May 1, 2002Applied Discrete Mathematics Week 13: Graphs and Trees 1News CSEMS Scholarships for CS and Math students (US citizens only) $3,125 per year.
Euler and Hamilton Paths
Shortest Path Problems Dijkstra’s Algorithm. Introduction Many problems can be modeled using graphs with weights assigned to their edges: Airline flight.
Shortest Paths Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 8.6 Based on slides from Chuck Allison, Michael T.
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
CHAPTER 13 GRAPH ALGORITHMS ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH, TAMASSIA.
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.
Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.
Shortest Path Dr. Yasir. Weighted Graphs In many applications, each edge of a graph has an associated numerical value, called a weight. Usually, the edge.
Limitation of Computation Power – P, NP, and NP-complete
Hamilton Paths and Hamilton Circuits
Excursions in Modern Mathematics Sixth Edition
EECS 203 Lecture 19 Graphs.
Shortest Path Problems
Shortest Path 6/18/2018 4:22 PM Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia,
Hard Problems Introduction to NP
Agenda Lecture Content: Introduction to Graph Path and Cycle
EECS 203 Lecture 20 More Graphs.
Discrete Maths 9. Graphs Objective
Graphs.
Shortest Paths Discrete Mathematics and Its Applications (7th Edition)
Discrete Mathematics and Its Applications (5th Edition)
Graph Theory.
Foundations of Discrete Mathematics
Graphs Chapter 11 Objectives Upon completion you will be able to:
Shortest Path.
Analysis and design of algorithm
Chapter 13 Graph Algorithms
Shortest Path Algorithms
Dijkstra’s Shortest Path Algorithm Neil Tang 03/25/2008
Shortest Path Problems
Discrete Mathematics and Its Applications (5th Edition)
Minimum Spanning Tree Neil Tang 4/3/2008
Hamilton Paths and Hamilton Circuits
Dijkstra’s Shortest Path Algorithm Neil Tang 3/2/2010
Euler and Hamiltonian Graphs
The Theory of NP-Completeness
Discrete Mathematics and Its Applications (5th Edition)
Graphs CS 2606.
Graph Theory Relations, graphs
Spanning Trees Lecture 20 CS2110 – Spring 2015.
Shortest Paths Discrete Mathematics and Its Applications (8th Edition)
Shortest Paths Discrete Mathematics and Its Applications (7th Edition)
Discrete Mathematics and Its Applications (5th Edition)
Chapter 9 Graph algorithms
Shortest Paths Discrete Mathematics and Its Applications (7th Edition)
Presentation transcript:

Shortest Paths Discrete Mathematics and Its Applications (7th Edition) Text Discrete Mathematics and Its Applications (7th Edition) Kenneth H. Rosen Chapter 10.6 Instructor: Longin Jan Latecki latecki@temple.edu Some slides from Chuck Allison, Michael T. Goodrich, and Roberto Tamassia

Weighted Graphs Graphs that have a number assigned to each edge are called weighted graphs. SF LA DEN CHI ATL MIA BOS NY

Weighted Graphs MILES SF LA DEN CHI ATL MIA BOS NY 860 2534 191 1855 722 908 957 760 606 834 349 2451 1090 595

Weighted Graphs FARES SF LA DEN CHI ATL MIA BOS NY $129 $79 $39 $99 $59 $69 $89 $79 $99 $89 $39 $129 $69

Weighted Graphs FLIGHT TIMES SF LA DEN CHI ATL MIA BOS NY 4:05 2:10 0:50 2:55 1:50 2:10 2:20 1:55 1:40 2:00 3:50 2:45 1:15 1:30

Weighted Graphs A weighted graph is a graph in which each edge (u, v) has a weight w(u, v). Each weight is a real number. Weights can represent distance, cost, time, capacity, etc. The length of a path in a weighted graph is the sum of the weights on the edges. Dijkstra’s Algorithm finds the shortest path between two vertices.

% L = d (on previous slides) % S represents the “cloud” (such that v is adjacent to u)

Subpaths of shortest paths are shortest paths

Dijkstra Animation Youtube video: http://www.youtube.com/watch?v=gdmfOwyQlcI Java animation: http://weierstrass.is.tokushima-u.ac.jp/ikeda/suuri/dijkstra/Dijkstra.shtml

Find a shortest path from a to z b d f z c e g 4 5 7 2 1 3 Find a shortest path from a to z a b c d e f g z S ∞ x 4(a) 3(a)

1 5 7 2 3 4 6 20 40 15 35 10 50 75 1 2 3 4 5 6 7 S ∞ x 15(1) 35(1) 20(1)

Theorems Dijkstra’s algorithm finds the length of a shortest path between two vertices in a connected simple undirected weighted graph G=(V,E). The time required by Dijkstra's algorithm is O(|V|2). It will be reduced to O(|E|log|V|) if heap is used to keep {vV\Si : L(v) < }, where Si is the set S after iteration i.

The Traveling Salesman Problem The traveling salesman problem is one of the classical problems in computer science. A traveling salesman wants to visit a number of cities and then return to his starting point. Of course he wants to save time and energy, so he wants to determine the shortest cycle for his trip. We can represent the cities and the distances between them by a weighted, complete, undirected graph. The problem then is to find the shortest cycle (of minimum total weight that visits each vertex exactly one).

The Traveling Salesman Problem Importance: Variety of scheduling application can be solved as a traveling salesmen problem. Examples: Ordering drill position on a drill press. School bus routing.

THE FEDERAL EMERGENCY MANAGEMENT AGENCY A visit must be made to four local offices of FEMA, going out from and returning to the same main office in Northridge, Southern California.

FEMA traveling salesman Network representation

40 2 3 25 35 50 40 50 1 4 45 65 30 80 Home

FEMA - Traveling Salesman Solution approaches Enumeration of all possible cycles. This results in (m-1)! cycles to enumerate for a graph with m nodes. Only small problems can be solved with this approach.

FEMA – full enumeration Possible cycles Cycle Total Cost 1. H-O1-O2-O3-O4-H 210 2. H-O1-O2-O4-O3-H 195 3. H-O1-O3-O2-O3-H 240 4. H-O1-O3-O4-O2-H 200 5. H-O1-O4-O2-O3-H 225 6. H-O1-O4-O3-O2-H 200 7. H-O2-O3-O1-O4-H 265 8. H-O2-O1-O3-O4-H 235 9. H-O2-O4-O1-O3-H 250 10. H-O2-O1-O4-O3-H 220 11. H-O3-O1-O2-O4-H 260 12. H-O3-O1-O2-O4-H 260 Minimum For this problem we have (5-1)! / 2 = 12 cycles. Symmetrical problems need to enumerate only (m-1)! / 2 cycles.

FEMA – optimal solution 40 2 3 25 35 50 40 1 50 4 45 65 30 80 Home

The Traveling Salesman Problem Finding the shortest cycle is different than Dijkstra’s shortest path. It is much harder too, no algorithm exists with polynomial worst-case time complexity! This means that for large numbers of vertices, solving the traveling salesman problem is impractical. The problem has theoretical importance because it represents a class of difficult problems known as NP-hard problems. In these cases, we can use efficient approximation algorithms that determine a path whose length may be slightly larger than the traveling salesman’s path.