| Start | ||||||||
|---|---|---|---|---|---|---|---|---|
Algorithm Pseudo Code Algorithm PMinVertexCover (graph G)Input connected graph GOutput Minimum Vertex Cover Set CC is the minimum vertex cover of graph G we can use bucket sort for sorting the vertices according to its degree because the maximum value of degrees is (n-1) where n is the number of vertices then the time complexity of the sorting will be O(n) Parameters
RemarksThe 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. |
Read Article
https://develop.horje.com/learn/1434/reference