1 / 12

Weighted Graph Algorithms

Weighted Graph Algorithms . Weighted shortest path problem Dijkstra’s algorithm (single-source, non-negative edge weight) All pairs shortest path Warshall’s algorithm. Definition of a path . Consider a directed graph G=(V, E) with edge-weight function w: E R.

jhibbard
Télécharger la présentation

Weighted Graph Algorithms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Weighted Graph Algorithms • Weighted shortest path problem • Dijkstra’s algorithm (single-source, non-negative edge weight) • All pairs shortest path • Warshall’s algorithm

  2. Definition of a path • Consider a directed graph G=(V, E) with edge-weight function w: ER. • Weight of edge v1v2: w(v1,v2) • The weight of a path p=v1v2… vk is defined to be w(p)= sum w(vi, vi+1), i=1..k-1

  3. Shortest path • A shortest path from u to v is a path of minimum weight from u to v • There might be multiple paths from u to v • The shortest path weight from u to v is defined as

  4. Single source shortest path • Problem: from a given source vertex s, find the shortest path weights from s to all vertices in V. • If all edge weights w(u,v) are non-negative, all shortest path weights must exist • Idea: greedy • Maintain a set S of vertices whose shortest path weights from s are known. • At each step, add to S the vertex v, whose distance estimate from s is minimal • Update the distance estimates of all vertices adjacent to v.

  5. Dijkstra’s algorithm

  6. Running time analysis

  7. Running time analysis

  8. Unweighted shortest path problem • Dijkstra with negative weights

  9. Unweighted shortest path problem • Dijkstra with negative weights

More Related