Skip to content

Commit 2b4fe39

Browse files
author
Release Manager
committed
gh-38726: fix issue 38723 in vertex_connectivity
Fixes #38723. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #38726 Reported by: David Coudert Reviewer(s): John H. Palmieri
2 parents 4462607 + d9fa23d commit 2b4fe39

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

build/pkgs/configure/checksums.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=2cdffd348b8a4de62b51e1f6c37a7d414004c09e
3-
sha256=273c37842eedefc3575e34bb14819ab3738a32c39ae634f2342bb50baa740c60
2+
sha1=c49c5f48b308654286156805086bb6b74468290d
3+
sha256=60a2a872c0f63813a888cf80e4d11f8d83fa16fb1c9c617d4fa64eea600b56a7
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9b58ceaa68960b38142f27fdfc04373301da4e46
1+
2eb961239c84c157a3c7b44b5dba88590c96761c

src/sage/graphs/connectivity.pyx

+13-3
Original file line numberDiff line numberDiff line change
@@ -1608,6 +1608,16 @@ def vertex_connectivity(G, value_only=True, sets=False, k=None, solver=None, ver
16081608
sage: G.add_edge(0, 1)
16091609
sage: G.vertex_connectivity(value_only=False, verbose=1) # needs sage.numerical.mip
16101610
(3, [])
1611+
1612+
Check that :issue:`38723` is fixed::
1613+
1614+
sage: G = graphs.SierpinskiGasketGraph(3)
1615+
sage: G.vertex_connectivity(k=1) # needs sage.numerical.mip
1616+
True
1617+
sage: G.vertex_connectivity(k=2) # needs sage.numerical.mip
1618+
True
1619+
sage: G.vertex_connectivity(k=3) # needs sage.numerical.mip
1620+
False
16111621
"""
16121622
from sage.graphs.generic_graph import GenericGraph
16131623
if not isinstance(G, GenericGraph):
@@ -1622,8 +1632,8 @@ def vertex_connectivity(G, value_only=True, sets=False, k=None, solver=None, ver
16221632
# We follow the convention of is_connected, is_biconnected and
16231633
# is_strongly_connected
16241634
return k == 1
1625-
if (g.is_directed() and k > min(min(g.in_degree()), min(g.out_degree()))) \
1626-
or (not g.is_directed() and (k > min(g.degree()))):
1635+
if ((g.is_directed() and k > min(min(g.in_degree()), min(g.out_degree())))
1636+
or (not g.is_directed() and (k > min(g.degree())))):
16271637
return False
16281638
value_only = True
16291639
sets = False
@@ -1655,7 +1665,7 @@ def vertex_connectivity(G, value_only=True, sets=False, k=None, solver=None, ver
16551665
return 1 if k is None else (k == 1)
16561666

16571667
if not G.is_triconnected():
1658-
return 2 if k is None else (k == 2)
1668+
return 2 if k is None else (k <= 2)
16591669
elif k == 3:
16601670
return True
16611671

0 commit comments

Comments
 (0)