Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Graphs - vertex_connectivity - misleading behavior for parameter k

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/reference/graphs/sage/graphs/generic_graph.html#sage.graphs.generic_graph.GenericGraph.vertex_connectivity ) “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

Graphs - vertex_connectivity - misleading behavior for parameter k

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/reference/graphs/sage/graphs/generic_graph.html#sage.graphs.generic_graph.GenericGraph.vertex_connectivity ) “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