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

Graph class formation #10

Closed
wants to merge 3 commits into from
Closed

Graph class formation #10

wants to merge 3 commits into from

Conversation

ajeetdsouza
Copy link

Description

This adds the Hash representation of a Graph, very similar to the way it has been implemented in Python. Removed the type checking for Array since most duck-typed programming languages discourage it.

@ajeetdsouza ajeetdsouza closed this Dec 3, 2017
@ajeetdsouza ajeetdsouza reopened this Dec 3, 2017
@ajeetdsouza ajeetdsouza closed this Dec 3, 2017
@ajeetdsouza ajeetdsouza reopened this Dec 3, 2017
Copy link
Member

@athityakumar athityakumar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't the current state of the code seem to NOT work in case of transitive nodes? That is, this is an undirected graph. So, the below should work.

graph = NetworkX::Graph.new
graph.add_edge('Chennai', 'Bangalore', distance: 350)
graph['Bangalore']
#=> { 'Chennai' => { 'distance' => 1 } }

@athityakumar
Copy link
Member

Hey @ajeetdsouza! Really sorry for such a late review. As this PR's remote is not locatable, I'm closing this PR. If you'd like to work on the bug suggested above, please feel free to send a new PR. 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants