Skip to content

Commit

Permalink
Docs for compose now warn about MultiGraph edgekeys
Browse files Browse the repository at this point in the history
Fixes networkx#1619 while leaving networkx#1654 to decide about whether edges
should have unique identifiers (UUID).
  • Loading branch information
dschult committed Apr 22, 2016
1 parent 545120b commit f7ff24f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions networkx/algorithms/operators/binary.py
Expand Up @@ -316,6 +316,10 @@ def compose(G, H, name=None):
-----
It is recommended that G and H be either both directed or both undirected.
Attributes from H take precedent over attributes from G.
For MultiGraphs, the edges are identified by incident nodes AND edge-key.
This can cause surprises (i.e., edge `(1, 2)` may or may not be the same
in two graphs) if you use MultiGraph without keeping track of edge keys.
"""
if not G.is_multigraph() == H.is_multigraph():
raise nx.NetworkXError('G and H must both be graphs or multigraphs.')
Expand Down

0 comments on commit f7ff24f

Please sign in to comment.