edge_list and node_list behave unexpectedly in graph generators
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by running the dnx.pegasus_graph(2) reproduction with reversed node_list and the matching edge_list. Inspect the graph generator entry point and related generator behavior, then verify that node_list controls node order and edge_list controls edge order without changing the graph; check the interaction with minorminer.subgraph.find_subgraph(S, T).
Written by the indexing model from the issue text.
Description
Description
It is useful to permute node and edge orderings in graph creation for example to randomize the behaviour of otherwise deterministic methods.
- dwave_networkx graph node ordering doesn't seem to respond to the ordering of the node_list parameter.
- When the edge_list parameter is provided matching the default, the node_ordering is changed relative to the default.
To Reproduce
T = dnx.pegasus_graph(2)
node_list = list(T.nodes())
node_list.reverse()
T2 = dnx.pegasus_graph(2, node_list=node_list) # Same graph
print(T2.nodes()) # original ordering, ignores provided ordering.
edge_list = list(T1.edges())
node_list = list(T1.nodes())
T3 = dnx.pegasus_graph(2, node_list=node_list, edge_list=edge_list)
print(T3.nodes()) # Does not match T1.nodes(), which is unexpected.
Expected behavior
node_list should dictate node order, edge_list should dictate edge order.
Environment:
- OS: [Ubuntu 22.04.3 LTS]
- Python version: [e.g. 3.12.0]
Additional context
I'll make a pull request to correct this unless a good case can be made not to, don't really want to mess with these core generators unnecessarily.
I want to use in combination with minorminer.subgraph.find_subgraph(S, T) which deterministically searches for a subgraph. Reordering the target (T) nodes allows a more uniform distribution across the processor with respect to some source graph S.
- Dominant language
- Python
- Stars
- 94
- Forks
- 62
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dwavesystems/dwave-graphs
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dwavesystems/dwave-graphs#232 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
dwavesystems/dwave-graphs#260 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
dwavesystems/dwave-graphs#258 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
dwavesystems/dwave-graphs#256 ·
-
bug/fix
Difficulty 3/5 1-2 days Newbie friendliness 35/100
dwavesystems/dwave-graphs#255 · 8 comments ·
All issues in dwavesystems/dwave-graphs
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
NousResearch/hermes-agent#147104 ·
Maintainers usually reply within 1 day
-
premises-missing
Difficulty 1/5 Under an hour Newbie friendliness 88/100
WingedGuardian/GENesis-AGI#3801 ·
Maintainers usually reply within 1 day
-
[oblt-aw][autodoc] Document new required `shared-org-key` input for `obs-aw-dependency-review`Possibly taken @github-actions claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
bot-triaged module: inductor oncall: pt2 topic: fuzzer triaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 4 days