Skip to content

Relaxation in Bellman Ford #316

@choprasaurav7

Description

@choprasaurav7
  1. If I understand the algorithm correctly, since we need to do relaxation n-1 times shouldn't the loop run from i=0; i<=V-1 ?

  2. why do we need to check for negative cycle n-1 times again? Can we just loop over the edges to see if distance is decreasing and detect negative cycle?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions