Skip to content
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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

zmy
Copy link

@zmy zmy commented Aug 8, 2018

Original implementation only supports long as edge weights.
This PR allows customized edge weight types while keeps default edge weight type as long/Int64.

@aalhour
Copy link
Owner

aalhour commented Aug 16, 2018

Hi @zmy,

Thanks for your contribution. Can you please refactor the tests to reflect your changes?

Cheers,
Ahmad

@zmy
Copy link
Author

zmy commented Aug 20, 2018

Hi @zmy,

Thanks for your contribution. Can you please refactor the tests to reflect your changes?

Cheers,
Ahmad

Sure I am refactoring the tests, will add new commits soon :D

@zmy
Copy link
Author

zmy commented Aug 20, 2018

@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:

  • public static class GraphsBellmanFordShortestPaths
  • GraphsUndirectedWeightedDenseGraphTest

@aalhour
Copy link
Owner

aalhour commented Sep 20, 2018

Hello @zmy,

Sorry for the late reply, I was away on a long vacation. Can you maybe fix these two graphs tests?

@zmy
Copy link
Author

zmy commented Jul 26, 2019

@aalhour Sorry for the late reply. I've just fixed related tests. Please take a look.

@aalhour aalhour added data structure request Suggest a new data structure for this project optimization labels Nov 1, 2019
Copy link
Owner

@aalhour aalhour left a 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.

@aalhour
Copy link
Owner

aalhour commented Jan 22, 2020

Hi @zmy, any updates on this?

@zmy zmy requested a review from aalhour January 23, 2020 08:39
@zmy
Copy link
Author

zmy commented Jan 23, 2020

Hi @zmy, any updates on this?

Hi @aalhour , sorry for the late reply since I'm crazy busy. I've simplified the implementation as you requested. Please take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data structure request Suggest a new data structure for this project optimization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants