Add customized edge weight support for graphs.#78
Add customized edge weight support for graphs.#78zmy wants to merge 13 commits intoaalhour:masterfrom
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. |
aalhour
left a comment
There was a problem hiding this comment.
@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
longas edge weights.This PR allows customized edge weight types while keeps default edge weight type as long/Int64.