Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bellman Ford Modification #6781

Open
AmitMandhana opened this issue Dec 3, 2023 · 1 comment
Open

Bellman Ford Modification #6781

AmitMandhana opened this issue Dec 3, 2023 · 1 comment

Comments

@AmitMandhana
Copy link

The Bellman Ford's Algorithm finds the single source shortest path without a negative cycle but if there is negative weight cycle how can we detect it?

@berkay-top
Copy link
Contributor

Bellman Ford algorithm normally does n - 1 iterations. But if there is negative weight cycle, then it should relax even on the nth iteration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants