Lec24_Dijkstra

Lec24_Dijkstra - Dijkstra Algorithm Single-Source Shortest...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Dijkstra Algorithm
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Single-Source Shortest Paths We wish to find the shortest route between Binghamton and NYC. Given a NYS road map with all the possible routes how can we determine our shortest route? We could try to enumerate all possible routes. It is certainly easy to see we do not need to consider a route that goes through Buffalo.
Background image of page 2
Modeling Problem We can model this problem with a directed graph. Intersections correspond to vertices, roads between intersections correspond to edges and distance corresponds to weights. One way roads correspond to the direction of the edge. The problem: Given a weighted digraph and a vertex s in the graph : find a shortest path from s to t
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Case: The graph may have negative edges but no negative cycles. The shortest distance from s to t can be computed. The distance of a shortest path A B s t -3 1 8 d(s,t)=6
Background image of page 4
Shortest Path Algorithms Dijkstra’s algorithm does NOT allow negative edges. Uses a greedy heuristic. undirected/directed graph
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Solving Optimization Problems Solving strategy: 2 stages: First Stage: solves an intermediate problem and saves an additional data structure.
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 18

Lec24_Dijkstra - Dijkstra Algorithm Single-Source Shortest...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online