summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Schult <dschult@colgate.edu>2016-04-22 12:47:29 -0400
committerDan Schult <dschult@colgate.edu>2016-04-22 12:47:29 -0400
commitf7ff24f3079ccd49a47d0190696c1736b726f4ec (patch)
treed6977029905a5f9c105cc287ca25e35f502dcb35
parent545120b643d7d1bdbe54a02fa3d45d917d140b1b (diff)
downloadnetworkx-f7ff24f3079ccd49a47d0190696c1736b726f4ec.tar.gz
Docs for compose now warn about MultiGraph edgekeys
Fixes #1619 while leaving #1654 to decide about whether edges should have unique identifiers (UUID).
-rw-r--r--networkx/algorithms/operators/binary.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/networkx/algorithms/operators/binary.py b/networkx/algorithms/operators/binary.py
index 635eab99..fc26c980 100644
--- a/networkx/algorithms/operators/binary.py
+++ b/networkx/algorithms/operators/binary.py
@@ -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.')