-
Notifications
You must be signed in to change notification settings - Fork 1
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
Create property-based tests for shortest paths algorithms #12
Labels
good first issue
Good for newcomers
Comments
Update after #46:
|
In #64 I added proptests that at least check that the algorithms do not panic. But the properties mentioned in the original post in this issue should still be added. |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create proptest tests for
ShortestPaths
using our graph generationstrategiesstrategies. Test both algorithms (Dijkstra, Bellman-Ford).UseDebugGraph
as the graph being generated because it provides very useful information in case of a failed assert.What properties to test?
One possibility is to implement a function for removing isolated vertices from a graph so that the tested graphs are connected. Then,For connected graphs after finishing an algorithm, it should be possible to reconstruct path and get distance from every vertex in the graph to the starting vertex. Also, the distances (not the paths, generally) should be equal as returned by Dijkstra and Bellman-Ford.The text was updated successfully, but these errors were encountered: