You are on page 1of 12

by

MDM KHARSHIAH KHALID

Edsger Wybe Dijkstra (pronounced Deekstrah) (1930-2002) b. Rotterdam, Netherlands; worked in Amsterdam and also Texas, USA

Edsger Dijkstra studied Theoretical Physics at the University of Leiden before moving into the field of Computer Science. He worked for the Mathematisch Centrum in Amsterdam and then the Burroughs Corporation, which had progressed from making adding machines to typewriters and computers. He later held the Schlumberger Centennial Chair in Computer Sciences at the University of Texas.

Edsger Wybe Dijkstra (pronounced Deekstrah) (1930-2002) b. Rotterdam, Netherlands; worked in Amsterdam and also Texas, USA

In Graph Theory, he is known best for Dijkstras Algorithm for finding the Shortest Path between two points in a network, which he developed in 1959. This is a labelling procedure which identifies the smallest total path length to each vertex from the starting point. Tracing back from the finish vertex finds the shortest path itself. It is an example of a greedy algorithm because of the step during each iteration where the vertex with the lowest working value is chosen as the best and is then permanently labelled.

Order of labelling

Label (i.e Permanent label)

Working values

A
4

11

Step 1

8 B 2

Label start node S with permanent label (P-label) of 0.


5

3
S 1 0 6 1

D C 4

Step 2

3 A
4

11

8 6 B 2 1 D 4

3 S
1 0 6

For all nodes that can be reached directly from S, assign temporary labels (T-labels) equal to their direct distance from S

4
4 C

Step 3

2 3 A

11

3
S 1 0 6

6 B 2 1 D 4

4
4 C

Select the node with smallest T label and makes its label permanent. In this case the node is A. The P-label represents the shortest distance from S to that node. Put the order of labeling as 2.

2 3 A
4

11

14

Step 4 Consider all nodes that can be reached from A, that are B and T. Shortest route from S to B via A is 3+4 =7, but B is already labelled as 6 and its the best so far. The shortest route from S to T via A is 3 + 11 = 14. Put T-label as 14 in T

8 6 B 2 1 D 4

3
S 1 0 6

4
4 C

Step 5

2 3 A
4

11

14

8 6 B 2 1 D 4

3
S 1 0 6

4
3 4 C

Compare node T, B and C. The smallest T label is now 4 at C. Since this value cannot be improved, it becomes P-label of 4. Put the order of labeling at C as 3

Step 6

2 3 A
4

11

14

8 B 2 1 4 D

3 S
1 0 6

4 5

4
3 4 C

Consider all nodes that can be reached from C, that are B and D. Shortest route from S to B via C is 4+1 =5 which is shorter than 6. Change T label 6 to P label 5. The shortest route from S to D via C is 4 + 4 = 8. Put Tlabel as 8 in D. Compare B and D. B is less than D, so the next node is B. Put the order of labeling at B as 4

Step 7

2 3 A 3
4

11

13

14,13

8 B 2 1 4 D

3 S
1 0 6

4 5 6,5

4
3 4 C 4

5 7 8,7

Consider all nodes that can be reached from B; that are D and T. Shortest route from S to D via B is 5+2 =7 which is shorter than 8. Change T label 8 to P label 7. The shortest route from S to T via B is 5 + 8 = 13. This is smaller than 14 so change to 13 in T as T label. Compare T and D. D is less than T so chose D as the next node. Put the order of labeling as 5 in D

Step 8

2 3 A 3
4

11

12

14,13,12

8 B 2 1 4 D

3 S
1 0 6

4 5 6,5

4
3 4 C 4

5 7 8,7

The last node is T. Put the order of labeling as 6 in T. Compare the routes from S to T via A (3 + 11 =14), via B ( 5 + 8 =13) and via D (7 + 5 =12). It seems that the shortest route from S to T is via D. Change the T label in T (13) to P label with the value 12. Therefore the shortest way from S to T is SCBDT which is 12

You might also like