Skip to content

feat: add algorithm to find the number of paths in a graph using DFS#2815

Merged
realstealthninja merged 16 commits intoTheAlgorithms:masterfrom
adi776borate:add/number_of_paths
Aug 17, 2025
Merged

feat: add algorithm to find the number of paths in a graph using DFS#2815
realstealthninja merged 16 commits intoTheAlgorithms:masterfrom
adi776borate:add/number_of_paths

Conversation

@adi776borate
Copy link
Copy Markdown
Contributor

Description of Change

  • Added a new function to count the number of paths in a graph.
  • Implemented a test case to validate the functionality of the new function.
  • Improved documentation for better understanding of the algorithm.

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: The new function counts the number of unique paths between two nodes in a graph. It can be particularly useful in graph-related problems where pathfinding is necessary.

@realstealthninja realstealthninja changed the title feat: add count_paths algorithm with a test case feat: add Depth first search Oct 12, 2024
Comment thread graph/number_of_paths.cpp
@adi776borate
Copy link
Copy Markdown
Contributor Author

I've updated the algorithm and added more test cases as per the feedback received. Please review the latest changes. Thank you!

Comment thread graph/number_of_paths.cpp Outdated
Comment thread graph/number_of_paths.cpp Outdated
Comment thread graph/number_of_paths.cpp Outdated
Comment thread graph/number_of_paths.cpp
Comment thread graph/number_of_paths.cpp
Copy link
Copy Markdown
Collaborator

@realstealthninja realstealthninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@realstealthninja realstealthninja added approved Approved; waiting for merge hacktoberfest-accepted Accepted to be counted towards Hacktoberfest labels Oct 31, 2024
@realstealthninja realstealthninja changed the title feat: add Depth first search feat: add algorithm to find the number of paths in a graph using DFS Aug 16, 2025
@realstealthninja realstealthninja merged commit b30bdd3 into TheAlgorithms:master Aug 17, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Approved; waiting for merge hacktoberfest-accepted Accepted to be counted towards Hacktoberfest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants