vertices : start=1, end=5 heap = 1 0 xxxxxxx red 2 7 xxxxxxx red 3 9 xxxxxxx red 4 20 5 1000 6 11 previous = { 6:3, 3:1, 2:1, 4:3} LOOP 1st time vertex, distance = 1,0 2nd time vertex, distance 2, 7 neighbors of 2: 3,4 vertex 3: old_distance 9 new_distance 7+10 vertex 4: old_distance 1000 new_distance 22 3rd time vertex, distance 3, 9 ; neighbors of 3 : 1 no,2 no, 4,6 vertex 4: old : 22 new : 9 + 11 = 20 vertex 6: old : 14 new through 3: 9+2 = 11