1 / 38

Lecture 7 All-Pairs Shortest Paths

Lecture 7 All-Pairs Shortest Paths. All-Pairs Shortest Paths. Path Counting Problem. Adjacency Matrix. 1. 3. 2. 1. 2. 3. 1. 2. 3. Theorem. Proof . We prove it by induction on k. k =1 True!. 1. 3. 2. 1. 2. 3. 1. 2. 3. Induction Step.

Download Presentation

Lecture 7 All-Pairs Shortest Paths

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. Lecture 7 All-Pairs Shortest Paths

  2. All-Pairs Shortest Paths

  3. Path Counting Problem

  4. Adjacency Matrix

  5. 1 3 2 1 2 3 1 2 3

  6. Theorem Proof. We prove it by induction on k.

  7. k=1 True! 1 3 2 1 2 3 1 2 3

  8. Induction Step

  9. All-Pairs Shortest Pathswith at most k edges

  10. Recursive formula Proof.

  11. Case 1. The path with length contains at most edges. Case 2. the path with length contains exactly edges.

  12. Key Observation

  13. Dynamic Program

  14. Speed Up dynamic Program

  15. Idea

  16. Weighted Adjacency Matrix

  17. 1 4 5 6 3 2 1 2 3 1 2 3

  18. A New Multiplication

  19. Associative Law

  20. Theorem Proof. We prove it by induction on k.

  21. 1 k=1 True! 4 5 6 3 2 1 2 3 1 2 3

  22. Induction Step

  23. All-Pairs Shortest Paths Theorem Proof

  24. How to Compute

  25. Lemma

  26. Theorem

  27. Theorem

  28. Floyd-Warshall Algorithm

  29. Observation

  30. Dynamic Program

  31. Theorem

  32. Theorem

  33. What we learnt in this lecture? • The relationship between shortest path and matrix multiplication. • Faster-All-Pairs-Shortest-Pathsalgorithm • Floyd-Warshall algorithm.

  34. Puzzle 1

  35. Puzzle 2

  36. Puzzle 3

More Related