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

Created nx_notebook.ipynb #163

Merged
merged 5 commits into from
Mar 21, 2023
Merged

Created nx_notebook.ipynb #163

merged 5 commits into from
Mar 21, 2023

Conversation

navyagarwal
Copy link
Contributor

Completed task #8

@navyagarwal navyagarwal changed the title Create nx_notebook.ipynb Created nx_notebook.ipynb Mar 9, 2023
Copy link
Member

@paulitapb paulitapb left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks, @navyagarwal!

for source in G:
for dest in G:
if(nx.has_path(G, source, dest)):
print(source, " -> ", dest," : ", nx.shortest_path(G, source, dest))
Copy link
Member

Choose a reason for hiding this comment

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

You can also use nx.all_pairs_shortest_path and not generate all the source-dest combinations yourself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@paulitapb Noted!

@MridulS MridulS merged commit 3b56481 into networkx:main Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants