Can i apply same algo for undirected graph?

can i apply same algo for undirected graph?

@Vipin_coder,

Yes you can.

Specify the edges (u, v), twice (u, v) and (v, u).

Also any edge with a negative weight will count as a loop. As the Bellman-Ford algo works on graphs that don’t contain any cycles with negative weights, hence your un-directed graph should not contain any edges with negative weight.