-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add customized edge weight support for graphs. #78
base: master
Are you sure you want to change the base?
Conversation
Hi @zmy, Thanks for your contribution. Can you please refactor the tests to reflect your changes? Cheers, |
Sure I am refactoring the tests, will add new commits soon :D |
@aalhour It seems that some unit tests themselves are not well written. When running all the tests on my local machine, only the following two tests are related to graph data structure and failed:
|
Hello @zmy, Sorry for the late reply, I was away on a long vacation. Can you maybe fix these two graphs tests? |
@aalhour Sorry for the late reply. I've just fixed related tests. Please take a look. |
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.
@zmy - thanks for fixing the notes. Some of the changes shouldn't be there. The following data structures are unweighted on purpose so that the implementation remains very light and straightforward. Please remove the custom weight support from the following:
- DataStructures/Graphs/IGraph.cs
- DataStructures/Graphs/UnweightedEdge.cs
- DataStructures/Graphs/UndirectedDenseGraph.cs
- DataStructures/Graphs/UndirectedSparseGraph.cs
- DataStructures/Graphs/DirectedDenseGraph.cs
- DataStructures/Graphs/DirectedSparseGraph.cs
The reason behind this is that there is a Weighted
implementation for every one these data structures.
Hi @zmy, any updates on this? |
Original implementation only supports
long
as edge weights.This PR allows customized edge weight types while keeps default edge weight type as long/Int64.