Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Slightly more efficient shortest paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudi Pendavingh committed Jun 21, 2015
1 parent f0720af commit 3538a8f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/sage/matroids/matroid.pyx
Expand Up @@ -5157,8 +5157,13 @@ cdef class Matroid(SageObject):
W.add(edge)
edge = edge2
W.remove(edge)
e,f = edge[2]
path = H.shortest_path(e, f)
e,f = edge[2]
while path[0]!= e and path[0] != f:
path.pop(0)
while path[-1]!= e and path[-1] != f:
path.pop(-1)
if path[0] == f:
path.reverse()
retry = True
break
x = 1
Expand Down

0 comments on commit 3538a8f

Please sign in to comment.