Ask Your Question
3

Graphs - vertex_connectivity - misleading behavior for parameter k [closed]

asked 2024-09-26 23:09:37 +0200

Telijas gravatar image

updated 2024-09-27 02:41:22 +0200

tmonteil gravatar image

Hello,

I have an issue in the graph theory library using vertex_connectivity(). In the documentation it is said for the parameter k (https://doc.sagemath.org/html/en/refe... ) “when specified, check if the vertex connectivity of the (di)graph is larger or equal to k.“ So, starting from k=1, k=2, …. it starts with true and then flips to false and stays false. (Right? Given a connected graph).

In this example I get for k=1 false and for k=2 true, which should not be possible.

from sage.all import *
from sage.graphs.connectivity import vertex_connectivity

s3 = graphs.SierpinskiGasketGraph(Integer(3))
print(vertex_connectivity(s3, k=1))
print(vertex_connectivity(s3, k=2))
print(vertex_connectivity(s3))
print("Done")

Resulting in

False
True
2
Done

Repeating the test with the Peterson graph shows correct behavior of vertex_connectivity. Can someone help me? Do I understand the documentation wrong?

OS: Ubuntu 23.10
Sage: 10.4

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Telijas
close date 2024-09-29 02:22:07.529304

1 Answer

Sort by » oldest newest most voted
3

answered 2024-09-27 02:31:25 +0200

Looks like a bug to me. I think the logic is not complete in lines 1625–1627. Reported at https://github.com/sagemath/sage/issu....

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2024-09-26 23:09:37 +0200

Seen: 64 times

Last updated: Sep 27