Repository: networkx/networkx

Issue:
cutoff argument improperly disallowed when calling `minimum_cut` with `shortest_augmenting_path`
It should be possible to call `minimum_cut(G, s, t, flow_func=shortest_augmenting_path, cutoff=3)` however this raises an exception.

From `maxflow.py`, `minium_cut()` definition:
```
    if kwargs.get("cutoff") is not None and flow_func in flow_funcs:
        raise nx.NetworkXError("cutoff should not be specified.")
```
where
```
# Functions that don't support cutoff for minimum cut computations.
flow_funcs = [
    boykov_kolmogorov,
    dinitz,
    edmonds_karp,
    preflow_push,
    shortest_augmenting_path,
]
```
however the docstring and source for `shortestaugmentingpath.py` do allow the `cutoff` argument.



Discussion:
I think the problem is that cutoff for shortest_augmenting_path is not working properly that's why is disabled even when the function does allow the argument. 
Can you point me to any github issue or failing unit test for `shortest_augmenting_path` not working properly?
In the details of #1102 it seems that the initial flagging of functions that don't have the cutoff functionality correctly included the `shortest_augmenting_path` (as well as some others) but the `cutoff` functionality was added in a commit a few days later. It looks like an oversight that these functions did not get removed from the list of functions that do not support the cutoff input parameter.  

I believe there may be others in `flow_funcs` that also do now support (and long have supported) the cutoff feature.
Can someone check those functions and make a PR to correct the list of functions that don't support the cutoff feature?

~~I'm going to transfer this discussion to an Issue so we make sure to fix this.~~{already is an Issue :}
I'll do it 
Awesome! I might suggest the list variable be called `flow_funcs_without_cutoff` for readability.
I agree that the name of that variable needs to be changed. That suggestion looks good to me.


Resolving patch:
diff --git a/networkx/algorithms/flow/maxflow.py b/networkx/algorithms/flow/maxflow.py
--- a/networkx/algorithms/flow/maxflow.py
+++ b/networkx/algorithms/flow/maxflow.py
@@ -12,14 +12,6 @@
 
 # Define the default flow function for computing maximum flow.
 default_flow_func = preflow_push
-# Functions that don't support cutoff for minimum cut computations.
-flow_funcs = [
-    boykov_kolmogorov,
-    dinitz,
-    edmonds_karp,
-    preflow_push,
-    shortest_augmenting_path,
-]
 
 __all__ = ["maximum_flow", "maximum_flow_value", "minimum_cut", "minimum_cut_value"]
 
@@ -452,7 +444,7 @@ def minimum_cut(flowG, _s, _t, capacity="capacity", flow_func=None, **kwargs):
     if not callable(flow_func):
         raise nx.NetworkXError("flow_func has to be callable.")
 
-    if kwargs.get("cutoff") is not None and flow_func in flow_funcs:
+    if kwargs.get("cutoff") is not None and flow_func is preflow_push:
         raise nx.NetworkXError("cutoff should not be specified.")
 
     R = flow_func(flowG, _s, _t, capacity=capacity, value_only=True, **kwargs)
@@ -603,7 +595,7 @@ def minimum_cut_value(flowG, _s, _t, capacity="capacity", flow_func=None, **kwar
     if not callable(flow_func):
         raise nx.NetworkXError("flow_func has to be callable.")
 
-    if kwargs.get("cutoff") is not None and flow_func in flow_funcs:
+    if kwargs.get("cutoff") is not None and flow_func is preflow_push:
         raise nx.NetworkXError("cutoff should not be specified.")
 
     R = flow_func(flowG, _s, _t, capacity=capacity, value_only=True, **kwargs)


Test patch:
diff --git a/networkx/algorithms/flow/tests/test_maxflow.py b/networkx/algorithms/flow/tests/test_maxflow.py
--- a/networkx/algorithms/flow/tests/test_maxflow.py
+++ b/networkx/algorithms/flow/tests/test_maxflow.py
@@ -20,6 +20,7 @@
     preflow_push,
     shortest_augmenting_path,
 }
+
 max_min_funcs = {nx.maximum_flow, nx.minimum_cut}
 flow_value_funcs = {nx.maximum_flow_value, nx.minimum_cut_value}
 interface_funcs = max_min_funcs & flow_value_funcs
@@ -427,25 +428,24 @@ def test_flow_func_parameters(self):
 
     def test_minimum_cut_no_cutoff(self):
         G = self.G
-        for flow_func in flow_funcs:
-            pytest.raises(
-                nx.NetworkXError,
-                nx.minimum_cut,
-                G,
-                "x",
-                "y",
-                flow_func=flow_func,
-                cutoff=1.0,
-            )
-            pytest.raises(
-                nx.NetworkXError,
-                nx.minimum_cut_value,
-                G,
-                "x",
-                "y",
-                flow_func=flow_func,
-                cutoff=1.0,
-            )
+        pytest.raises(
+            nx.NetworkXError,
+            nx.minimum_cut,
+            G,
+            "x",
+            "y",
+            flow_func=preflow_push,
+            cutoff=1.0,
+        )
+        pytest.raises(
+            nx.NetworkXError,
+            nx.minimum_cut_value,
+            G,
+            "x",
+            "y",
+            flow_func=preflow_push,
+            cutoff=1.0,
+        )
 
     def test_kwargs(self):
         G = self.H