?

Algorithms & Data Structures

Free Version

Upgrade subject to access all content

Moderate

Using the Bellman-Ford Algorithm

ALGOR-0JWIPN

Given the graph below, what is the shortest distance from each node in the graph to the end node, node 6, after the second iteration of the Bellman-Ford Algorithm?

The answer is given by the "node number : path length".

Ashley Salzetti. Created for Albert.io. Copyright 2016. All rights reserved.

A

1 : Infinity
2 : 7
3 : Infinity
4 : Infinity
5 : 4
6 : 0

B

1 : 10
2 : 6
3 : 17
4 : 12
5 : 4
6 : 0

C

1 : 9
2 : 6
3 : 16
4 : 11
5 : 4
6 : 0

D

1 : 0
2 : 3
3 : 15
4 : 13
5 : 5
6 : 9