-
serialization/deserialization symmetry
- in general need more formatting options OR go to/from a major interchange format and recommend a separate library for every other kind of format in/out.
- But need to support at least one text-based in/out so that we can easily print to inspect a graph
-
no
node_index_map()
? So you have this clunky interface where you can get either the indices or the data but not both -
subgraph()
resets node indices 😱🤯 -
add_nodes_from()
should just be calledadd_nodes()
, same foradd_edges_from()
-
compose()
accepts an edge map which prevents having multiple edges from one node in the main graph to multiple nodes in the added fragment. Instead, it should accept an edge list in the same format used byadd_edges_from()
-
rx.union()
should accept a merge predicate function to determine which nodes to merge, and/or the attrs of the merged node -
PyGraph.contract_nodes()
equivalent tomerge_nodes()
in DiGraph and DAG? (Should be same name...) -
rx.is_subgraph_isomorphic(graph1, graph2)
returnsTrue
whengraph1
is empty (has0
nodes) andgraph2
is not empty (has >0 nodes), but I believe it should return False, since an empty graph shouldn't have any subgraphs that are isomorphic with graph2... right?-
Also rx.vf2_mapping will return empty mappings (
{}
) in this situation. -
workaround? instead of use
next(rx.vf2_mapping(..., subgraph=True), None) is not None
# First wrap vf2 mapping to remove empty mappings. def vf2_mapping(*args, **kwargs): for mapping in rx.vf2_mapping(*args, **kwargs): # This skips "empty" mappings, i.e. `{}`, which happens when one of the graphs is empty. if mapping: yield mapping # Then rewrite is_subgraph_isomorphic to check for any non-empty mappings. # This solves two problems: # - one where is_subgraph_isomorphic returns True but vf2_mapping returns an empty list # - ther other where vf2_mapping returns empty mappings def is_subgraph_isomorphic(*args, **kwargs): return next(vf2_mapping(*args, subgraph=True, **kwargs), None) is not None
-
Last active
February 12, 2024 18:36
-
-
Save colllin/637f6d34a1e51512d7f27c702fb41e9a to your computer and use it in GitHub Desktop.
rustworkx issues / rough edges / room for improvement
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment