summaryrefslogtreecommitdiff
path: root/networkx/algorithms/cuts.py
diff options
context:
space:
mode:
Diffstat (limited to 'networkx/algorithms/cuts.py')
-rw-r--r--networkx/algorithms/cuts.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/networkx/algorithms/cuts.py b/networkx/algorithms/cuts.py
index 271ff309..2b4794ef 100644
--- a/networkx/algorithms/cuts.py
+++ b/networkx/algorithms/cuts.py
@@ -21,7 +21,7 @@ __all__ = [
# TODO STILL NEED TO UPDATE ALL THE DOCUMENTATION!
-@nx.dispatch("cut_size")
+@nx.dispatch
def cut_size(G, S, T=None, weight=None):
"""Returns the size of the cut between two sets of nodes.
@@ -84,7 +84,7 @@ def cut_size(G, S, T=None, weight=None):
return sum(weight for u, v, weight in edges)
-@nx.dispatch("volume")
+@nx.dispatch
def volume(G, S, weight=None):
"""Returns the volume of a set of nodes.
@@ -127,7 +127,7 @@ def volume(G, S, weight=None):
return sum(d for v, d in degree(S, weight=weight))
-@nx.dispatch("normalized_cut_size")
+@nx.dispatch
def normalized_cut_size(G, S, T=None, weight=None):
"""Returns the normalized size of the cut between two sets of nodes.
@@ -180,7 +180,7 @@ def normalized_cut_size(G, S, T=None, weight=None):
return num_cut_edges * ((1 / volume_S) + (1 / volume_T))
-@nx.dispatch("conductance")
+@nx.dispatch
def conductance(G, S, T=None, weight=None):
"""Returns the conductance of two sets of nodes.
@@ -228,7 +228,7 @@ def conductance(G, S, T=None, weight=None):
return num_cut_edges / min(volume_S, volume_T)
-@nx.dispatch("edge_expansion")
+@nx.dispatch
def edge_expansion(G, S, T=None, weight=None):
"""Returns the edge expansion between two node sets.
@@ -275,7 +275,7 @@ def edge_expansion(G, S, T=None, weight=None):
return num_cut_edges / min(len(S), len(T))
-@nx.dispatch("mixing_expansion")
+@nx.dispatch
def mixing_expansion(G, S, T=None, weight=None):
"""Returns the mixing expansion between two node sets.
@@ -323,7 +323,7 @@ def mixing_expansion(G, S, T=None, weight=None):
# TODO What is the generalization to two arguments, S and T? Does the
# denominator become `min(len(S), len(T))`?
-@nx.dispatch("node_expansion")
+@nx.dispatch
def node_expansion(G, S):
"""Returns the node expansion of the set `S`.
@@ -363,7 +363,7 @@ def node_expansion(G, S):
# TODO What is the generalization to two arguments, S and T? Does the
# denominator become `min(len(S), len(T))`?
-@nx.dispatch("boundary_expansion")
+@nx.dispatch
def boundary_expansion(G, S):
"""Returns the boundary expansion of the set `S`.