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

Commit

Permalink
Make spanning forest, not spanning tree
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudi Pendavingh committed Jun 22, 2015
1 parent 55a4d0d commit 9ed83b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sage/matroids/matroid.pyx
Expand Up @@ -5150,7 +5150,9 @@ cdef class Matroid(SageObject):
A.set(bdx[e], idx[e], 1)
entries = [(e, f, (e,f)) for e in basis for f in self._fundamental_cocircuit(basis, e).difference([e])]
G = Graph(entries)
T = G.min_spanning_tree()
T = set()
for C in G.connected_components():
T.update(G.subgraph(C).min_spanning_tree())
for edge in T:
e,f = edge[2]
A.set(bdx[e],idx[f], 1)
Expand Down

0 comments on commit 9ed83b4

Please sign in to comment.