
Yes, the bellman ford algorithm is suppost to work for undirected graphs, however, it looks like there was a problem in the algorithm with respect to undirected graphs. The relax function did not take the undirectedness of the edges into account. I've fixed this problem and checked the fix into CVS. On Thu, 25 Jul 2002, Louis Lavery wrote: Louis> int main() Louis> { Louis> enum {A,B,Z}; Louis> char const name[] = "ABZ"; Louis> Louis> int const numVertex = static_cast<int>(Z); Also, the above makes numVertex == 2, which is not currect. You want numVertex == 3. Louis> Expected Output:- Louis> A: 0 A Louis> B: 11 A Louis> Louis> Actual Output:- Louis> A: 0 A Louis> B: 2147483647 B Here's the output I get now: A: 0 A B: 11 A Z: inf Z Cheers, Jeremy ---------------------------------------------------------------------- Jeremy Siek http://php.indiana.edu/~jsiek/ Ph.D. Student, Indiana Univ. B'ton email: jsiek@osl.iu.edu C++ Booster (http://www.boost.org) office phone: (812) 855-3608 ----------------------------------------------------------------------