12 views

Which of the following statement(s) is/are correct regarding Bellman-Ford shortest path algorithm?

P: Always finds a negative weighted cycle, if one exists.

Q: Finds whether any negative weighted cycle is reachable from the source.

1. $P$ only
2. $Q$ only
3. Both $P$ and $Q$
4. Neither $P$ nor $Q$
| 12 views