-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Adding floyd warshall #2735
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
Adding floyd warshall #2735
Conversation
Please use the given pull request format. |
@@ -0,0 +1,91 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are there two files
* 0 3 7 7 | ||
* 7 0 4 4 | ||
* 3 6 0 6 | ||
* 1 4 2 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add @author tag inside your header comment
#include <limits> | ||
|
||
const int INF = std::numeric_limits<int>::max(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be inside a graph namespace
*/ | ||
void test() { | ||
int N, M; | ||
std::cout << "Enter the number of vertices and edges: "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests should have predefined cases not user defined cases.
add cases for the following
- negative numbers
- empty array
- all numbers being INF
/** | ||
* @brief Main function that starts the program by invoking the test function. | ||
* | ||
* This function serves as the entry point of the program, calling the `test` function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check other files on how the main function is documented
duplicate of #2708 |
This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions! |
This pull request change Floyd.cpp to floyd-warshall algorithm in the graph module. The floyd-warshall algorithm is used to find the shortest paths between all pairs of vertices in a weighted graph. This implementation provides an efficient way to solve the shortest path problem for all pairs of vertices.
1.Adding negative power ring judgement.
2.Improve the name---Floyd to floyd_warshall (both the function name and file name)
3.Some tiny improvements