1

I understand that the Bellman-Ford Algorithm can solve the single-source shortest-paths problem. However, can it also be used to determine the longest path in an undirected, graph through first negating the weight of all the edges?

Adam Lee
  • 213
  • 1
  • 5
  • https://cs.stackexchange.com/q/17980/755, https://cs.stackexchange.com/q/57894/755, https://cs.stackexchange.com/q/88003/755, https://cs.stackexchange.com/q/2660/755, https://cs.stackexchange.com/q/125264/755 – D.W. Mar 04 '21 at 07:03
  • You'll need to define what you mean by "longest path". Does it have to be a simple path? Do you allow visiting the same vertex/edge more than once? In the future I encourage you to spend some time searching the site before asking; we have many prior questions that cover the longest path problem here. See https://meta.stackoverflow.com/q/261592/781723. – D.W. Mar 04 '21 at 07:04

0 Answers0