I am no graph theory expert, but the textbook I am learning from, and the Wikipedia article "Connecitivy (graph theory)" (which doesn't use my book as a reference, i.e., there are at least 2 books saying this) both say the vertex connectivity of a complete graph on n vertices is n-1. But, if you try to do graphs.CompleteGraph(whatever).vertex_connectivity(), it says
"There can be no vertex cut in a complete graph."
I looked at the code, and the fix is simple: Take
if g.is_clique():
raise ValueError("There can be no vertex cut in a complete graph.")
and make it
if g.is_clique():
return g.order()-1
But, I don't know how this fixing stuff works.
Second question, why does it return answers in the form 1.0 when the only possible values of this are integers?
Thirdly, there are a couple typos in the commenting of the code:
In a grid, the vertex connectivity is equal to the
minimum degree, in which case one of the two sets it
of cardinality 1
::
should be "two sets IS of"
For directed graphs, the strong connexity is tested
through the dedicated function::
I believe should be "strong vertex connectivity". Maybe connexity is okay but I am guessing it's a typo.
Fourthly, can we make "graph theory" a tag?