Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Code to find separating set in SageMath of a given Graph

Given a Graph $G$ how can I find the separating set of the Graph?

Suppose I am given this graph G=Graph({1:[2,3,4,5],2:[1,3,4,5],3:[1,2,4,5],4:[1,2,3],5:[1,2,3]})

I want to find the set of vertices whose removal disconnects the graph.

I found that the vertex connectivity of $G$ is 2.

Also on seeing the graph I find that the set of vertices whose removal disconnects the graph will be $(1,2,3)$

But how to find it using a code in SageMath?

Code to find separating set in SageMath of a given Graph

Given a Graph $G$ how can I find the separating set of the Graph?

Suppose I am given this graph G=Graph({1:[2,3,4,5],2:[1,3,4,5],3:[1,2,4,5],4:[1,2,3],5:[1,2,3]})graph

G = Graph({1: [2, 3, 4, 5],
           2: [1, 3, 4, 5],
           3: [1, 2, 4, 5],
           4: [1, 2, 3],
           5: [1, 2, 3]})

I want to find the set of vertices whose removal disconnects the graph.

I found that the vertex connectivity of $G$ is 2.

Also on seeing Looking at the graph I find that graph, the smallest set of vertices vertices whose removal disconnects the graph will be $(1,2,3)$is $(1, 2, 3)$.

But how to find it using a code in SageMath?