Skip to content

Commit 03771ee

Browse files
committed
updated is_brace()
1 parent d670168 commit 03771ee

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/sage/graphs/matching_covered_graph.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,7 +2584,7 @@ def is_brace(self, coNP_certificate=False):
25842584
sage: C = graphs.CycleGraph(6)
25852585
sage: D = MatchingCoveredGraph(C)
25862586
sage: D.is_brace(coNP_certificate=True)
2587-
(False, [(1, 2, None), (5, 4, None)], {0, 1, 5})
2587+
(False, [(0, 5, None), (2, 3, None)], {0, 1, 2})
25882588
25892589
If the input matching covered graph is nonbipartite, a
25902590
:exc:`ValueError` is thrown::
@@ -2637,7 +2637,7 @@ def is_brace(self, coNP_certificate=False):
26372637

26382638
# For each edge (a, b) in E(H(e)) ∩ M with a in A, b —> a in D(e).
26392639
# For each edge (a, b) in E(H(e)) with a in A, a —> b in D(e).
2640-
for a, b, *_ in H.edge_iterator():
2640+
for a, b in H.edge_iterator(labels=False, sort_vertices=True):
26412641

26422642
if a in B:
26432643
a, b = b, a
@@ -2678,7 +2678,7 @@ def dfs(v, visited, neighbor_iterator):
26782678
X = set()
26792679
dfs(root, X, D.neighbor_out_iterator)
26802680

2681-
for a, b in H.edge_iterator(labels=False):
2681+
for a, b in H.edge_iterator(labels=False, sort_vertices=True):
26822682
if (a in X) ^ (b in X):
26832683
x = a if a in A else b
26842684
color_class = x not in X
@@ -2690,7 +2690,7 @@ def dfs(v, visited, neighbor_iterator):
26902690

26912691
# Compute the nontrivial tight cut C := ∂(Y)
26922692
C = [(u, v, w) if u in X else (v, u, w)
2693-
for u, v, w in self.edge_iterator()
2693+
for u, v, w in self.edge_iterator(sort_vertices=True)
26942694
if (u in X) ^ (v in X)]
26952695

26962696
return (False, C, set(X))

0 commit comments

Comments
 (0)