shortest path algorithm n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Shortest Path Algorithm PowerPoint Presentation
Download Presentation
Shortest Path Algorithm

Loading in 2 Seconds...

play fullscreen
1 / 7

Shortest Path Algorithm - PowerPoint PPT Presentation


  • 100 Views
  • Uploaded on

Shortest Path Algorithm. This is called “Dijkstra’s Algorithm”. …pronounced “Dirk-stra”. Problem:. Find the shortest route from A to F. Step 1 Label the start vertex S with a permanent label of 0.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Shortest Path Algorithm' - yon


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
shortest path algorithm
Shortest Path Algorithm

This is called “Dijkstra’s Algorithm”

…pronounced “Dirk-stra”

slide2

Problem:

Find the shortest route from A to F

slide3

Step 1 Label the start vertex S with a permanent label of 0

Step 2 Put a temporary label on each vertex that can be reached directly from the vertex that has just received a permanent label. The temporary label must be equal to the sum of the permanent label and the weight of the arc linking it directly to the vertex. If there is already a temporary label at the vertex, it is only replaced if the new sum is smaller.

slide4

Step 3 Select the minimum temporary label and make it permanent.

Step 4 Repeat steps 2 and 3 until the destination vertex T receives its permanent label.

Step 5 Trace back from T to S including an arc AB whenever the permanent label of B  permanent label of A = the weight of AB, given that B already lies on the path.

slide6

Problem:

Find the shortest route from A to F

On the exam paper your diagram will look like this:

slide7

but 15 > 13 so ignore

15

B

3

7

D

5

13

8

7

13

16 – 13 = 3 so use DF

Now trace back from F

Third vertex is B

Fifth vertex is D

Sixth vertex is F

Second vertex is C

Fourth vertex is E

First vertex is A

3

13 – 9 = 4 so use CD

7

Label 13

Label 12

Label 7

Label 0

Label 16

Label 4

4 – 0 = 4 so use AC

A

1

0

F

6

16

17

16

5

9

Shortest Path is ACDF of length 16

4

Temporary Labels

5

C

2

4

E

4

12

9

4

13

12