summarylogtreecommitdiffstats
path: root/sagemath-detect-igraph.patch
blob: 89965d45e286fe6f641847dd79610ad6e3166da9 (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
@@ -7876,10 +7875,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)