This is a polynomial algorithm for getting the minimum vertex cover of connected undirected graph. The time complexity of this algorithm is O(n2)
Variable | Meaning | —— | —— | G | Input connected un-directed graph | X | Set of vertices | C | Final set of vertices|
The first thing you have to do in this algorithm to get all of the vertices of the graph sorted in descending order according to its degree.
After that you have iterate on them and add each one to final vertices set which don’t have any adjacent vertex in this set.
In the final stage iterate on the final vertices set and remove all of the vertices which have one of its adjacent vertices in this set.