Skip to content

Commit 5c5b5cd

Browse files
committed
fix issue
1 parent 3d03dae commit 5c5b5cd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/sage/graphs/connectivity.pyx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ def is_edge_cut(G, edges):
775775
sage: G.add_edge((2, 5, 'xyz'))
776776
sage: is_edge_cut(G, [(0, 5), (2, 5)])
777777
True
778-
sage: is_edge_cut(G, [(0, 5), (2, 5, 'xyz)])
778+
sage: is_edge_cut(G, [(0, 5), (2, 5, 'xyz')])
779779
True
780780
sage: is_edge_cut(G, [(0, 5, 'silly'), (2, 5)])
781781
True
@@ -867,10 +867,11 @@ def is_edge_cut(G, edges):
867867
cdef set seen
868868
DS = DisjointSet(G)
869869

870-
CC = G.connected_components()
871-
for comp in CC:
870+
for comp in G.connected_components():
872871
if not S.intersection(comp):
872+
# This component is not involved in the cut
873873
continue
874+
874875
# We run a DFS in comp from any vertex and avoid edges in C
875876
start = comp[0]
876877
queue = [start]

0 commit comments

Comments
 (0)