Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 7 All-Pairs Shortest Paths. All-Pairs Shortest Paths.

Similar presentations


Presentation on theme: "Lecture 7 All-Pairs Shortest Paths. All-Pairs Shortest Paths."— Presentation transcript:

1 Lecture 7 All-Pairs Shortest Paths

2 All-Pairs Shortest Paths

3 Path Counting Problem

4 Adjacency Matrix

5 1 2 3 1 2 3 123

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

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

8 Induction Step

9 All-Pairs Shortest Paths with at most k edges

10 Recursive formula Note: For i≠j,

11 Key Observation

12 Dynamic Program

13 Speed Up dynamic Program

14 Idea

15 Weighted Adjacency Matrix

16 1 2 3 1 2 3 123 4 6 5

17

18 A New Multiplication

19 Associative Law

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

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

22 Induction Step

23 All-Pairs Shortest Paths Theorem Proof

24 How to Compute

25 Lemma

26 Theorem

27

28 Floyd-Warshall Algorithm

29 Observation

30 Dynamic Program

31

32 Theorem

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

34 Puzzle 1

35 Puzzle 2

36 Puzzle 3


Download ppt "Lecture 7 All-Pairs Shortest Paths. All-Pairs Shortest Paths."

Similar presentations


Ads by Google