summarylogtreecommitdiffstats
path: root/sagemath-detect-igraph.patch
blob: dc6babe49ac51e1e9a77260ae7f69a1afd23cc27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py
index 252984f..ce19682 100644
--- a/src/sage/graphs/generic_graph.py
+++ b/src/sage/graphs/generic_graph.py
@@ -8188,10 +8188,12 @@ class GenericGraph(GenericGraph_pyx):
         if algorithm is None:
             if vertex_bound:
                 algorithm = "LP"
-            elif is_package_installed("python_igraph"):
-                algorithm = "igraph"
             else:
-                algorithm = "FF"
+                algorithm = "igraph"
+                try:
+                    import igraph
+                except ImportError:
+                    algorithm = "FF"
 
         if (algorithm == "FF"):
             return self._ford_fulkerson(x,y, value_only=value_only, integer=integer, use_edge_labels=use_edge_labels)