data structures - Can we apply Bellman ford algorithm to Undirected Graph -
i know bellman-ford algorithm works directed graphs info want know whether work un-directed graph? since un-directed graph not able observe cycles because parallel edges considered cycles!!. please clarify.
as matter of fact undirected graph directed graph.
you have specify edges {u, v} twice (u, v) , (v, u).
but don't forget, means border negative weight count loop. bellman-ford algorithm works on graphs don't contain cycles negative weights means un-directed graph mustn't contain edges negative weight.
if doesn't pretty fine utilize bellmann-ford.
algorithm data-structures graph graph-algorithm bellman-ford
No comments:
Post a Comment