ArticlePDF Available

Analytical and experimental comparison of six algorithms for the vertex cover problem

Authors:

Abstract and Figures

The vertex cover is a well-known NP-complete minimization problem in graphs that has received a lot of attention these last decades. Many algorithms have been proposed to construct vertex cover in different contexts (offline, online, list algorithms, etc.) leading to solutions of different level of quality. This quality is traditionally measured in terms of approximation ratio, that is, the worst possible ratio between the quality of the solution constructed and the optimal one. For the vertex cover problem the range of such known ratios are between 2 (conjectured as being the smallest constant ratio) and Δ, the maximum degree of the graph. Based on this measure of quality, the hierarchy is almost clear (the smaller the ratio is, the better the algorithm is). In this article, we show that this measure, although of great importance, is too macroscopic and does not reflect the practical behavior of the methods. We prove this by analyzing (known and recent) algorithms running on a particular class of graphs: the paths. We obtain closed and exact formulas for the mean of the sizes of vertex cover constructed by these different algorithms. Then, we assess their quality experimentally in several well-chosen class of graphs (random, regular, trees, BHOSLIB benchmarks, trap graphs, etc.). The synthesis of all these results lead us to formulate a “practical hierarchy” of the algorithms. We remark that it is, more or less, the opposite to the one only based on approximation ratios, showing that worst-case analysis only gives partial information on the quality of an algorithm.
Content may be subject to copyright.
Analytical and experimental comparison of six
algorithms for the vertex cover problem
FRANC¸OIS DELBOT
IBISC, Universit´e d’Evry, France
and
CHRISTIAN LAFOREST
LIMOS, Universit´e Blaise Pascal, France
The vertex cover is a well-known NP-complete minimization problem in graphs that has received
a lot of attention these last decades. Many algorithms have been proposed to construct vertex
cover in different contexts (offline, online, list algorithms, etc.) leading to solutions of different
level of quality. This quality is traditionally measured in terms of approximation ratio, that is
the worst possible ratio between the quality of the solution constructed and the optimal one. For
the vertex cover problem the range of such known ratios are between 2 (conjectured as being the
smallest constant ratio) and ∆, the maximum degree of the graph. Based on this measure of
quality, the hierarchy is almost clear (the smaller the ratio is, the better the algorithm is).
In this paper, we show that this measure, although of great importance, is too macroscopic and
does not reflect the practical behavior of the methods. We prove this by analyzing (known and
recent) algorithms running on a particular class of graphs: the paths. We obtain closed and exact
formulas for the mean of the sizes of vertex cover constructed by these different algorithms. Then,
we assess their quality experimentally in several well-chosen class of graphs (random, regular, trees,
BHOSLIB benchmarks, trap graphs, etc.). The synthesis of all these results lead us to formulate
a “practical hierarchy” of the algorithms. We remark that it is, more or less, the opposite to
the one only based on approximation ratios, showing that worst case analysis only gives partial
information on the quality of an algorithm.
Categories and Subject Descriptors: F.2 [THEORY OF COMPUTATION]: ANALYSIS OF
ALGORITHMS AND PROBLEM COMPLEXITY; G.2.2 [DISCRETE MATHEMATICS]:
Graph Theory
General Terms: Algorithms, Experimentation, Performance, Theory
Additional Key Words and Phrases: differential approximation, mean analysis, vertex cover, worst
case approximation
Author’s address: Fran¸cois Delbot, Laboratoire IBISC, FRE CNRS 3190, Universit´e d’Evry, Tour
Evry 2, 523 place des terrasses, 91000 Evry, France; email: francois.delbot@ibisc.fr
Christian Laforest, LIMOS, UMR 6158 CNRS, Universit´e Blaise Pascal, Campus scientifique
des C´ezeaux, 24, Avenue des Landais, BP 10 125, 63173 Aubiere cedex, France; email: chris-
tian.laforest@isima.fr
This work is partially supported by the projet ToDo (Time versus Optimality in Discrete Opti-
mization) funded by the French ANR and by the project ”Approximation Rapide” funded by the
French GDR RO
Permission to make digital/hard copy of all or part of this material without fee for personal
or classroom use provided that the copies are not made or distributed for profit or commercial
advantage, the ACM copyright/server notice, the title of the publication, and its date appear, and
notice is given that copying is by permission of the ACM, Inc. To copy otherwise, to republish,
to post on servers, or to redistribute to lists requires prior specific permission and/or a fee.
c
20YY ACM 0000-0000/20YY/0000-0001 $5.00
ACM Journal Name, Vol. V, No. N, Month 20YY, Pages 1–0??.
2·F. Delbot and C. Laforest
1. INTRODUCTION
Graph theory is widely used to model many different types of concrete situations
(logistic, networks, social science, etc.). The resulting graphs are then manipulated
by algorithms, often to optimize a given objective. Unfortunately, many discrete
optimization problems are intractable, i.e. cannot be solved exactly in polynomial
time. This is the case for the numerous NP-complete problems (see [Garey and
Johnson 1979]). However, due to their theoretical and practical importance they
must be solved. Many alternatives are possible. The first one is running heuristics;
in most cases, there is no guarantee neither on the running time nor on the quality
of the solution produced. Another approach is (sometimes) possible, namely the ap-
proximation algorithms; such an algorithm must have a polynomial time complexity
and must return a solution those quality is in a given range between optimal, noted
OP T , and r·OP T where r1 is the approximation ratio (this terminology is for
minimization problem). If such an approximation algorithm exists, we have two
guarantees: the running time is “reasonable” and the quality of the solution is in
a range, given by the analysis of the algorithm (the approximation ratio must be
analytically proved). Approximation algorithms are then interesting tools to pro-
duce solutions with proven quality to discrete optimization problems a lot of works
have been devoted to this subject [Hochbaum 1997; Ausiello et al. 1999; Vazirani
2002]. In such situations, the “quality” of such an algorithm is measured by its
approximation ratio r(that is not necessarily a constant). If ris small the quality
is good.
This paper is devoted to the comparison of several approximation algorithms
for a well known minimization problem, namely the vertex cover problem. Let
G= (V, E ) be any undirected non weighted graph where Vis the set of vertices
and Ethe set of edges. A vertex cover Cis a subset of the vertices (CV) such
that each edge uv has at least one extremity in C(uCor vCor both). The
associated optimization problem is to construct a vertex cover of minimum size.
This is a classical optimization problem that has several approximation algorithms.
The vertex cover problem is often involved in the resolution of other problems
(most often at an intermediate stage) such as multiple sequence alignment [Roth-
Korostensky 2000], conflict resolution in sequence data [Stege 2000] or network
monitoring [Zhang et al. 2006].
The best constant approximation ratio known is 2 and it is conjectured (see for
example [Khot and Regev 2008]) that there is no smaller constant ratio. Hence, 2
seems to be the “best” possible result reachable. Several algorithms have this ratio
(and are described and studied in this paper) and are known and are used since
many years.
Online and list algorithms. More recently other “contexts” of applications have
emerged: for example, in an online context, the vertices are revealed one by one
(with their edges incident to already revealed vertices) and a decision to include
or not the current vertex must be irrevocably taken during this step. In the same
spirit, list algorithms have been investigated. In this situation the graph is known
but presented to the algorithm piece by piece following a given order (the list).
In these works, the intrinsic hardness of the problem is “complicated” by the run-
ning context where decisions must be taken based on partial information. Then,
ACM Journal Name, Vol. V, No. N, Month 20YY.
Analytical and experimental comparison of six algorithms for the vertex cover ·3
it is not surprising that the algorithms designed to produce a vertex cover in such
contexts have bad (and often non constant) approximation ratios.
Thus, several (polynomial time) algorithms have been proposed for the vertex
cover problem with approximation ratios lying between 2 and ∆ (the maximum
degree of the graph). The hierarchy based on this criterium is rather clear and the
considered best algorithms are those who have a ratio of 2.
However, in practice, the situation is not so clear. This is what we show in this
paper. The main goal of our work is to establish a hierarchy of these algorithms,
based on practical behavior. Indeed, even if they are deterministic, the final result
is influenced by “local choices” made during the construction. When such a choice
is possible, we consider that it is made randomly and uniformly. We can then
study these algorithms not in the worst case scenario (as for the approximation
ratio) but in an average case. This is closer to the real behavior of the method
since worst cases are often rare and artificial and do not represent the range of all
possibilities. Our main result is that the “practical” hierarchy based on average
study we obtain at the end of our study is more or less the opposite of the one
based on the approximation ratio.
The choice of the algorithms studied. Our choice was mainly based on the two
following criterium:
—One of our future objective is to adapt some of them to the treatment of very large
instances. With this perspective in mind we are only interested by algorithms
with low complexity and involving basic mechanisms.
—The comparison must be done “fairly”. This can only be done if all the steps of
computation are completely described and specified. This is why we did not con-
sider here algorithms involving linear programing for example since the precision
and the performances may depend on the solver used.
Outline of the paper. In Section 2 we present the algorithms that we study and
their approximation ratio. In Section 3 we make an exact mean analysis of their
performance on a particular class of graphs (the path graphs). Then in Section 4
we conduct an experimental study on several classical graphs classes. We make a
conclusion in Section 5.
2. PRESENTATION OF THE ALGORITHMS
In this section, we present six algorithms for the vertex cover problem, namely Max-
imum Degree Greedy,Greedy Independent Cover,Depth First Search,
Edge Deletion,ListLeft and ListRight.
Remark. In the following descriptions, when an algorithm removes one or more
vertices, incident edges are also deleted. Then, the set E(containing all edges of
the graph) is updated implicitly.
2.1 The algorithms
The Maximum Degree Greedy (MDG) Algorithm is an adaptation of the
classical greedy algorithm for the set cover problem (see for example [Cormen et al.
2009]). It’s worst-case approximation ratio is H(∆), with H(n) = 1 + 1
2+···+1
n
ACM Journal Name, Vol. V, No. N, Month 20YY.
4·F. Delbot and C. Laforest
the harmonic series (H(n)ln n+ 0.57 when nis large) and ∆ the maximum
degree of the graph.
Algorithm 1: Maximum Degree Greedy (MDG)
Data: a graph G= (V, E )
Result: a vertex cover of G
C← ∅;1
while E6=do2
select a vertex uof maximum degree;3
VV− {u};4
CC∪ {u};5
end6
return C;7
The Greedy Independent Cover (GIC) Algorithm is an adaptation of the
well know greedy algorithm presented in [Halld´orsson and Radhakrishnan 1994] for
the independent set problem. It’s worst-case approximation ratio is at least of
2
(this lower bound is obtained with graphs presented in [Avis and Imamura 2007]).
We note N(u) the set of neighbors of the vertex u.
Algorithm 2: Greedy Independent Cover (GIC)
Data: a graph G= (V, E )
Result: a vertex cover of G
C← ∅;1
while E6=do2
select a vertex uof minimum degree;3
CCN(u);4
VV(N(u)∪ {u});5
end6
return C;7
The Depth First Search (DFS) algorithm has worst-case approximation
ratio of 2 and was presented in [Savage 1982]. This algorithm returns the nonleaf
vertices of a depth-first search spanning tree. Hence, if Gis connected the result
is a connected vertex cover. Otherwise the algorithm must be executed on each
connected component of G(excepted isolated vertices). To simplify the description
we suppose that Gis connected.
Algorithm 3: Depth First Search (DFS)
Data: a (connected) graph G
Result: a vertex cover of G
Compute T, a depth-first search spanning tree of Gstarting from any vertex r.1
Let I(T) be the set of nonleaves vertices of T.2
return I(T)∪ {r};3
ACM Journal Name, Vol. V, No. N, Month 20YY.
Analytical and experimental comparison of six algorithms for the vertex cover ·5
The Edge Deletion (ED) Algorithm, proposed by Gavril (see [Garey and
Johnson 1979]), returns the vertices of a maximal (but not necessarily maximum)
matching. It’s worst-case approximation ratio is 2 (see for example [Cormen et al.
2009]). More precisely, the tight worst-case approximation ratio is asymptotic to
min{2,1
11ǫ}for graphs with an average degree of at least ǫn and to min{2,1
ǫ}
for graphs with a minimum degree of at least ǫn (see [Cardinal et al. 2005]).
Algorithm 4: Edge Deletion (ED)
Data: a graph G= (V, E )
Result: a vertex cover of G
C← ∅;1
while E6=do2
select uv E;3
CC∪ {u, v};4
VV− {u, v};5
end6
return C;7
The ListLeft (LL) Algorithm, proposed by Avis and Imamura in [Avis and
Imamura 2007], is a list heuristic. In this model, an algorithm scans the vertices one
by one in a fixed given order (called a list ) and takes a decision for each currently
scanned vertex (and each decision is definitive). This can be viewed as an interme-
diate model between traditional approximation algorithms or heuristics (where the
vertices can be treated dynamically in any order at each step of computation) and
the pure on-line model studied in [Demange and Paschos 2005] (where the order
of revelation is imposed by an adversary and each decision is definitive). In list
heuristics, the graph and the order of scan (i.e. the list) are known in advance but
cannot be updated during the process. For a given list L=u1, . . . , unwe say that
uiis on the left (resp. on the right) of ujif i < j (resp. i > j); in addition, if
uiand ujare neighbors in the graph then uiis called a left neighbor (resp. right
neighbor) of uj.
In [Avis and Imamura 2007], the authors show that the ListLeft Algorithm has
an approximation ratio of
2+3
2when lists are sorted by decreasing order of their
degrees and that any list algorithm cannot have an approximation better than
2
in that case.
Algorithm 5:ListLeft (LL)
Data: a graph Gand an associated list L
Result: a vertex cover of G
C← ∅;1
Scan the list Lfrom left to right. Let ube the current scanned vertex.2
if uhas at least a right neighbor not in Cthen3
CC∪ {u}4
end5
return C;6
ACM Journal Name, Vol. V, No. N, Month 20YY.
6·F. Delbot and C. Laforest
The ListRight (LR) Algorithm is a better list heuristic than ListLeft; more
precisely, it was proved in [Delbot and Laforest 2008] that for any list LListRight
returns a vertex cover whose size is smaller than or equal to the one constructed by
ListLeft applied on the same list L.ListRight has a worst-case approximation
ratio of ∆ (this bound is tight in stars).
Algorithm 6:ListRight (LR)
Data: a graph Gand an associated list L
Result: a vertex cover of G
C← ∅;1
Scan the list Lfrom right to left. Let ube the current scanned vertex.2
if uhas at least a right neighbor not in Cthen3
CC∪ {u}4
end5
return C;6
2.2 Probabilistic model
The worst case analysis cannot capture the whole behavior of an algorithm on dif-
ferent classes of graphs. The worst case analysis is a very useful tool in the analysis
of algorithms, but it is not sufficient to determine a priori the performance of an
algorithm on a specific class of graphs. For example, an algorithm may be forced
to always return its worst case (see the Edge Deletion algorithm who always
returns 2 vertices of a star with n2 vertices) while another may be forced to
always return the best solution (see Maximum Degree Greedy which returns
only the central vertex). The worst case approximation ratio is only a macroscopic
view of worst case performance of an algorithm. For example, the approximation
ratio in worst case of Maximum Degree Greedy is H(∆) = P
i=1 1
i, while its
worst case approximation ratio on star with leaves is 1. Moreover, many algo-
rithms contains a part of non-determinism (e.g. in the choice of selecting the edge
for Edge Deletion, or the choice of a vertex of maximum degree for Maximum
Degree Greedy) which can strongly influence their performance. For example,
when applying ListRight on a star with nvertices (eg a graph with n1 ver-
tices of degree 1 and 1 vertex of degree n1) it is easy to show that it returns
the optimal solution (the vertex of degree n1) if the central vertex is not at
the right end of the list, which is the case with probability n1
n, showing that this
algorithm is optimal with high probability and that its worst case corresponds to
a rare execution.
One cannot understand the behavior of approximation algorithms only focusing
on the worst case approximation ratio and it is necessary to use additional methods
of evaluation, such as average evaluation for example.
In order to perform an average evaluation, we need to specify the probabilistic
model used. In the rest of this paper, each time a choice will be made, it will
be done equiprobably among all possible choices. In practice, these choices will
ACM Journal Name, Vol. V, No. N, Month 20YY.
Analytical and experimental comparison of six algorithms for the vertex cover ·7
influence our algorithms as follows:
—The choose made on line 3 in the description of Maximum Degree Greedy,
Greedy Independent Cover and Edge Deletion is made equiprobably.
For example, Maximum Degree Greedy selects a vertex of maximum degree
uequiprobably among the set of vertices of maximum degree.
—The first line of Depth First Search is dedicated to the construction of a depth
first search spanning tree. We assume that a vertex is chosen to be the root with
probability 1
nand that each time the algorithm explores a branch starting from
a vertex uby selecting a neighbor vof u,vis chosen equiprobably among the
neighbors of u.
ListLeft and ListRight are deterministic but accept a list Las input data.
We assume that Lis chosen equiprobably among the n! possible lists.
3. AVERAGE BEHAVIOR OF THESE ALGORITHMS ON PATHS
In this section, we study the exact behavior of different algorithms on a simple but
nontrivial class of graphs: the paths. A path of size n(noted Pnin this paper) is a
tree1with all vertices of degree 2 except two that are of degree 1. Let Opt(G) be the
size of an optimal vertex cover on G(note that Opt(Pn) = n
2). We give a closed
formula of the expectation of the size of solutions returned by each algorithm.
3.1 Expectation of the size of solutions returned by each algorithm
Theorem 1. E(Greedy Independent Cover (Pn)) = Opt(Pn).
Proof. It is mentioned in [Halld´orsson and Radhakrishnan 1994] that Greedy
Independent Cover finds an optimal vertex cover in trees and therefore in
paths.
Theorem 2. E(Depth First Search(Pn)) = n2 + 2
n.
Proof. This algorithm constructs a depth-first search spanning tree rooted in a
vertex r. With our equiprobability assumption, each vertex of Pncan be the root
with probability 1
n. If ris a vertex of degree 1 Depth First Search return a
solution of size n1. At the opposite, if ris a vertex of degree 2, the tree contains
exactly 2 leaves (the two vertices of degree 1) and Depth First Search returns a
solution of size n2. Then, we can deduce the mean of the algorithm when applied
to Pn:E(Depth First Search(Pn)) = 2
n(n1) + n2
n(n2) = n2 + 2
n.
Theorem 3. E(ListLeft(Pn)) = 2n1
3.
Proof. The mean of ListLeft on a graph Gwith nvertices is obtained by
the following formula: E(ListLeft(G)) = nPuV
1
d(u)+1 (Eric Angel, personal
communication). To see that, it suffices to note that a vertex uis not selected by
ListLeft only if all its neighborhood is on the left in the list. By considering all
the lists that meet this condition, we obtain that the probability of such an event
is 1
d(u)+1 . Therefore, the probability of selecting a vertex uis 1 1
d(u)+1 and we
obtain the claimed formula. In a path of size n, there is exactly n2 vertices of
1A tree is a connected graph with nvertices and n1 edges
ACM Journal Name, Vol. V, No. N, Month 20YY.
8·F. Delbot and C. Laforest
degree 2 and two vertices of degree 1. by applying the formula to Pn, we obtain
that E(ListLeft(Pn)) = n1
3(n2) 1
22 = 2n1
3.
The following result has been shown in [Birmel´e et al. 2009].
Theorem 4. E(ListRight(Pn)) = n1
2+n+1
2·Pn
k=0
(2)k
k!+Pn1
k=0
(2)k
k!.
Proof. See [Birmel´e et al. 2009].
By applying similar techniques used in [Birmel´e et al. 2009], we can show the ex-
pectation of Maximum Degree Greedy and Edge Deletion. We only present
the proof for Maximum Degree Greedy here.
Theorem 5. E(Maximum Degree Greedy(Pn)) = n1
2+n1
2Pn1
p=0
(2)p
p!+
Pn2
p=0
(2)p
p!.
Proof. The proof follows directly from Lemmas 6 and 7 that are proved in the
following.
Lemma 6. A recursive expression of E(MDG(Pn)) is:
E(MDG(P0)) = E(M DG(P1)) = 0 and E(MDG(P2)) = 1
E(MDG(Pn)) = 1 + 2
n2
n2
X
k=2
E(MDG(Pk))
Proof. MDG selects a vertex if and only if there is at least one edge in the
graph and therefore at least two vertices. Then, we deduce that E(M DG(P0)) =
E(MDG(P1)) = 0.
The vertices of Pnare labeled from v1to vn. At each step of the algorithm, MDG
selects a vertex vkof maximum degree. There are two cases:
—The path contains two vertices. MDG selects one of the two vertices and will not
select the other vertex because the graph does not contain any edge. We obtain
that E(MDG(P2)) = 1.
—The path contains more than two vertices. MDG selects a vertex of degree 2, that
we call vk, among the n2 vertices of degree 2, with respect to the equiprobability
assumption. After this step, we obtain two paths resulting from the deletion of
vk:RP1and RP2.RP1is composed of vertices v1to vk1, and RP2is composed
of vertices vk+1 to vn. As the size of RP1is k1 and the size of RP2is nk,
we obtain that RP1=Pk1et RP2=Pnk.
It follows from these remarks that a recursive expression of E(MDG(Pn)) is:
E(MDG(P0)) = E(M DG(P1)) = 0 and E(M DG(P2)) = 1
E(MDG(Pn)) =
n1
X
k=2
1
n2·(1 + E(M DG (Pk1) + E(MDG (Pnk))))
As Pn1
k=2 E(MDG(Pk1)) = Pn1
k=2 E(MDG(Pnk)) and as E(M DG(P1)) = 0,
we can reformulate our expression as follows:
ACM Journal Name, Vol. V, No. N, Month 20YY.
Analytical and experimental comparison of six algorithms for the vertex cover ·9
E(MDG(Pn)) =
n1
X
k=2
1
n2+ 2 ·
n2
X
k=2
1
n2·E(MDG(Pk))
= 1 + 2
n2
n2
X
k=2
E(MDG(Pk))
Lemma 7. For any n3:
E(MDG(Pn)) = 1+ 2
n2
n2
X
k=2
E(MDG(Pk)) = n1
2+n1
2
n1
X
p=0
(2)p
p!+
n2
X
p=0
(2)p
p!
Proof. We note un=E(M DG(Pn)) for simplicity.
Let un= 1 + 2
n2
n2
X
k=2
uk, with u0=u1= 0, and u2= 1 (from Lemma 6).
First, we will show that un=n3
n2un1+2
n2un2+1
n2. It suffices to note that:
n2
n3un=n2
n3+2
n3
n2
X
k=2
uk
=n2
n3+2
n3
n3
X
k=2
uk+2
n3un2
= 1 + 1
n3+2
n3
n3
X
k=2
uk+2
n3un2
=un1+1
n3+2
n3un2
hence
un=n3
n2un1+2
n2un2+1
n2
We will show now the result claimed in the lemma by induction. It is easy to show
that the equality is true for n= 3. We assume that the equality is true up to rank
n1 and we verify it at rank n. We have:
un=n3
n2un1+2
n2un2+1
n2
Noting bn=Pn
p=0
(2)p
p!and by induction hypothesis, we obtain:
un=n3
n2n
21 + n
21bn2+bn3+2
n2n
23
2+n
23
2bn3+bn4+
1
n2
ACM Journal Name, Vol. V, No. N, Month 20YY.
10 ·F. Delbot and C. Laforest
un=(n3)n
2(n2) n3
n2+(n3)n
2(n2) n3
n2bn2+n3
n2bn3+n3
n2+n3
n2bn3+2
n2bn4+
1
n2
un=n3
2+n3
2bn2+n3
n2bn3+n3
n2+n3
n2bn3+2
n2bn4+1
n2
un=n1
2+n3
2bn2+bn3
n3
n22 + 2
n2bn4
To prove the result, it suffices to show that
Z=n1
2+n3
2bn2+bn3
n3
n22+ 2
n2bn4n1
2+n1
2bn1+bn2= 0
After simplifications, we obtain:
Z=n5
2bn2+bn3
n3
n22 + 2
n2bn4n1
2bn1
Noticing that bnk=bnPn
j=nk+1 aj, with aj=(2)p
j!, we have:
Z=n5
2(bn1an1)+(bn1an1an2)n3
n22+ 2
n2(bn1an1an2an3)
n1
2bn1
Z=bn1n5
2+n3
n22 + 2
n2n1
2an1n5
2+n3
n22 + 2
n2an2n3
n22 + 2
n2
2
n2an3
Z=n1
2an12an22
n2an3
Noticing that an1=n
2an, we obtain:
Z=n1
2an12n1
2an12
n2(n1)(n2)
4an1
Z=an1n1
2+n1n1
2= 0
which proves the result.
Theorem 8. E(Edge Deletion(Pn)) = nnPn1
p=0
(2)p
p!2Pn2
p=0
(2)p
p!.
Proof. The result is proved in the same way as MDG.
3.2 Limits of the expected approximation ratio
In this section, we study the asymptotic behavior of these algorithms on Pnby
calculating the limit of their approximation ratio when the size of the path tends
to infinity.
ACM Journal Name, Vol. V, No. N, Month 20YY.
Analytical and experimental comparison of six algorithms for the vertex cover ·11
Lemma 9. Let opt(Pn) = n
2be the size of an optimal vertex cover on Pnand
A(Pn)the size of the solution returned by an algorithm Aapplied on Pn. We have:
EA(Pn)
opt(Pn)=E(A(Pn))
opt(Pn)
Proof. See proof in [Birmel´e et al. 2009].
Theorem 10. The limit of the expected approximation ratio of Depth First
Search on Pnwhen ntends to infinity is 2.
Proof. By lemma 9, and noticing that E(DF S (Pn)) = n2 + 2
nand opt(Pn) =
n
2, we obtain directly the result.
Theorem 11. The limit of the expected approximation ratio of ListLeft on Pn
when ntends to infinity is 4
3.
Proof. The limit of the expected approximation ratio is obtained easily by using
Theorem 3 and noticing that
2
3
2n1
n1=
2n1
3
n1
2
2n1
3
n
2
2n1
3
n
2
=2
3
2n1
n.
The following result has been shown in [Birmel´e et al. 2009].
Theorem 12. The limit of the expected approximation ratio of ListRight on
Pnwhen ntends to infinity is 1 + e2.
Proof. See proof in [Birmel´e et al. 2009].
By applying similar techniques used in [Birmel´e et al. 2009], we can show the limit
of the expected approximation ration of Maximum Degree Greedy and Edge
Deletion. We only present the proof for Maximum Degree Greedy here.
Theorem 13. The limit of the expected approximation ratio of Maximum De-
gree Greedy on Pnwhen ntends to infinity is 1 + e2.
Proof. It follows from Lemma 9 that:
limn→∞ EMD G(Pn)
OP T (Pn)= limn→∞
E(MD G(Pn))
OP T (Pn)= limn→∞
E(MD G(Pn))
n
2.
Using Theorem 5 and with bn=Pn
p=0
(2)p
p!, we have
E(MDG(Pn)) = n1
2+n1
2bn1+bn2
and
n1
2+n1
2bn1+bn2
n
2
n1
2+n1
2bn1+bn2
n
2
n1
2+n1
2bn1+bn2
n1
2
Noticing that e2=P
k=0
(2)k
k!([Abramowitz and Stegun 1964]), we calculate the
limit of the left side:
lim
n→∞
n1
2+n1
2bn1+bn2
n
2
= lim
n→∞
n1 + (n1)bn1+ 2bn2
n
ACM Journal Name, Vol. V, No. N, Month 20YY.
12 ·F. Delbot and C. Laforest
= 1 + lim
n→∞
n1
nbn1+ lim
n→∞
2
nbn2= 1 + e2
In the same way, we calculate the limit of the right side:
lim
n→∞
n1
2+n1
2bn1+bn2
n1
2
= lim
n→∞
n1 + (n1)bn1+ 2bn2
n1
= 1 + lim
n→∞
n1
n1bn1+ lim
n→∞
2
n1bn2= 1 + e2
which proves the result.
Theorem 14. The limit of the expected approximation ratio of Edge Dele-
tion on Pnwhen ntends to infinity is 22e2.
Proof. The result is proved in the same way as Theorem 13.
Algorithm Limit of the expectation
of the approxiamtion ratio
Greedy Independent Cover 1
Maximum Degree Greedy 1 + e21.13
ListRight 1 + e21.13
ListLeft 4
31.33
Edge Deletion 22e21.73
Depth First Search 2
Table I: Summary of the theoretical results obtained on paths
These different results show that the algorithms with the worst approximation
ratios can achieve good results on graphs for which at least half of vertices are in
the solution. At the opposite, the algorithms that have a constant approximation
ratio, which are most frequently cited in the literature (eg Edge Deletion) do
not provide the best solutions.
4. EXPERIMENTAL ANALYSIS
In the previous section, we conducted an analytical comparative study of the behav-
ior of different algorithms on paths. As it is difficult to get such analytical results
on any graph we decided to conduct an experimental comparison of the average
quality of these algorithms. In this section, we will describe the measure which
seems to be the most appropriate to capture the average quality of algorithms.
Subsequently, we will define the methodology we followed and at the end, we will
present the results obtained on different samples of graphs.
What do we measure?
Let Gbe any graph with nvertices and let OP T (G) be the size of an optimal ver-
tex cover of G. We note E(A(G)) the average size of vertex covers constructed when
executing algorithm Aseveral times on graph G. As we want to know if E(A(G)) if
far from OP T (G), we calculate E(A(G)) OP T (G). As graphs (of different size)
are grouped in samples (having the same particular/structural properties), it is not
ACM Journal Name, Vol. V, No. N, Month 20YY.
Analytical and experimental comparison of six algorithms for the vertex cover ·13
obvious to compare the algorithms just on this criteria since we should compare
them graph by graph (some samples contain more than 4000 graphs). We need a
way to “normalize” these values. To do that, we know that in Gall the possible
vertex covers have size between OP T (G) and n. We define here the percentage of
error of algorithm Aon graph G, given by the following formula:
100.E(A(G)) OP T (G)
nOP T (G)
(this measure comes from ideas similar to the ones of the differential approximation
ratio (see [Monnot et al. 2003] for a detailed presentation)).
4.1 Experimental method
In this sub-section we present our experimental approach, our tools and the samples
of graphs on which we conducted our tests.
Randomness and execution time. In the initial description of the algo-
rithms (in Section 2.1) the mechanisms to make the choices are not specified. As
our software was developed in Java, we used the Java random generator to make
the equiprobable different “local” choices (otherwise, each execution of the same
algorithm on the same graph would always return the same size, see discussions
in Section 2.2). However, in a real application, a programmer would implement a
deterministic and fast choice with optimal data structures. This is not what we
did here since we need variability between executions. Thus, we do not give the
computation times of various algorithms or details about the machine on which
we ran our experiments. However, we know that all algorithms have polynomial
time complexity (at most in O(nm)) with appropriated data structures, are easy
to implement and do not use “hidden” tools like LP solver (this is why we study
them, see Introduction of the paper).
“Sorted versions” of ListRight and ListLeft. In [Avis and Imamura 2007],
the authors used the ListLeft algorithm with lists that are sorted by decreasing
order of their degrees. In order to assess the influence of sorting lists on the perfor-
mances of lists algorithms, we will consider two versions of each list algorithm. The
sorted versions, called Sorted ListLeft and Sorted ListRight and unsorted
versions called ListLeft and ListRight. The algorithms Sorted ListLeft and
Sorted ListRight require the generation of sorted lists. To get them, we had
the choice between two methods: selecting one list uniformly among all possible
lists (i.e. n!, with nthe size of the graph) and then sort the list or select a list
uniformly among all sorted lists. We chose the first method for its simplicity and
to consider Sorted ListLeft and Sorted ListRight in the same manner than
ListLeft and ListRight because this allows us, given a list, to compare the four
algorithms, which is quite interesting.
Experimental method. The graphs to be tested are grouped in samples (see
after for a description of the samples). For each graph Gof each sample, we used
LPSOLVE or Cplex to calculate OP T (G), the size of an optimal vertex cover. For
each sample, we made 10,000 iterations of each algorithm on each instance of the
ACM Journal Name, Vol. V, No. N, Month 20YY.
14 ·F. Delbot and C. Laforest
sample. Then we calculated the average of these 10,000 iterations for each algo-
rithm. These values allows us to calculate the percentage of error of each algorithm
for each graph G.
The samples. Since computing the optimal solution can be very long (even us-
ing fast solvers like Cplex), we are restricted to graphs with less than 1000 vertices.
Erd¨os-Renyi Random Graphs. We generated 4500 random graphs using the
Erd¨os-Renyi model. More precisely, for each size of graph n,n∈ {20,40,60,80,100}
and for each probability pwith p∈ {0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9}, we gen-
erated 100 graphs Gn,p .
Remark about the number of iterations. In [Delbot 2009], the first author
provided two formulas to compute the exact expectation of the size of solutions
returned by algorithms ListLeft and ListRight on Erd¨os-Renyi graphs. We
compared these two formulas to the experimental results obtained by these two al-
gorithms on this sample and we showed that they match very well. It indicates that
our sample of random graphs is sufficiently representative of Erd¨os-Reyni graphs.
Moreover, the fact that our algorithms behave as expected indicates that the num-
ber of iterations that we have made is large enough. Hence, we assume that this
will be the same for the other algorithms.
Benchmarks with Hidden Optimum Solutions (BHOSLIB). These bench-
marks can be found at ”http://www.nlsde.buaa.edu.cn/˜kexu/benchmarks/graph-
benchmarks.htm” and are composed of hard instances generated with the Model
RB (see [Xu and Li 2006]). Instances are generated as follow:
(1) Generate ndisjoint cliques, each of which has nαvertices (where α > 0 is a
constant);
(2) Randomly select two different cliques and then generate without repetitions
pn2αrandom edges between these two cliques (where 0 < p < 1 is a constant);
(3) Run Step 2 (with repetitions) for another rn ln n1 times (where r > 0 is a
constant).
In [Xu et al. 2007], the authors show how to choose appropriate values of p,ret α.
Benchmarks obtained from this method are the following2:
—5 instances with 450 vertices (30 cliques), with OPT = 420;
—5 instances with 595 vertices (35 cliques), with OPT = 560;
—5 instances with 760 vertices (40 cliques), with OPT = 720;
—5 instances with 945 vertices (45 cliques), with OPT = 900;
—5 instances with 1150 vertices (50 cliques), with OPT = 1100;
—5 instances with 1272 vertices (53 cliques), with OPT = 1219;
—5 instances with 1400 vertices (56 cliques), with OPT = 1344;
2For each instance, the size of the minimum vertex cover is known, but the solution itself is not
given.
ACM Journal Name, Vol. V, No. N, Month 20YY.
Analytical and experimental comparison of six algorithms for the vertex cover ·15
—5 instances with 1534 vertices (59 cliques), with OPT = 1475;
Trees. We compared the algorithms on trees. These graphs have a low density,
are connected and it is easy to compute an optimal solution (for example, with
Greedy Independent Cover). Instances are generated as follow:
(1) Start with a complete graph with n > 3 vertices;
(2) Delete a random edge such that the resulting graph is connected;
(3) Run step 2 while there is more than n1 edges.
With this method, and for n= 50, 100, 500 and 1000, we generated 1000 trees (for
a total of 4000 trees).
Average worst case. Graphs that trap an algorithm. Given an algorithm
Aand a measure (approximation ratio for example), we say that a graph Gtraps
Aif A, executed on G, leads to the worst possible measure (or at least to a “bad”
measure). When it was possible, we generated instances that trap an algorithm
on average and in terms of the percentage of error. The interest of this sample is
twofold. On the one hand, it is necessary to show that different algorithms may
get bad results in average on at least one class of graphs, and it is interesting, sec-
ondly, to observe the behavior of the other algorithms on these particular instances.
—For Sorted ListLeft, we used the graphs that we call P roW presented in
[Delbot and Laforest 2008] (see Fig. 1 for N= 3 for example). On these graphs,
this algorithm always returns a solution of size exactly N+1
2|OP T |, with N2
the dimension of the graph.
—For Sorted ListRight, we used a modification of graphs P roW in order to
obtain the same behavior. We link each vertex of F1to each vertex of V2(see
Fig. 2 for N= 3 for example).
F1
F2
V1
V2
U
Fig. 1: Graph P roW with N= 3.
F1
F2
V1
V2
U
Fig. 2: Modified graph P roW with N= 3.
—For Edge Deletion, we used complete bipartite graphs Ka,a with the two sets
of vertices of equal size a, because each execution of this algorithm returns a
perfect matching, which is the worst solution.
—For Maximum Degree Greedy, we used the Anti M DG graphs presented in
[Papadimitriou and Yannakakis 1988] for example without the vertices of degree
ACM Journal Name, Vol. V, No. N, Month 20YY.
16 ·F. Delbot and C. Laforest
B1
A1
B2
A2
B3
A3
B4
A4
B5
A5
B6
A6
C1 C2C3 C4 C5
Fig. 3: Example of a modified Anti M DG graph of dimension 6.
2, in order to force any execution to return the worst case (see Fig. 3 for an
example).
—For Greedy Independent Cover, we used the graphs presented in [Avis and
Imamura 2007]. On these graphs, it always returns a
2approximated solution.
Fig. 4: Example of trap graph for Greedy Independent Cover with ∆ = 9.
—For ListLeft, we did not need to use a specific class of graphs because this
algorithm performs bad on most instances previously presented.
—Finding a class of graphs that trap an algorithm in average is not a simple task.
We shown in [Birmel´e et al. 2009] that the average size returned by algorithm
ListRight on any graph Gis at most 2O P T (G); this average approximation
ratio tends to be reached for stars when the number of leaves tends to infinity.
However, the percentage of error of ListRight on the stars is very close to 0
as its average performance is very far from the worst case (all the leaves and
the center of the star). We did not find graphs trapping ListRight for the
percentage of error parameter. For this reason, we will evaluate this algorithm
only on the instances that trap the other algorithms.
Finally, our average worst case sample contains:
—5 modified Anti M DG graphs of dimension from 30 to 34;
—5 graphs of Avis and Imamura of dimension from 30 `a 34;
—5 P roW graphs with Nfrom 30 `a 34;
—5 modified P rowW graphs with Nfrom 30 `a 34;
—5 complete bipartite graphs: K10,10,K15,15,K20,20 ,K25,25,K30,30 .
ACM Journal Name, Vol. V, No. N, Month 20YY.
Analytical and experimental comparison of six algorithms for the vertex cover ·17
Regular and near-regular graphs. We also wanted to compare the algorithms
on graphs with a regular structure such as grids, tori, hypercubes and random
regular graphs. These graphs have an optimal solution that contains half of the
vertices (±one vertex for grids and tori). This sample contains:
—all grids and tori of size 2 ×2 to 20 ×20;
—hypercubes of dimension 3 to 12;
—36 random regular graphs with a number of vertices between 28 and 98. The
degree of these graphs varies from 3 to 8.
4.2 Experimental results
The results are grouped by sample, with one sample per page. Each page contains
8 figures representing the performance of each algorithm. The horizontal axis of
each figure represents the rounded up percentage of error obtained by the algo-
rithm to an instance of the sample and the vertical axis represents the number of
instances of the sample that had received this value. See Figure 5 for an example
and explanation.
0
20
40
60
80
100
120
140
160
0 20 40 60 80 100
Fig. 5: Example of image obtained for the MDG algorithm when applied 10,000 times to each
graph of the Erd¨os-Renyi sample. The best percentage of error reach 0 while the worst is less
than 38. This algorithm obtain a percentage of error between 10% and 25% for the majority of
the instances of the sample.
—Figures 6, 7, 8, 9, 10, 11, 12 and 13 are obtained by applying the algorithms on
the random Erd¨os-Renyi graphs sample.
—Figures 14, 15, 16, 17, 18, 19, 20 and 21 are obtained by applying the algorithms
on the trees sample.
—Figures 22, 23, 24, 25, 26, 27, 28 and 29 are obtained by applying the algorithms
on the benchmarks BHOSLIB.
—Figures 30, 31, 32, 33, 34, 35, 36 and 37 are obtained by applying the algorithms
on the average worst case graphs sample.
ACM Journal Name, Vol. V, No. N, Month 20YY.
18 ·F. Delbot and C. Laforest
—Figures 38, 39, 40, 41, 42, 43, 44 and 45 are obtained by applying the algorithms
on the regular graphs sample.
To understand the overall performance of an algorithm on a sample, it is inter-
esting to know the extreme values of the percentage of error. Table II contains, for
each sample and each algorithm the best and the worst percentage of error obtained
on the sample.
Sample GIC MDG SLL SLR LL LR ED DFS
Erd¨os-Renyi 0-25 1-33 25-88 0-43 63-82 13-42 68-97 36-91
Trees 0-0 0-9 2-19 0-6 29-42 7-17 46-67 18-48
BHOSLIB 15-20 30-44 74-90 24-36 81-85 32-34 85-88 89-98
Regular graphs 0-8 0-32 0-83 0-55 16-83 0-55 68-100 50-99
Average worst case graphs 0-94 0-70 12-98 0-95 34-97 0-18 6-100 6-100
Table II: Summary of the performances obtained by each algorithm for each sample. The first
number represents the best percentage of error obtained on the sample and the second represents
the worst.
The average size of solutions is an important property to capture when studying
the average performance of an algorithm. Table III contains, for each sample and
each algorithm, the average size of solutions.
Sample LL LR SLL SLR ED DFS MDG GIC
Erd¨os-Renyi (n= 100) 96.85 91.34 94.64 90.07 97.59 96.78 89.79 89.0
Trees (n= 100) 62.56 49.01 47.54 43.09 73.98 59.22 43.73 42.35
BHOSLIB 1005.59 982.39 1006.07 980.32 1006.95 1010.52 983.59 975.4
Regular graphs 87.64 69.89 88.89 69.44 100.06 107.56 66.1 57.86
Average worst case graphs 610.48 133.15 598.14 413.82 153.35 163.95 99.7 242.66
Table III: Summary of the average size of solutions obtained by each algorithm for each sample.
Table IV contains, for each sample and each algorithm, the smallest and et the
largest variance obtained on the sample.
Erd¨os-Renyi BHOSLIB Trees Reg. graphs Av. worst case graphs
Vmin Vmax Vmin Vmax Vmin Vmax Vmin Vmax Vmin Vmax
LL 0.8 5.39 2.28 4.15 7.01 14.95 0.0 71.97 1.36 1319.45
LR 0.0 7.69 1.75 3.29 2.21 11.37 0.0 318.06 0.0 33242.0
SLL 0.0 2.21 0.0 0.5 0.12 3.05 0.0 72.55 0.0 31.16
SLR 0.0 6.16 0.0 3.38 0.0 1.55 0.0 318.77 0.0 17.61
ED 0.29 6.31 2.80 5.13 4.97 13.33 0.0 74.87 0.0 51.23
DFS 0.0 3.15 0.0 0.01 0.19 0.25 0.0 5.24 0.0 0.19
MDG 0.0 2.08 0.7 2.32 0.0 1.81 0.0 9246.3 0.0 12.76
GIC 0.0 3.59 0.07 1.97 0.0 0.0 0.0 11.91 0.0 0.0
Table IV: Summary of the variances obtained by each algorithm for each sample. The first number
represents the smallest variance obtained for the sample and the second represents the largest.
ACM Journal Name, Vol. V, No. N, Month 20YY.
Analytical and experimental comparison of six algorithms for the vertex cover ·19
0
20
40
60
80
100
120
140
160
0 20 40 60 80 100
Fig. 6: Greedy Independent Cover
0
20
40
60
80
100
120
140
160
0 20 40 60 80 100
Fig. 7: Maximum Degree Greedy
0
20
40
60
80
100
120
140
160
0 20 40 60 80 100
Fig. 8: ListLeft
0
20
40
60
80
100
120
140
160
0 20 40 60 80 100
Fig. 9: ListRight
0
20
40
60
80
100
120
140
160
0 20 40 60 80 100
Fig. 10: Sorted ListLeft
0
20
40
60
80
100
120
140
160
0 20 40 60 80 100
Fig. 11: Sorted ListRight
0
20
40
60
80
100
120
140
160
0 20 40 60 80 100
Fig. 12: Depth First Search
0
20
40
60
80
100
120
140
160
0 20 40 60 80 100
Fig. 13: Edge Deletion
Erd¨os-Renyi random graphs sample
ACM Journal Name, Vol. V, No. N, Month 20YY.
20 ·F. Delbot and C. Laforest
0
2000
4000
6000
8000
10000
0 20 40 60 80 100
Fig. 14: Greedy Independent Cover
0
50
100
150
200
250
300
0 20 40 60 80 100
Fig. 15: Maximum Degree Greedy
0
50
100
150
200
250
300
0 20 40 60 80 100
Fig. 16: ListLeft
0
50
100
150
200
250
300
0 20 40 60 80 100
Fig. 17: ListRight
0
50
100
150
200
250
300
0 20 40 60 80 100
Fig. 18: Sorted ListLeft
0
50
100
150
200
250
300
0 20 40 60 80 100
Fig. 19: Sorted ListRight
0
50
100
150
200
250
300
0 20 40 60 80 100
Fig. 20: Depth First Search
0
50
100
150
200
250
300
0 20 40 60 80 100
Fig. 21: Edge Deletion
Trees Sample
ACM Journal Name, Vol. V, No. N, Month 20YY.
Analytical and experimental comparison of six algorithms for the vertex cover ·21
0
5
10
15
20
0 20 40 60 80 100
Fig. 22: Greedy Independent Cover
0
5
10
15
20
0 20 40 60 80 100
Fig. 23: Maximum Degree Greedy
0
5
10
15
20
0 20 40 60 80 100
Fig. 24: ListLeft
0
5
10
15
20
0 20 40 60 80 100
Fig. 25: ListRight
0
5
10
15
20
0 20 40 60 80 100
Fig. 26: Sorted ListLeft
0
5
10
15
20
0 20 40 60 80 100
Fig. 27: Sorted ListRight
0
5
10
15
20
0 20 40 60 80 100
Fig. 28: Depth First Search
0
5
10
15
20
0 20 40 60 80 100
Fig. 29: Edge Deletion
BHOSLIB sample
ACM Journal Name, Vol. V, No. N, Month 20YY.
22 ·F. Delbot and C. Laforest
0
5
10
15
20
25
0 20 40 60 80 100
Fig. 30: Greedy Independent Cover
0
5
10
15
20
0 20 40 60 80 100
Fig. 31: Maximum Degree Greedy
0
1
2
3
4
5
6
7
0 20 40 60 80 100
Fig. 32: ListLeft
0
1
2
3
4
5
6
7
8
9
0 20 40 60 80 100
Fig. 33: ListRight
0
1
2
3
4
5
6
7
8
9
0 20 40 60 80 100
Fig. 34: Sorted ListLeft
0
2
4
6
8
10
12
14
16
0 20 40 60 80 100
Fig. 35: Sorted ListRight
0
2
4
6
8
10
0 20 40 60 80 100
Fig. 36: Depth First Search
0
2
4
6
8
10
12
0 20 40 60 80 100
Fig. 37: Edge Deletion
Average worst case sample
ACM Journal Name, Vol. V, No. N, Month 20YY.
Analytical and experimental comparison of six algorithms for the vertex cover ·23
0
50
100
150
200
250
300
350
0 20 40 60 80 100
Fig. 38: Greedy Independent Cover
0
50
100
150
200
250
300
350
0 20 40 60 80 100
Fig. 39: Maximum Degree Greedy
0
50
100
150
200
250
300
350
0 20 40 60 80 100
Fig. 40: ListLeft
0
50
100
150
200
250
300
350
0 20 40 60 80 100
Fig. 41: ListRight
0
50
100
150
200
250
300
350
0 20 40 60 80 100
Fig. 42: Sorted ListLeft
0
50
100
150
200
250
300
350
0 20 40 60 80 100
Fig. 43: Sorted ListRight
0
50
100
150
200
250
300
350
0 20 40 60 80 100
Fig. 44: Depth First Search
0
50
100
150
200
250
300
350
0 20 40 60 80 100
Fig. 45: Edge Deletion
Regular graphs sample
ACM Journal Name, Vol. V, No. N, Month 20YY.
24 ·F. Delbot and C. Laforest
4.3 Analysis of the results and comments
4.3.1 Greedy Independent Cover and Maximum Degree Greedy.The
most visible result is the very good performance of the algorithm Greedy Inde-
pendent Cover. The percentage of error of this algorithm is better than all the
other algorithms, for all instances of our samples except for the 5 Anti GIC
graphs. This algorithm is optimal on average for many instances, like the Erd¨os-
Renyi graphs with a low probability of edge, trees and a large part of regular graphs.
Its percentage of error never exceeds 25% (except for the 5 Anti GIC graphs) and
its variance is always small, showing that it is an excellent algorithm. Even if it is
worse than Greedy Independent Cover,Maximum Degree Greedy is also
very good. Its percentage of error never exceeds 44% (except for the Anti M DG
graphs) and it has, for each sample, one of the three best average solution sizes.
Moreover, its variance is low (apart from the hypercubes of the regular graphs
sample).
4.3.2 List algorithms. Even if the descriptions of ListLeft and ListRight
are similar, their performances are very different. By observing the results in Table
II, we can remark that for 4 samples, the worst percentage of error obtained by
ListRight is better than the best percentage of error obtained by ListLeft. The
percentage of error of ListRight never exceeds 55% and the variances of the two
algorithms are quite low, except for certain specific instances such as Anti GI C
or hypercubes. Tables III and IV indicates that ListRight is a good algorithm
(even if it is not the best). ListLeft is rather bad since most percentages of error
are above 50%. Sorting the lists by decreasing degrees seems to be a good idea
since this yields to better results (compared to the non-sorted versions). However,
sorting the vertices has the effect to decrease the quality of returned solutions for
some instances of the random graphs sample and the BHOSLIB sample.
4.3.3 Edge Deletion and Depth First Search.These two algorithms have
similar performances, even if Edge Deletion is slightly worse. Edge Deletion
performs worse than all other algorithms on the Erd¨os-Renyi graphs samples and
BHOSLIB benchmarks, and all algorithms except Depth First Search for reg-
ular graphs and the 4 algorithms Greedy Independent Cover,Maximum De-
gree Greedy,Sorted ListRight and ListRight on trees. Its percentage of
error is never less than 46%, which shows that this algorithm returns only solutions
of poor quality. Tables III and IV indicates that they are the two worst algorithms
studied in this article.
4.3.4 Synthesis of our study. From these results and comments, we ranked the
algorithms, sample by sample by using the following (informal) criteria:
“algorithm Ais better than algorithm Bon a given sample if most of the per-
centages of error obtained by algorithm Aare less than those obtained by algorithm
B.”
From table V, we can conclude that the ranking of the 4 algorithms Greedy
Independent Cover,Maximum Degree Greedy,Depth First Search and
ACM Journal Name, Vol. V, No. N, Month 20YY.
Analytical and experimental comparison of six algorithms for the vertex cover ·25
Sample 1 2 3 4 5 6 7 8
Erd¨os-Renyi GIC MDG SLR LR SLL LL DFS ED
Trees GIC SLR MDG SLL LR DFS LL ED
BHOSLIB GIC SLR LR MDG LL SLL ED DFS
Regular graphs GIC MDG SLR LR SLL LL DFS ED
Average worst case graphs GIC MDG SLR LR SLL LL DFS ED
Table V: Table of rank of the algorithms by sample
Edge Deletion, based on experimental results is exactly the opposite of the
one obtained using only the worst-case approximation ratio. Moreover, ListRight
behaves very well, despite its large worst case approximation ratio.
5. CONCLUSION
In a first part of this paper, we evaluated analytically the expectation of 6 algorithms
on paths: 2 algorithms with worst case approximation ratio 2 (Edge Deletion
and Depth First Search), 2 list algorithms (ListLeft and ListRight) and
2 greedy algorithms with non-constant and large worst case approximation ratios
(Maximum Degree Greedy and Greedy Independent Cover). As in paths
no vertex cover has size more than 2 times an optimal one no algorithm is, a pri-
ori, penalized by a potential “pathological behavior” that would lead to solutions
arbitrarily larger than an optimal one. This family of graphs is then interesting to
make comparisons. We have proved that the algorithms having the best worst case
approximation ratios are those who get the worst average results in paths. At the
opposite we see that guarantying a worst case approximation ratios of 2 (like Edge
Deletion and Depth First Search) has a “cost” in terms of structure of the
returned solutions: they are in general non minimal for inclusion and this seems
to have a negative impact on the expectation. To finish, it is known that Greedy
Independent Cover is optimal on trees, and thus on paths.
In the second part of this paper, we conducted an experimental comparison of
the quality of solutions returned by these 6 algorithms (plus 2 variants: Sorted
ListLeft and Sorted ListRight). We proposed a measure (derived from the
differential approximation ratio) to assess the average quality of solutions. Then,
we made samples of different instances with different properties. It appears from
this study that the two algorithms with approximation ratio of 2 return solutions of
poor quality. Instead, the two greedy algorithms Greedy Independent Cover
and Maximum Degree Greedy are very efficient and always return solutions of
excellent quality, exept for graphs specifically designed to trap them.
The classification of Greedy Independent Cover,Maximum Degree Greedy,
Depth First Search and Edge Deletion based on experimental results and
those obtained on paths is exactly the opposite of the one obtained using only
the worst-case approximation ratio.
Another spectacular result is that, despite a very bad worst case, the expectation
of the size of solutions returned by ListRight (which is an online algorithm) seems
ACM Journal Name, Vol. V, No. N, Month 20YY.
26 ·F. Delbot and C. Laforest
to be always less than or equal to the expectation of the size of solutions returned
by Edge Deletion (which is offline and has an approximation ratio of 2).
From this study we can conclude that Greedy Independent Cover is the al-
gorithm that obtains the best average performances. However, we exhibited special
graphs for which it returns large solutions compared to optimal. It is therefore
necessary to make a choice. Either we are seeking for the best solutions by agreeing
to obtain solutions of poor quality in very rare cases (by choosing Greedy In-
dependent Cover), or we accept solutions whose quality is slightly worse than
Greedy Independent Cover but with a guarantee on average performance (by
choosing ListRight), or we want the best guaranteed in worst case (by choosing
Edge Deletion) while being aware that this choice comes implies a bad average
quality of the returned solutions.
Perspectives. From a practical point of view the average behavior of the algo-
rithms gives interesting information compared to the worst case approximation.
However, we do not affirm that this average behavior is the only pertinent mea-
sure. We only say that it is a useful complement to the worst case analysis. It
is pertinent only if it is significant. To measure the pertinence a more detailed
analysis (based on variance for example) is required to complete the study. This is
what we plan to do in the future.
Another perspective is to extend our study to other discrete optimization prob-
lems. For example, some domination problems in graphs are similar to vertex
cover and could be investigated. More generally, we think that the approxima-
tion algorithms should also be evaluated and compared in average. Analytical and
experimental methodology must be developed for that. We obtained preliminary
results in this study and in [Delbot and Laforest 2008] and we plan to go further.
In this perspective, we are convinced that for any graph G,E(ListRight(G))
E(Edge Deletion(G)). It would be interesting to give an analytical proof of that
inequality or to show that graphs violating it are rare.
Acknowledgments. The authors thank the anonymous referees for they construc-
tive comments.
REFERENCES
Abramowitz, M. and Stegun, I. A. 1964. Handbook of Mathematical Functions with Formulas,
Graphs, and Mathematical Tables, ninth Dover printing, tenth GPO printing ed. Dover, New
York.
Ausiello, G.,Protasi, M.,Marchetti-Spaccamela, A.,Gambosi, G.,Crescenzi, P.,and
Kann, V. 1999. Complexity and Approximation: Combinatorial Optimization Problems and
Their Approximability Properties. Springer-Verlag New York, Inc., Secaucus, NJ, USA.
Avis, D. and Imamura, T. 2007. A list heuristic for vertex cover. Operations Research Let-
ters 35, 2, 201–204.
Birmel´
e, E.,Delbot, F.,and Laforest, C. 2009. Mean analysis of an online algorithm for the
vertex cover problem. Information Processing Letters 109, 9, 436–439.
Cardinal, J.,Labb´
e, M.,Langerman, S.,Levy, E.,and M´
elot, H. 2005. A tight analysis of
the maximal matching heuristic. In Computing and Combinatorics: 11th Annual International
Conference, COCOON 2005. Lecture Notes in Computer Science, vol. 3595. Springer–Verlag,
Kunming, China, 701 – 709.
ACM Journal Name, Vol. V, No. N, Month 20YY.
Analytical and experimental comparison of six algorithms for the vertex cover ·27
Cormen, T. H.,Leiserson, C. E.,Rivest, R. L.,and Stein, C. 2009. Introduction to Algorithms,
3rd ed. MIT Press.
Delbot, F. 2009. Au del`a de l’´evaluation en pire cas : comparaison et ´evaluation en moyenne
de processus d’optimisation pour le probl`eme du vertex cover et des arbres de connexion de
groupes dynamiques. Ph.D. thesis, Universit´e d’ ´
Evry Val d’Essonne.
Delbot, F. and Laforest, C. 2008. A better list heuristic for vertex cover. Information Pro-
cessing Letters 107, 3-4, 125–127.
Demange, M. and Paschos, V. T. 2005. On-line vertex-covering. Theoretical Computer Sci-
ence 332, 1-3, 83–108.
Garey, M. and Johnson, D. 1979. Computers and Intractability. Freeman and Co., New York.
Halld´
orsson, M. and Radhakrishnan, J. 1994. Greed is good: approximating independent sets
in sparse and bounded-degree graphs. In STOC ’94: Proceedings of the twenty-sixth annual
ACM symposium on Theory of computing. ACM, New York, NY, USA, 439–448.
Hochbaum, D. S., Ed. 1997. Approximation algorithms for NP-hard problems. PWS Publishing
Compagny, Boston, MA, USA.
Khot, S. and Regev, O. 2008. Vertex cover might be hard to approximate to within 2 ǫ.
Journal of Computer and System Sciences 74, 3, 335–349.
Monnot, J.,Paschos, V. T.,and Toulouse, S. 2003. Polynomial approximation of hard NP-
problems: local extremals and differential relation. (Approximation polynomiale des probl`emes
NP-difficiles: optima locaux et rapport diff´erentiel.). Hermes Science Publications.
Papadimitriou, C. and Yannakakis, M. 1988. Optimization, approximation, and complexity
classes. In STOC ’88: Proceedings of the twentieth annual ACM symposium on Theory of
computing. ACM Press, New York, NY, USA, 229–234.
Roth-Korostensky, C. 2000. Algorithms for building multiple sequence alignments and evolu-
tionary trees. Ph.D. thesis, ETH Z¨urich, Institute of Scientific Computing.
Savage, C. 1982. Depth-first search and the vertex cover problem. Inf. Process. Lett. 14, 5 (July),
233–235.
Stege, U. 2000. Resolving conflicts from problems in computational biology. Ph.D. thesis, ETH
urich, Institute of Scientific Computing.
Vazirani, V. 2002. Approximation algorithms. 1st edition, Corr. 2nd printing. Springer.
Xu, K.,Boussemart, F.,Hemery, F.,and Lecoutre, C. 2007. Random constraint satisfaction:
Easy generation of hard (satisfiable) instances. Artif. Intell. 171, 8-9, 514–534.
Xu, K. and Li, W. 2006. Many hard examples in exact phase transitions. Theor. Comput.
Sci. 355, 3, 291–302.
Zhang, Y.,Ge, Q.,Fleischer, R.,Jiang, T.,and Zhu, H. 2006. Approximating the minimum
weight weak vertex cover. Theoretical Computer Science 363, 1, 99–105.
ACM Journal Name, Vol. V, No. N, Month 20YY.
... Such problems are called intractable but because of their importance they must be solved. [10] One option to solve such NP-Problems is to use heuristics. Heuristics do not guarantee the quality of solution and no guarantee also on the time required to solve the problem. ...
... The Maximum Degree Greedy (MDG) algorithm is an adaptation of a well-known heuristic algorithm used for extracting the MIS MDG keeps adding the node with the maximum degree until all edges in the graph are covered. [7,9,10] The Greedy Independent Cover (GIC) is an adaptation of the algorithm presented in. In this algorithm we select the vertex of the minimum degree and all its neighbors to the vertex cover, the process continues until we cover all edges. ...
... In this algorithm we select the vertex of the minimum degree and all its neighbors to the vertex cover, the process continues until we cover all edges. [10,11] In the algorithm LISTLEFT is proposed to find vertex cover based on a list heuristic. In this algorithm the selection of the vertices is known in advance and cannot be changes. ...
Article
Full-text available
Minimum vertex cover (MVC) is a well-known NP-Complete optimization problem. The importance of MVC in theory and practical comes from the wide range of its applications. This paper describes a polynomial time greedy algorithm to find near optimal solutions for MVC. The new algorithm NMVAS is a modification of already existed algorithm called MVAS which uses the same principle of selecting candidate from the neighborhood of the vertex with a modification in the selection procedure. A comparative study is conducted between the NMVAS and MVAS which shows that the proposed algorithm NMVSA provides better or equal results in the most cases of the underlying data sets which leads to a better average approximation ratio of NMVAS. NMVAS inherits the simplicity of the original algorithm.
... They proved that GIC can find optimal solution for trees and therefore in paths. Delbot and Laforest have shown that on average, GIC performs better than other algorithms in terms of quality, but its performance is worst for the average worst case graphs [9]. They have also noted after various experimentation of GIC on several categories of graphs that error percentage never exceeds more than 25 [9]. ...
... Delbot and Laforest have shown that on average, GIC performs better than other algorithms in terms of quality, but its performance is worst for the average worst case graphs [9]. They have also noted after various experimentation of GIC on several categories of graphs that error percentage never exceeds more than 25 [9]. In comparison to other techniques, GIC can be reliably used on general graphs but then we have to compromise with the worst case complexity returned on average worst case graphs which is not a norm in practice. ...
... If a node has incident edge and is not yet covered then that node is selected for minimal vertex cover. But when this method was applied and analyzed in experimental settings considering various type of graphs [9], it became obvious that this list heuristic cannot provide better or even comparable solution to the other greedy approaches in general. ...
Article
Full-text available
Numerous approximation algorithms have been presented by researchers for approximation of minimum vertex cover, all of these approaches have deficiencies in one way or another. As minimum vertex cover is NP-Complete so we can’t find out optimal solution so approximation is the way left but it is very hard for someone to decide which one procedure to use, in this comparison paper we have selected five approximation algorithms and have drawn detailed experimental comparison. Best available benchmarks were used for the comparison process which was to compare multiple algorithms for the same task on different aspects. Extensive results have been provided to clarify the selection process, probability of production optimal solutions, run time complexity and approximation ratio were factors involved in the process of selection.
... According to [3], its maximum error is , where  is the maximum degree of a vertex in the graph. Experimental analysis carried out in [10] showed that MDG gives a maximum error of 33% on ErdosRenyi graphs, 9% on trees, 44% on Bhoslib, 32% on regular graphs and 70% on average worst case graphs. Worst case graphs are those that are designed to trap an algorithm. ...
... The authors of [16] proved that GIC finds the optimal solution for trees and therefore also for paths. The authors of [10] showed that, on average, GIC performs better than other algorithms in terms of quality, but its performance is worst for the average worst case graphs [12]. They also noted, after applying GIC to several categories of graphs, that the error percentage never exceeds 25. ...
... These graphs were obtained using a process outlined by Sanchis [21]. The remaining benchmark problems were collected from [23] and are frequently used by researchers of this field [2,16,10,17,18]. These benchmark problems include information about the total number of nodes and the optimal solution, which helps researchers to assess the results of their proposed approaches against some know dataset. ...
Article
Full-text available
The importance of non-deterministic polynomial (NP) problems in real world scenarios has compelled researchers to consider simple ways of finding approximate solutions to these problems in polynomial time. Minimum vertex cover is an NP complete problem, where the objective is to cover all the edges in a graph with the minimal number of vertices possible. The maximal independent set and maximal clique problems also belong to the same class. An important property that we have analyzed while considering various approaches to find approximate solutions to the minimum vertex cover problem (MVC) is that solving MVC directly can result in a bigger error ratio. We propose a new approximation algorithm for the minimum vertex cover problem called vertex cover using a maximum independent set (VCUMI). This algorithm works by removing the nodes of a maximum independent set until the graph is an approximate solution of MVC. Based on empirical results, it can be stated that VCUMI outperforms all competing algorithms presented in the literature. Based on all the benchmarks used, VCUMI achieved the worst case error ratio of 1.033, while VSA, MDG and NOVAC-1 gave the worst error ratios of 1.583, 1.107 and 1.04, respectively.
... Here n and d denote the number of elements in the universe and frequency of the most frequent element respectively. Delbot and Laforest in [11] concluded that we cannot hope to have an approximation algorithm for vertex cover better than 2. ...
Preprint
Full-text available
Given an undirected graph $\GG=(\VV,\EE)$, with vertex weights $(w(u))_{u\in\VV}$, vertex values $(\alpha(u))_{u\in\VV}$, a knapsack size $s$, and a target value $d$, the \vcknapsack problem is to determine if there exists a subset $\UU\subseteq\VV$ of vertices such that \UU forms a vertex cover, $w(\UU)=\sum_{u\in\UU} w(u) \le s$, and $\alpha(\UU)=\sum_{u\in\UU} \alpha(u) \ge d$. In this paper, we closely study the \vcknapsack problem and its variations, such as \vcknapsackbudget, \minimalvcknapsack, and \minimumvcknapsack, for both general graphs and trees. We first prove that the \vcknapsack problem belongs to the complexity class \NPC and then study the complexity of the other variations. We generalize the problem to \setc and \hs versions and design polynomial time $H_g$-factor approximation algorithm for the \setckp problem and d-factor approximation algorithm for \hstp using primal dual method. We further show that \setcks and \hsmb are hard to approximate in polynomial time. Additionally, we develop a fixed parameter tractable algorithm running in time $8^{\OO(\tw)}\cdot n\cdot {\sf min}\{s,d\}$ where $\tw,s,d,n$ are respectively treewidth of the graph, the size of the knapsack, the target value of the knapsack, and the number of items for the \minimalvcknapsack problem.
... The minimum VCP problem is one of the fundamental problems in the combinatorial optimization and it has received a lot of attentions, and, many approximation algorithms have been proposed to construct vertex cover in different ways. The best constant approximation ratio known is 2, and this is the best-known worst-case one [5]. Several approximation algorithms were proposed by various authors to deal with the problem of minimum VCP. ...
Article
Full-text available
The vertex cover problem is a famous combinatorial problem, and its complexity has been heavily studied. It is known that it is hard to approximate to within any constant factor better than 2, while a 2-approximation for it can be trivially obtained. In this paper, new properties and new techniques are introduced which lead to approximation ratios smaller than 2 on special graphs; e.g. graphs for which their maximum cut values are less than 0.999|E|. In fact, we produce a (1.9997)-approximation ratio on graph G, where the (0.878)-approximation algorithm of the Goemans-Williamson for the maximum cut problem on G produces a value smaller than 0.877122|E|.
... However, while a lower approximation factor is a guarantee for the stability of the algorithm, it does not always give the best results in practice. Hence, [13] proposes an experimental comparison of 6 approximation algorithms which only confirms this last statement. Notably, the Greedy Independent Cover (GIC) algorithm (NCG3 GIC) [21] appears to be the clear winner of this benchmark and is implemented in FASTG3. ...
... 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. ...
Article
Full-text available
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.
Conference Paper
Full-text available
Puisqu'il semble maintenant improbable que l'on puisse trouver un algorithme polynomial résolvant de façon exacte un problème NP-difficile, l'utilisation d'algorithmes polynomiaux retournant des solutions non optimales s'est généralisée. Cependant, il est souhaitable que la qualité des solutions retournées ne soit pas trop dégradée et on demande donc à ces algorithmes d'approximation de donner une garantie sur leurs performances. Cette qualité est le plus souvent mesurée grâce au rapport d'approximation en pire cas. Le vertex cover 1 est un problème "classique" de minimisation, NP-complet pour lequel de nombreux algorithmes d'approximation ont été proposés. Par exemple, il est connu que l'algorithme ED, qui sélectionne les sommets d'un couplage maximal du graphe, possède un rapport d'approximation de 2 et l'algorithme M DG, qui sélectionne un sommet de degré maximum, le retire du graphe et recommence tant qu'il existe une arête, possède un rapport d'approximation de H(∆) = 1+ 1 2 +· · ·+ 1 ∆ (∆ est le degré max. du graphe). Aucun algorithme ayant un rapport d'approximation constant inférieure à 2 n'a été trouvé. Avis et Imamura ont proposé LL, un algorithme de liste ∆-approché (Parcourir la liste L donnée des sommets de G de la gauche vers la droite et sélectionner le sommet courant s'il possède un voisin dans G qui se trouve à sa droite dans la liste L). Nous avons proposé un autre algorithme de liste, LR (parcourir la liste L donnée des sommets de G de la droite vers la gauche et sélectionner le sommet courant u ssi il possède un voisin dans G, qui se trouvè a sa droite dans la liste L et qui n'a pas déjà été sélectionné lorsqu'il a été examiné). Nous avons prouvé dans [DL08] que LR retourne toujours une solution dont la taille est inférieure ou égale à celle retournée par LL et dans [BDL09] que pour tout graphe G à n sommets, E(LR(G)) ≤ 2 − 2 n opt(G). Le rapport d'approximation en pire cas, bien qu'étant une mesure de grande importance, est trop macroscopique pour rendre compte de l'ensemble des exécutions des algorithmes (qui ne sont pas totalement déterministes) et ne permet pas d'obtenir un classement des algorithmes qui soit représentatif de leurs performances "pratiques". Nous proposons, sous une hypothèse d'équiprobabilité, une comparaison en moyennè a la fois analytique et expérimentale des 4 algorithmes ED, M DG, LL et LR (voir [DLar]). Il ressort de cette étude que le "classement" basé sur le pire cas peut être l'inverse du classement basé sur le cas moyen. Nous conjecturons même que pour tout graphe G, on a : E(LR(G)) ≤ E(ED(G)). Ces résultats nous encouragent à poursuivre dans l'étude analytique des algorithmes de type glouton car ce sont des méthodes particulièrement adaptées pour le traitement de grosses instances sur lesquelles il est difficile de mener des expériences conséquentes. Références [BDL09] E. Birmelé, F. Delbot, and C. Laforest. Mean analysis of an online algorithm for the vertex cover problem. IPL, 109(9) :436-439, 2009. [DL08] F. Delbot and C. Laforest. A better list heuristic for vertex cover. IPL, 107(3-4) :125-127, 2008. [DLar] F. Delbot and C. Laforest. Analytical and experimental comparison of six algorithms for the vertex cover. ACM, Journal of Experimental Algorithmics, 2010 (to appear). * Travail soutenu par le projet ANR Todo http ://todo.lamsade.dauphine.fr/ † Post-doctorat financé par l'ANR Boole http ://boole.prism.uvsq.fr/ 1É tant donné un graphe G = (V, E), le problème du vertex cover consisteà trouver le plus petit ensemble C ⊆ V tel que pour toute arête (i, j) ∈ E on ait i ∈ C ou j ∈ C (ou bien les deux).
Article
The minimum vertex cover (MVC) problem is a well-studied NP-Complete problem and has various applications. In this paper, a new heuristic approach has been proposed to find the minimum vertex cover of a graph the proposed algorithm has been tested on random graphs and BHOSLIB instances the results have shown that the proposed algorithm can yield better solutions especially on dense graphs for solving the minimum vertex cover problem.
Article
Based on a conjecture regarding the power of unique 2-prover-1-round games presented in (Khot02), we show that vertex cover is hard to approximate within any constant factor better than 2. We actually show a stronger result, namely, based on the same conjecture, vertex cover on k-uniform hypergraphs is hard to approximate within any constant factor better than k.
Article
We define a natural variant of NP, MAX NP, and also a subclass called MAX SNP. These are classes of optimization problems, and in fact contain several natural, well-studied ones. We show that problems in these classes can be approximated with some bounded error. Furthermore, we show that a number of common optimization problems are complete under a kind of careful transformation (called L-reduction) that preserves approximability. It follows that such a complete problem has a polynomial-time approximation scheme iff the whole class does. These results may help explain the lack of progress on the approximability of a host of optimization problems.