Skip to content

Issue 762 shortest path hide nodes edges - #1011

Closed
francis-shuoch wants to merge 2 commits into
networkx:masterfrom
francis-shuoch:issue_762_shortest_path_hide_nodes_edges
Closed

francis-shuoch wants to merge 2 commits into
networkx:masterfrom
francis-shuoch:issue_762_shortest_path_hide_nodes_edges

Conversation

@francis-shuoch

Copy link
Copy Markdown
Contributor

I add the monkey patching context manager in a separate file named restrictions.py. I'm glad to hear your code reviews. About testing, I add some in the test_generics.py, because I think it duplicated if I also test them in test_weight.py or test_unweight.py, etc. Let me know if you have concerns about adding more tests. ;)

… dense.py not using monkey patching. Because the algorithms in dense.py doesn't fit the neighbor_iter() paradigm.
@hagberg

hagberg commented Nov 22, 2013

Copy link
Copy Markdown
Member

The way I had in mind to use the context manager was to not modify any of the shortest path functions and instead do e.g.

with hidden_nodes(G, nodes=exclude) as H:
    path = nx.shortest_path(H,source,target)

It seems the basic concept can work in this specific case. The hidden edges function should be separate I think.

@hagberg hagberg added this to the networkx-2.0 milestone Apr 19, 2014
@hagberg hagberg self-assigned this Apr 19, 2014
@hagberg

hagberg commented Feb 2, 2016

Copy link
Copy Markdown
Member

I suggest we implement a "view" concept instead of this approach #1896

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.

2 participants