Skip to content

Add Bellman-Ford shortest path algorithm - #3218

Open
DeadJoker24 wants to merge 1 commit into
TheAlgorithms:masterfrom
DeadJoker24:add-bellman-ford
Open

Add Bellman-Ford shortest path algorithm#3218
DeadJoker24 wants to merge 1 commit into
TheAlgorithms:masterfrom
DeadJoker24:add-bellman-ford

Conversation

@DeadJoker24

Copy link
Copy Markdown

Description of Change

This PR adds an implementation of the Bellman-Ford shortest path algorithm.

The implementation:

  • Computes shortest paths from a single source vertex.
  • Supports graphs with negative edge weights.
  • Detects negative-weight cycles.
  • Includes multiple test cases using assert.
  • Follows the project's coding style and documentation format.

The implementation has been compiled and all included test cases pass successfully.

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:
Adds an implementation of the Bellman-Ford shortest path algorithm with negative cycle detection.

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

Successfully merging this pull request may close these issues.

1 participant