An Approximation Algorithm For The Minimum Vertex Cover Problem
An Approximation Algorithm For The Minimum Vertex Cover Problem
com
ScienceDirect
Procedia Engineering 137 (2016) 180 – 185
GITSS2015
Abstract
The minimum vertex cover problem is a basic combinatorial optimization problem. Given an undirected graph the objective is to
determine a subset of the vertices which covers all edges such that the number of the vertices in the subset is minimized. In the
paper, based on Dijkstra algorithm, an approximation algorithm is obtained for the minimum vertex cover problem. In the
process of getting a vertex cover, the maximum value of shortest paths is considered as a standard, and some criteria are defined.
The time complex of the Algorithm is O(n3 ) , where n is the number of vertices in a graph. In the end, an example is given to
illustrate the process and the validity of the Algorithm.
© 2016
2016Published by Elsevier
The Authors. Ltd. This
Published is an open
by Elsevier access article under the CC BY-NC-ND license
Ltd.
(http://creativecommons.org/licenses/by-nc-nd/4.0/).
Peer-review under responsibility of the Department of Transportation Engineering, Beijing Institute of Technology.
Peer-review under responsibility of the Department of Transportation Engineering, Beijing Institute of Technology
Keywords: minimum vertex cover problem; Dijkstra algorithm; approximation algorithm; time complexity
1. Introduction
The minimum vertex cover problem is one of fundamental NP-hard problems in the combinatorial optimization
[11], and it has received a lot of attention these last decades. To find a minimum vertex cover is very difficult, but to
find an alternative is easier. So, many approximation algorithms have been proposed to construct vertex cover in
different ways. Such an algorithm must have a polynomial time complexity and must return a solution. And the
running time and the quality of the solution are considered to evaluate an approximation algorithm. The quality is
traditionally measured in terms of approximation ratio of the solution and the optimal one. The best constant
approximation ratio known is 2, and this is the best-known worst-case one [8]. Approximation ratio is not
necessarily a constant. If approximation ratio is small, the quality is good. There are several works have been
1877-7058 © 2016 Published by Elsevier Ltd. This is an open access article under the CC BY-NC-ND license
(http://creativecommons.org/licenses/by-nc-nd/4.0/).
Peer-review under responsibility of the Department of Transportation Engineering, Beijing Institute of Technology
doi:10.1016/j.proeng.2016.01.248
Jingrong Chen et al. / Procedia Engineering 137 (2016) 180 – 185 181
2. The Algorithm
Let G (V , E ) be a graph, where V is the set of vertices and E is the set of edges. A vertex cover S is a subset
of V such that each edge has at least one ends in S . A minimum vertex cover of G is one subset of V in which
the number of vertices is minimized. In this paper, we concern with undirected and connected plane graphs. If G is
disconnected, each components would be discussed separately.
Label all vertices of G , and let an arbitrary vertex be the initial point denoted by u 1 . Now we have set S {u 1} ,
subgraph H G S , allowed set L V S {theisolatedverticesof H } .
Assume we already have the set S {u1 , u2 ,},ui 1 , ui } . If subgraph H are consist of isolated vertices, then S is
a vertex cover of G . Because in graph G there is no edge with two ends in H . Now the edge set E is partitioned
into two sets E1 and E2 with E E1 E2 , where the edges of E1 have one endpoint in S , the edges of E2 have
both endpoints in S . Now each edge of G has at least one ends in set S , so S is a vertex cover of G .
If there are complete graphs or circles or paths in the connected components of H , incorporate their
corresponding minimum covers into the set S separately, and put all adjacent vertices of leaves into the set S also.
If ui is an isolated vertex in H G {u1 , u2 , ",ui 1} , then let ui 1 be an arbitrary vertex of L and S S {ui 1 } .
Otherwise, by using Dijkstra algorithm in subgraph H G {u1 , u2 , ",ui 1} , we can get the shortest distances
dui v (v L) from vertex ui to all vertices of set L . Let the maximum value
d max{dui v } .
vL
Then according to the two cases below to get a vertex cover of G .
Case 1: d ! 1
182 Jingrong Chen et al. / Procedia Engineering 137 (2016) 180 – 185
Let T {v | dui v d 1, v L} , which is a set containing the vertices with the distance of d 1 from ui to them.
According to the following criteria, we will get the vertex ui 1 .
Delete each vertex of set T separately in subgraph H . Let ui 1 be the vertex which has the minimum connected
component increase after deleting, and the count of connected components does not include the isolated vertices.
If they have the same increase of connected components, then let ui 1 be the vertex with maximum degree in H .
If there is only one vertex in T , then let it be ui 1 .
If the conditions of all vertices in T are the same after deleting, then let ui 1 be the one with the minimum label.
Let S S {ui 1 } , and repeat the process above.
Case 2: d 1
It is obviously that ui is adjacent to each vertex of set L . If H G S G {u1 , u2 ,", ui } is the disjoint union
of complete graphs or circles or paths, then it is easy to get a minimum vertex cover of H . So we obtain a vertex
cover of G . Otherwise, let ui 1 be the vertex with the maximum degree, or the minimum label if they have same
degree in H G S G {u1 , u2 , ", ui 1 , ui } . Now let S S {ui 1 } , and repeat the process above.
there are at least n2 comparisons to judge whether H are consist of isolated vertices by using the adjacent matrix of
H . There are at most n2 comparisons to judge whether H are the disjoint union of complete graphs or circles or
paths. Add up the entries of each line in adjacent matrix to judge whether there are one-degree vertices, then at most
n 2 n additions and n comparisons are generated. In step 3, the time complexity of Dijkstra algorithm is O(n 2 ) ,
and to get the maximum d generate n 1 comparisons. In Step 5, there are n 1 comparisons to get set T , and
2(n 1) comparisons to obtain vertex ui 1 . In Step 6, there are n 2 n 1 comparisons. Therefore, the total time
complexity of the Algorithm is about O[(n 1) u (4n 2 5n 5)] | O(n3 ) b 2 4ac by approximating and simplifying
the calculationƑ
3. Example
Now we use the example given in Fig. 1 to illustrate the concrete process of the Algorithm, where the weight of
each edge is assigned 1.
Step 1. Initializing the node labels, and let S {v6 } , L T .
Step 2. Vertex v2 is a leafage in H G S G {v 6 } , then S {v6 , v8 } and go to Step 3.
v2 v8 v14 v19 v22
v11 v20
v6
v16 v25
v1
v13
v5 v7 v18
v23
v10 v15
v3
v12 v21
v4
v17 v24
v9
Fig. 1. Graph G
d 6, j v15 v16 v17 v18 v19 v20 v21 v22 v23 v24 v25
v17 3 2 4 3 3 3 4 4 4 5 4
Step 5. T {v9 , v17 , v21 , v22 , v23 , v25 } . The number of connected components are same after deleting each vertex of
T . Vertex v17 meets the requirements, then S {v6 , v8 , v17 } . Go to Step 2
184 Jingrong Chen et al. / Procedia Engineering 137 (2016) 180 – 185
Step 2. Vertex v24 is a leafage in H G S , then S {v6 , v8 , v17 , v21} and go to Step 3.
Step 3. Allowed set
L V S {theisolatedverticesof H } {vi , i z 2, 6,8,17, 21, 24} .
Invoking Dijkstra algorithm to get the shortest distance d17, j from v17 to each vertex of L , which are listed in
Table 2, and we get d 5 .
Repeat the above steps until the Algorithm is stopped.
d17, j v14 v15 v16 v18 v19 v20 v22 v23 v25
v17 4 1 3 3 4 4 5 4 5
In Table 3, we list several vertex covers of G with different vertices as initial points which are selected
arbitrarily. Set S24 has the minimum vertices, so let it be a vertex cover of G . And we also find that a couple of
vertices, such as v1 , v2 , v4 , v10 etc., exist only in one vertex cover. So let them be the initial point separately to get
vertex cover of G , which are listed in Table 4. The number of vertex cover sets are all 15, so different initial points
can get good results.
v2 S2 {v1 , v2 , v3 , v4 , v7 , v8 , v11 , v12 , v15 , v16 , v17 , v18 , v19 , v20 , v21 , v25 } 16
v3 S3 {v3 , v5 , v6 , v8 , v9 , v10 , v11 , v12 , v13 , v14 , v17 , v18 , v19 , v20 , v21 , v25 } 16
v6 S6 {v3 , v5 , v6 , v7 , v8 , v9 , v11 , v12 , v15 , v16 , v17 , v18 , v19 , v20 , v21 , v25 } 16
v9 S9 {v3 , v5 , v6 , v7 , v8 , v9 , v12 , v14 , v15 , v16 , v17 , v18 , v19 , v20 , v21 , v25 } 16
v14 S14 {v3 , v5 , v6 , v7 , v8 , v9 , v12 , v14 , v15 , v16 , v17 , v18 , v20 , v21 , v22 , v25 } 16
v24 S 24 {v3 , v5 , v6 , v7 , v8 , v9 , v12 , v14 , v15 , v16 , v18 , v20 , v22 , v23 , v24 } 15
v4 S 4 {v3 , v4 , v5 , v6 , v7 , v8 , v12 , v13 , v14 , v16 , v17 , v20 , v21 , v22 , v23 } 15
v10 S10 {v3 , v4 , v5 , v6 , v8 , v9 , v10 , v11 , v13 , v14 , v17 , v20 , v21 , v22 , v23 } 15
4. Conclusion
In this paper, we have proposed an approximation algorithm for the minimum vertex cover problem based on
Dijkstra algorithm. The Algorithm is easy to implement, and there is no special requirement on the degree of
vertices. We get different vertex covers with different initial points, so it would be good to pick up a couple of
points to get different results. If we make each vertex of G as an initial point, then n vertex covers would be
obtained. Select the set with the least vertices as an approximation minimum vertex cover of G . So the time
complex of the Algorithm would be at most O(n 4 ) .
In future, we would investigate the minimum weight vertex cover problem. Because the longest shortest-path is
used as a standard in the Algorithm, the results would be different for the graph with weighted edges. Furthermore,
we will study the problem in which both edges and vertices are weighted.
Jingrong Chen et al. / Procedia Engineering 137 (2016) 180 – 185 185
Acknowledgements
This work is supported by the National Natural Science Foundation of China (No.61463027), Ph.D. Programs
Foundation of Ministry of Education of China (No.20136204120007), Fundamental Research Funds of Gansu
Province (No.212092-1).
References
[1]Avis D., Imamura T., 2007. A list heuristic for vertex cover, Operations Res. Lett. 35, 201-204.
[2]Bhasin H., 2012. Harnessing genetic algorithm for vertex cover problem. International Journal on Computer Science and Engineering, 4,218-
223.
[3]Chen J., Kani I.A., Xia G., 2010. Improved upper bounds for vertex cover, Theoretical Computer Science, 411,3736-3756.
[4]Chen J., Kanj I.A., Jia W., 2001. Vertex cover: further observations and further improvements, Journal of Algorithms 41,280-301.
[5]Chandran L., Grandoni F., 2005. Refined memorisation for vertex cover, Inform. Proc. Lett., 93, 125-131.
[6]Chen J., Liu L., Jia W., 2000. Improvement on vertex cover for low degree graphs, Networks, 35,253-259.
[7]Cormen T.H., Leiserson C.E., Rivest R.L., Andstein C., 2009. Introduction to Algorithms 3rd Ed. MIT Press, Cambridge, MA.
[8]Delbot F., Laforest C., 2010. Analytical and experimental comparison of six algorithms for the vertex cover problem. ACM Journal of
Experimental Algorithmics, 15(1.4),1-26.
[9]Delbot F., Andlaforest C., 2008. A better list heuristic for vertex cover, Inform. Proc. Lett.,107, 125-127.
[10]Dinur I., Ansafra S., 2005. On the hardness of approximating minimum vertex-cover, Ann. Math., 162,439-485.
[11]Garey M.R., Johnson D.S., 1978. Strong NP-completeness results: motivation, examples, and implications, Journal of ACM, 25, 499-508ˊ
[12]Garey, M.R., Andjohnson D., 1979. Computers and Intractability, Freeman and Co., New York.
[13]Jovanovic R., Tuba M., 2011. An ant colony optimization algorithm with improved pheromone correction strategy for the minimum weight
vertex cover problem. Applied Soft Computing, 11,5360-5366.
[14]Karakostas G., 2009. A better approximation ratio for the vertex cover problem. ACM Transactions on Algorithms, 5, 41:1-8.
[15]Niedermeier R., Rossmanith P., 2003. On efficient fixed-parameter algorithms for weighted vertex cover, Journal of Algorithms, 47,63-77.
[16]Savage C., 1982. Depth-first search and the vertex cover problem, Inform. Proc. Lett., 14,233-235.
[17]Singh A., Gupta A.K., 2006. A hybrid heuristic for the minimum weight vertex cover problem, Asia-Pacific Journal of Operational Research,
23,273-285.
[18]Shyu S.J., Yin P.Y., MT Lin B., 2004. An ant colony optimization algorithm for the minimum weight vertex cover problem. Annals of
Operations Research, 131,283-304.
[19]Voß S., Fink A., 2012. A hybridized tabu search approach for the minimum weight vertex cover problem. Journal of Heuristics 18, 869-876.
[20]Vazirani V., 2002. Approximation algorithms, Springer, Berlin.
[21]Witt C., 2012. Analysis of an iterated local search algorithm for vertex cover in sparse random graphs, Theoretical Computer Science
425,117-125.
[22]Xu X., Ma J., 2006. An efficient simulated annealing algorithm for the minimum vertex cover problem, Neurocomputing, 69,913-916.