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
and make it
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
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?
My mistake, as usual :-)
So, to answer your points :
1) The connectivity of a clique on n vertices is n-1. Yes, you are right, all the textbooks say so, this is the convention, and I just thought that "it makes no sense to look for a vertex cut in a clique" when I coded this method. I'll fix that in a patch.
2) The answer returns 1.0 instead of the expected 1. The reason is that this method also handles weighted cut, but you are right when you say that it feels odd to get a non-integer value. This is actually fixed by patch 11367 which is waiting for a reiew right now. If you want to give it a review, it will finally be merged into Sage : I can write many patches but I can not review my own patches myself
3) I will fix the typ in the same patch, Thanks !
4) Well, this is actually testing for strongconnectivity but I did not find it very hard, as this is what you expect to compute when you try to compute the connectivity of a directed graph. One can cast it to an undirected graph otherwise... Do you think it is a bad idea ?
posted Oct 09 '11Nathann
315 ● 1 ● 10
Asked: Oct 09 '11
Seen: 87 times
Last updated: Oct 09 '11
powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.