1 Introduction
We discuss recent progress in the design of approximation algorithms for two problems on graphs, with their applications to combinatorial scientific computing (CSC). The problems involve the computation of degree-constrained subgraphs of a graph that might represent its significant subgraphs. Computing these subgraphs reduce the computational costs and memory required of algorithms that obtain information from the graph, such as semi-supervised classification in machine learning, or the solution of sparse systems of linear equations. These subgraphs also help remove noise from the data so that machine learning algorithms perform better in classification tasks.
The first problem we consider is the classical one of computing a matching in a graph. A matching is a subset of vertex-disjoint edges; hence there is at most one edge of the subset incident on each vertex in the graph. Here we could seek to maximize the cardinality of a matching, or when weights are assigned to edges, maximize the sum of the weights of edges in a matching. We will also discuss a less studied variant where the weights are on the vertices instead of the edges. A generalization of matching is the
$b$
-matching problem, where we are given natural numbers
$b(v)$
for each vertex
$v$
in the graph, and are required to choose at most
$b(v)$
matched edges incident on
$v$
. When weights are assigned to the edges, we seek to maximize the sum of weights of the matched edges.
The second problem we consider is edge cover, where we are required to choose at least one edge incident on each vertex to belong to the edge cover. Here we seek to minimize the cardinality of the edges in the cover, or the sum of weights of the edges in the cover. The generalization of an edge cover leads to the
$b$
-edge cover problem, where given natural numbers
$b(v)$
for each vertex
$v$
, we are required to choose at least
$b(v)$
edges incident on
$v$
to belong to the edge cover. Again, we seek to minimize the sum of weights of the edges in the cover. Our work on this problem was motivated by an application to a data privacy problem called adaptive anonymity.
Both of these problems and their variants have polynomial time algorithms to solve them; however, the asymptotic run time is larger than the product of the number of edges times the square root of the number of vertices, and this is too high to be practical for graphs with millions or billions of vertices and edges. Furthermore, exact algorithms for these problems have little concurrency. Hence we turn to the design of approximation algorithms that have near-linear time complexity in the size of the graph. We also design approximation algorithms that possess high concurrency, so that they can be implemented efficiently on parallel computers.
An exact algorithm for an optimization problem computes the optimum value of its objective function. An approximation algorithm for an optimization problem computes a value that is within some factor
$\unicode[STIX]{x1D6FC}$
(a constant or a function of the problem size) of the optimal value for all problem instances. For a maximization problem (as in matching), the ratio of the value computed by the approximation algorithm to the maximum value is at least
$\unicode[STIX]{x1D6FC}<1$
for all instances; for a minimization problem (as in edge cover), the ratio of the value computed by the approximation algorithm to the optimal value is at most
$\unicode[STIX]{x1D6FC}>1$
, again for all instances. We say that this is an
$\unicode[STIX]{x1D6FC}$
-approximation algorithm for the problem, and that the approximation ratio of the algorithm is
$\unicode[STIX]{x1D6FC}$
. Note that this worst-case approximation ratio is obtained analytically by an a priori argument, and the approximation ratio for a specific instance might be much better than
$\unicode[STIX]{x1D6FC}$
. For many optimization problems, known exact algorithms might not have polynomial time complexity. Also, for many problems, for any
$\unicode[STIX]{x1D716}>0$
if an algorithm with approximation ratio
$n^{(1-\unicode[STIX]{x1D716})}$
exists then
$P=\mathit{NP}$
, which suggests that a polynomial time approximation algorithm might not exist. An algorithm for an optimization problem for which we cannot obtain an approximation ratio is called a heuristic algorithm. This is the situation for many problems in CSC, and we can evaluate an algorithm by empirically comparing the value of the objective function it computes with other algorithms on a collection of test problems.
There are several advantages that approximation algorithms have over exact algorithms, which we enumerate as follows.
∙ Approximation algorithms have lower run time complexity relative to exact algorithms, often linear or nearly linear in the size of the problem. Exact algorithms with polynomial run times can be too slow for massive graphs, but the faster approximation algorithms may be practical. Furthermore, in practice these approximation algorithms compute solutions that are nearly optimal.
∙ Approximation algorithms are conceptually simpler than exact algorithms, and their proofs of correctness could also be simpler.
∙ Approximation algorithms are easier to implement when compared to the more sophisticated exact algorithms, which is practically an important reason for their widespread use.
∙ Approximation algorithms can be designed to have more concurrency than exact algorithms. The simplicity of implementation of approximation algorithms is even more important for algorithms to be implemented on parallel computers. This is a major motivating factor for our work on matchings and edge covers.
∙ Often a matching or edge cover algorithm is used at each step of an approximation algorithm or a heuristic to solve another problem. In this case, exact matchings are not required, and its use increases the run time of the algorithm, limiting the size of the problems that could be solved. This is the case for network alignment (Khan, Gleich, Pothen and Halappanavar Reference Khan, Gleich, Pothen and Halappanavar2012), for adaptive anonymity (Khan et al. Reference Khan, Choromanski, Pothen, Ferdous, Halappanavar and Tumeo2018a ),
$k$
-nearest neighbour graph construction (Ferdous, Pothen and Khan Reference Ferdous, Pothen and Khan2018), ontology alignment (Kolyvakis, Kalousis, Smith and Kiritsis Reference Kolyvakis, Kalousis, Smith and Kiritsis2018), etc.
Approximation algorithms have been studied in the discrete mathematics, theoretical computer science and operations research communities. Books discussing approximation algorithms include Hochbaum (1997), Vazirani (Reference Vazirani2003), Williamson and Shmoys (Reference Williamson and Shmoys2011) and Du, Ko and Hu (Reference Du, Ko and Hu2012). An earlier survey on approximation algorithms for the matching problem was provided by Hougardy (Reference Hougardy, Cook, Lovász and Vygen2009). Our discussion of the matching problem is fairly disjoint from this survey; we have included more recent algorithms such as the Suitor and
$b$
-Suitor algorithms, and problems such as
$b$
-matching and the vertex-weighted matching problem, as well as parallel algorithms. We are not aware of an earlier survey of the edge cover and
$b$
-edge cover problems. Goemans and Williamson (Reference Goemans, Williamson and Hochbaum1997) survey the primal–dual method for designing approximation algorithms and apply it to several network design problems, including vertex cover and edge cover.
We conclude this section with a brief discussion of the research area and community of combinatorial scientific computing (CSC). Research in CSC focuses on the design, theoretical analysis, computational evaluation and deployment of combinatorial algorithms to solve problems in computational science and engineering. The CSC community has its roots in the research areas of sparse matrix computations, algorithmic differentiation and parallel computing. This community was formally organized in the early 2000s, and biennial workshops on CSC have been held under the auspices of the Society for Industrial and Applied Mathematics (SIAM) since 2004. Information about these meetings and proceedings published by SIAM is available at www.csc-research.org. Snapshots of recent research in CSC are included in the collection of articles edited by Naumann and Schenk (2012); the first chapter by Hendrickson and Pothen provides more detail on the historical development and emerging research areas of CSC. More recently the CSC community has joined with other computational discrete mathematicians to organize a SIAM Activity Group on Applied and Computational Discrete Algorithms. Additional information is available at www.siam.org/membership/Activity-Groups/detail/applied-and-computational-discrete-algorithms.
2 Maximum cardinality matching
2.1 Elementary definitions and concepts
We begin with notation and concepts needed for discussing matching and edge cover problems. We consider a simple, loopless, undirected graph
$G=(V,E)$
, where
$V$
is the set of vertices,
$E$
is the set of edges, and
$|V|\equiv n$
and
$|E|\equiv m$
. The neighbours of a vertex
$u$
will be denoted by
$\text{adj}(u)$
or
$N(u)$
; the vertex
$u$
itself is not a member of the adjacency set. The cardinality of the adjacency set is the degree of the vertex, denoted
$\deg (u)$
. The maximum degree of a vertex in the graph will be denoted
$\unicode[STIX]{x1D6E5}$
.
An edge
$e=(u,v)$
has the vertices
$u$
and
$v$
as its endpoints. We say that
$e$
is an edge incident on
$u$
(and
$v$
), and that
$u$
and
$v$
are adjacent vertices. Two edges
$e$
and
$f$
are adjacent or are neighbours if they share a common endpoint. The set of edges adjacent to
$e=(u,v)$
consists of other edges in
$G$
with
$u$
or
$v$
as an endpoint.
A path in a graph is sequence of edges
$\{(v_{1},v_{2}),(v_{2},v_{3}),\ldots (v_{k},v_{k+1})\}$
, where the vertices are distinct and consecutive edges share an endpoint. The length of the path is the number of edges
$k$
. A cycle is the concatenation of a path and an edge joining its first and last vertices,
$(v_{1},v_{k+1})$
.
A matching in the graph
$G$
is a subset of vertex-disjoint edges
$M$
. Thus at most one edge in
$M$
is incident on each vertex in
$V$
. We say that an edge in
$M$
is a matched edge, and the endpoints of a matched edge are matched vertices. If an edge belongs to
$E\setminus M$
then it is unmatched, and similarly for unmatched vertices.
Let
$M$
be a matching. Then a path or cycle
$P$
is alternating if it consists of edges drawn alternately from
$M$
and
$E\setminus M$
. An alternating path
$P$
is an
$M$
-augmenting path if it begins and ends with an unmatched edge. An augmenting path has one more unmatched edge than matched edges. By exchanging matched edges with unmatched edges along the augmenting path, i.e. by computing
$M\oplus P$
, we obtain a matching
$M^{\prime }$
with one more matched edge than
$M$
. (Here
$A\oplus B=(A\setminus B)\cup (B\setminus A)$
.) In some situations, we consider two matchings
$M_{1}$
and
$M_{2}$
, and consider the symmetric difference
$M_{1}\oplus M_{2}$
. The symmetric difference consists of isolated vertices (an edge belonging to both matchings), and alternating paths and cycles; here the edges belong alternately to
$M_{1}$
and
$M_{2}$
, and thus vertices on such paths have degree 1 or 2 in the subgraph induced by the two matchings. Such paths could be used to augment the cardinality of the matching
$M_{2}$
if
$M_{1}$
has more edges on the path. Alternating cycles have the same number of edges from
$M_{1}$
and
$M_{2}$
, and cannot augment the cardinality of either matching. Augmenting paths and cycles with respect to weights on edges will be discussed in Section 3.2.
A maximum cardinality matching in a graph could be obtained by an algorithm that begins with the empty matching and at each step finds an augmenting path from an unmatched vertex. Hopcroft and Karp (Reference Hopcroft and Karp1973) obtained a
$O(\sqrt{n}m)$
-time algorithm for finding maximum cardinality matchings in bipartite graphs, and this was extended to an algorithm for finding maximum matchings in non-bipartite graphs by Micali and Vazirani (Reference Micali and Vazirani1980).
Matching algorithms are discussed in many books on graphs and graph algorithms as well as specialized books on matchings, for example Burkard, Dell’Amico and Martello (Reference Burkard, Dell’Amico and Martello2009), Lovász and Plummer (Reference Lovász and Plummer2009) and Schrijver (Reference Schrijver2003).
2.2 Augmenting path-based approximation
We begin by proving a lemma obtained by Hopcroft and Karp (Reference Hopcroft and Karp1973).
Lemma 2.1. If all augmenting paths with respect to a matching
$M$
in a graph
$G$
have length greater than or equal to
$2k-1$
, then the matching is a
$(k-1)/k$
-approximation of a maximum cardinality matching
$M^{\ast }$
.
Proof. We consider the symmetric difference of a maximum cardinality matching
$M^{\ast }$
and the given matching
$M$
. It consists of vertices of degree zero, one or two, since at most one edge in
$M^{\ast }$
and one edge in
$M$
can be incident on any given vertex. Isolated vertices and alternating cycles have the same number of edges from
$M$
and
$M^{\ast }$
, and the ratio
$|M|/|M^{\ast }|$
is one. There are
$|M^{\ast }|-|M|$
vertex-disjoint
$M$
-augmenting paths in the symmetric difference that account for the differences in cardinalities of the two matchings. Each augmenting path
$P$
has at least
$k-1$
edges from
$M$
and
$k$
edges from
$M^{\ast }$
, and hence for the path the ratio
$|M\cap P|/M^{\ast }\cap P|\geq (k-1)/k$
. Since the inequality is true for every augmenting path, the approximation ratio is
$|M|/|M^{\ast }|\geq (k-1)/k$
.◻
An important special case of the above lemma is when the augmenting path has length at least three, that is, we find a maximal matching in
$G$
. Then we have a
$1/2$
-approximation to the maximum cardinality matching. This observation is used in many practical matching codes as an initialization step before commencing searches for longer augmenting paths. By increasing the lengths of the augmenting paths, one obtains an approximation ratio as close to one as possible; however, with higher augmenting path lengths, the algorithm more closely resembles the exact algorithm due to Micali and Vazirani (Reference Micali and Vazirani1980), which requires
$O(\sqrt{n})$
phases, where each phase constructs a maximal, vertex-disjoint set of shortest augmenting paths. Bast, Mehlhorn, Schäfer and Tamaki (Reference Bast, Mehlhorn, Schäfer and Tamaki2006) have shown that on an Erdős–Rényi random graph on
$n$
vertices with the probability of an edge equal to
$33/n$
,
$G(n,33/n)$
, the Micali–Vazirani algorithm requires at most
$O(\log n)$
phases. A similar result was obtained earlier by Motwani (Reference Motwani1994). Hougardy (Reference Hougardy, Cook, Lovász and Vygen2009) showed that an approximation ratio of
$4/5$
is achievable in
$O(m)$
time for the maximum cardinality matching problem by finding augmenting paths of length less than or equal to seven.
2.3 Randomized approximation algorithms
We now consider two randomized algorithms that compute approximations better than
$1/2$
by first scaling the adjacency matrix of the bipartite graph to a doubly stochastic matrix, when the graph has the property that every edge belongs to some maximum cardinality matching. Such graphs are said to have total support. (Another way of stating this condition is that the Dulmage–Mendelsohn decomposition of the bipartite graph consists of subgraphs that have (1) a perfect matching, or (2) a row-perfect matching, or (3) a column-perfect matching, and no edge joins two distinct components to each other. The Dulmage–Mendelsohn decomposition is discussed briefly in Section 3.4.1 and in more detail in Pothen and Fan (Reference Pothen and Fan1990).) One of the advantages of these algorithms is that they are highly concurrent, and hence can be easily implemented on parallel architectures. These algorithms were designed and implemented by Dufossé, Kaya and Uçar (Reference Dufossé, Kaya and Uçar2015), and we follow their discussion.
We consider a bipartite graph
$G=(V_{1},V_{2},E)$
with the same number of vertices in the two sets
$V_{1}$
and
$V_{2}$
, so that its adjacency matrix is a square matrix with elements belonging to
$\{0,1\}$
. Every edge joins some vertex
$i\in V_{1}$
with some vertex in
$j\in V_{2}$
, and the element
$(i,j)$
in the adjacency matrix is then 1; it would be 0 if there is no such edge. The scaling algorithm was designed by Sinkhorn and Knopp (Reference Sinkhorn and Knopp1967), and it alternates in scaling the matrix with a diagonal matrix of the reciprocal of the column sums and another diagonal matrix with the reciprocal of the row sums. When this process is iterated on a bipartite graph that has total support, the scaled adjacency matrix converges to a doubly stochastic matrix, i.e. a matrix whose column sums and row sums are equal to one. The values of the matrix elements are used in a randomized algorithm to determine the probability of matching an edge.
Algorithm 1 describes the procedure to convert an adjacency matrix with total support to a doubly stochastic matrix. Here
$\unicode[STIX]{x1D716}$
is an upper bound on the permissible distance from a column sum of one. Other scaling algorithms could also be used for this purpose, but the Sinkhorn–Knopp algorithm is more concurrent. Also Dufossé, Kaya and Uçar (Reference Dufossé, Kaya and Uçar2015) report that five to ten iterations of this scaling algorithm suffice to compute approximate matchings.
Algorithm 2 describes how a random matching is computed from the doubly stochastic matrix
$S$
derived from the bipartite graph. The variable
$\text{Diag}(d_{r})$
denotes a diagonal matrix obtained with the elements of the vector
$d_{r}$
on the diagonal. The algorithm uses the matrix element
$s_{ij}$
to determine the probability with which a column
$j$
is matched to a row
$i$
. In this algorithm a row could attempt to match to a column that is already matched to another row; in this case, one of the rows, say the last, succeeds, and the other row gets unmatched.
Dufossé et al. (Reference Dufossé, Kaya and Uçar2015) proved that this random matching will match
$n(1-1/e)$
vertices with high probability, where
$e$
is the base of natural logarithm, the Euler number.
Theorem 2.2. Let
$A$
be an
$n\times n$
adjacency matrix corresponding to a bipartite graph
$G=(V_{1},V_{2},E)$
with total support. Then the random matching obtained by Algorithm 2 has expected cardinality
$n(1-1/e)$
as
$n\rightarrow \infty$
.
Proof. The probability that a column
$j$
is not matched to any of the rows in
$\text{adj}(j)$
is
$\prod _{i\in \text{adj}(j)}(1-s_{ij})$
. Let
$d_{j}$
denote the degree of column
$j$
, i.e.
$|\text{adj}(j)|$
. From the inequality that the geometric mean is less than or equal to the arithmetic mean, we have
$$\begin{eqnarray}\left(\mathop{\prod }_{i\in \text{adj}(j)}(1-s_{ij})\right)^{1/d_{j}}\leq \displaystyle \frac{d_{j}-\mathop{\sum }_{i\in \text{adj}(j)}s_{ij}}{d_{j}}.\end{eqnarray}$$
Since
$S$
is doubly stochastic, the sum on the right-hand side of the inequality is one; hence after taking the
$d_{j}$
th power, the right-hand side simplifies to
Thus the probability that column
$j$
is matched is at least
$1-1/e$
, and the expected size of the matching is at least
$n(1-1/e)$
.◻
The algorithm we have described is a
$((1-1/e)\approx 0.632)$
-approximation algorithm for maximum cardinality matching on bipartite graphs with total support. We mention that an online algorithm for maximum cardinality matching has the same approximation ratio. This latter algorithm was originally designed by Karp, Vazirani and Vazirani (Reference Karp, Vazirani and Vazirani1990), and a simpler proof of its correctness and approximation ratio was provided by Birnbaum and Mathieu (Reference Birnbaum and Mathieu2008).
A better approximation ratio can be obtained from a variant ‘two-sided’ matching algorithm. In order to describe this algorithm, we need to discuss an algorithm due to Karp and Sipser (Reference Karp and Sipser1981) for computing a random matching in a graph. The Karp–Sipser algorithm matches a vertex of degree one to its only neighbour, since it must be matched in any maximum cardinality matching. Then it deletes the endpoints of the matched edge, and the edges incident on them from the graph. This may create new vertices of degree one. The algorithm repeatedly matches vertices of degree one, until none is left. At this stage, if all vertices have been matched, then the algorithm terminates. If not, it chooses a random vertex in the graph and matches it to one of its neighbours, and then deletes the endpoints and the edges incident on them. The algorithm iterates until all vertices are matched.
In the two-sided matching algorithm, vertices in both the vertex sets
$V_{1}$
and
$V_{2}$
choose at random a single neighbour, with the probability given by the matrix elements in the doubly stochastic matrix
$S$
. The subgraph induced by the chosen edges has at most
$2n$
edges. It could be fewer than
$2n$
, if two vertices belonging to different vertex sets choose each other. Each connected component of this induced graph can have at most the same number of edges as the number of vertices, and hence it is a tree or a graph with one cycle. In this graph, we run the Karp–Sipser algorithm to compute a matching. Since each connected component is either a tree or a unicyclic graph, the Karp–Sipser algorithm computes a maximum cardinality matching in the graph. When the initial graph has total support, Dufossé, Kaya and Uçar (Reference Dufossé, Kaya and Uçar2015) have proved that the two-sided algorithm leads to a 0.866-approximation for maximum cardinality matching as
$n\rightarrow \infty$
with high probability.
3 Edge-weighted matching
In this section we present approximation algorithms for the weighted matching problem on an undirected graph
$G=(V,E,w)$
with
$w:E\rightarrow \mathbb{R}_{\geq 0}$
. The objective is to find a matching
$M$
such that the sum of the weights of the edges in
$M$
is as large as possible. We denote such a maximum weight matching by
$M^{\ast }$
. The fastest exact algorithm for the weighted matching problem has run time
$O(mn+n^{2}\log n)$
(Gabow Reference Gabow2018), and the run time of computing an optimal solution can get prohibitively large even for moderate sized graphs, it is of interest to investigate fast approximation algorithms. As we will explain, some of these algorithms also lend themselves well to parallel execution.
Definitions
Let
$M$
be a matching. An alternating path or cycle
$P$
is an augmentation if
$M\oplus P$
is also a matching. The weight of a set of edges
$S$
is
$w(S)=\sum _{e\in S}w(e)$
. The gain of an alternating path or cycle
$P$
is
$g(P)=w(P\setminus M)-w(P\cap M)$
.
For
$k\geq 1$
, a
$k$
-augmentation is an augmentation containing at most
$k$
edges not in
$M$
. Figure 3.1(a) shows all possible 1-augmentations. In the figure a solid line denotes an edge in the current matching and a dotted line an edge not in the matching. By including the paths in Figure 3.1(b) we get all possible 2-augmentations that are paths, while Figure 3.1(c) shows the only cycle possible in a 2-augmentation. Together these graphs show all possible 2-augmentations. In terms of cardinality a
$k$
-augmentation that has
$l\leq k$
unmatched edges contains either
$l-1$
,
$l$
or
$l+1$
matched edges. The gain of an augmentation is positive if the sum of the weights of the unmatched edges is greater than the sum of the weights of the matched edges. (Note that an alternating path with one more matched edge than unmatched edges could have positive gain, but would not be an augmenting path for the cardinality of the matching.)
2-augmenting paths and cycles.

3.1 Approximation lemma
It appears to be well known that if a matching does not admit positive gain
$(k-1)$
-augmentations then it must have a weight of at least a factor
$(k-1)/k$
times the weight of a maximum matching
$w(M^{\ast })$
. Still, to the best of our knowledge a proof of this does not appear to have been written down previously. We therefore include a formal proof here. This is a generalization of the proof given for Theorem 1 in Drake and Hougardy (Reference Drake, Hougardy, Jansen, Margraf, Mastrolilli and Rolim2003a
) which shows the result for
$k=2$
.
Lemma 3.1. Let
$M$
be a matching on
$G$
and
$k$
an integer greater than
$1$
such that
$M$
does not admit any positive gain
$(k-1)$
-augmentations. Then
where
$M^{\ast }$
is a maximum weight matching.
Proof. Let
$S=M\cap M^{\ast }$
, that is,
$S$
consists of the edges of
$G$
that are common to both matchings
$M$
and
$M^{\ast }$
. Further, let
$R=M\setminus S$
and
$R^{\ast }=M^{\ast }\setminus S$
. Then
$M=S\cup R$
and
$M^{\ast }=S\cup R^{\ast }$
. We will show that
The result will then follow since
Since
$R$
and
$R^{\ast }$
are matchings, the subgraph induced by the edges
$T=R\cup R^{\ast }$
consists of vertices of degree one or two. Thus the edges in
$T$
can be split into a set of even length cycles
$C$
and a set of paths
$P$
. We show the result separately for each cycle in
$C$
and each path in
$P$
.
Consider a cycle
$C_{i}\in C$
. If
$C_{i}$
contains at most
$2k-2$
edges then by the assumption of the lemma it follows that
Assume therefore that
$|C_{i}|=2r$
where
$2r\geq 2k$
. We denote by
$m_{i}$
edges of
$C_{i}$
that belong to the matching
$M$
, and by
$m_{i}^{\ast }$
edges that belong to
$M^{\ast }$
. Let
$m_{1},m_{1}^{\ast },m_{2},m_{2}^{\ast },\ldots ,m_{k-1},m_{k-1}^{\ast },m_{k}$
be a clockwise path of
$2k-1$
consecutive distinct edges from
$C_{i}$
, where each
$m_{j}\in M$
and each
$m_{j}^{\ast }\in M^{\ast }$
. Then by the assumption of the lemma, it follows that
$\sum _{j=1}^{k}w(m_{j})\geq \sum _{j=1}^{k-1}w(m_{j}^{\ast })$
. There are
$r$
distinct starting edges belonging to
$M$
for such a path, each one giving rise to a different inequality. In these inequalities, every
$e\in C_{i}\cap M$
will appear once in every position
$m_{j}$
, where
$1\leq j\leq k$
. Thus each
$e\in C_{i}\cap M$
appears in exactly
$k$
of these inequalities. Similarly, each
$f\in C_{i}\cap M^{\ast }$
appears in exactly
$k-1$
inequalities. It follows that if we sum the left and right sides of the inequalities we get
which leads to the desired inequality for each
$C_{i}\in C$
.
Next, consider a path
$P_{i}\in P$
. Note first that
$|P_{i}|\geq 2$
and thus contains at least one edge from each of
$M$
and
$M^{\ast }$
. If this were not the case then either
$M$
would contain an augmenting path of length one, or
$M^{\ast }$
would not be maximal. Now append two paths, each containing
$2k-2$
dummy edges of weight 0, to the first and last vertex of
$P_{i}$
respectively. As in the case for
$C_{i}$
, repeatedly overlay a path
$m_{1},m_{1}^{\ast },m_{2},m_{2}^{\ast },\ldots ,m_{k-1},m_{k-1}^{\ast },m_{k}$
of
$2k-1$
edges onto
$P_{i}$
such that each
$e\in P_{i}\cap M$
appears exactly once for each
$m_{j}$
, where
$1\leq j\leq k$
. Note that dummy vertices may be assigned to the start and the end of such paths. For each path the inequality
still holds true as any assigned dummy edges have weight 0. Since every
$e\in P_{i}\cap M$
appears in exactly
$k$
inequalities, while each
$f\in P_{j}\cap M^{\ast }$
appears in exactly
$k-1$
inequalities, it follows that by taking the sum of the inequalities we get
Note that the statement of Lemma 3.1 is slightly more restrictive than that of Lemma 2.1 in that the former lemma does not permit the existence of any weight-increasing path of length
$2k-1$
edges with respect to the matching
$M$
, where
$k$
edges belong to
$M$
and
$k-1$
edges to
$M^{\ast }$
. Such an augmentation is not permissible for maximum cardinality matching as it would reduce the cardinality of the matching
$M$
.
3.2 Edge-weighted approximation algorithms
3.2.1 Greedy and Path Growing algorithms
In the following we give an overview of various efforts at designing efficient linear or close to linear time algorithms for the edge-weighted matching problem.
Perhaps the simplest matching heuristic is to visit each vertex
$u$
once and unless
$u$
is already incident on a matched edge, add an edge
$(u,v)$
of maximum weight to the matching where
$v$
is not already incident on a matched edge. The heuristic is shown in Algorithm 3.
As an example consider the graph in Figure 3.2 consisting of six vertices and nine edges with integer weights. If the graph is traversed in lexicographical order then Local Greedy will compute the matching
$M=\{(a,e),(b,d)\}$
of weight 11. Note that the optimal matching is given by
$M^{\ast }=\{(a,b),(c,d),(e,f)\}$
of weight 20.
Example graph for approximate weighted matching.

While this strategy has linear run time in the size of
$G$
, it does not offer any bound on the quality of the obtained solution. To see this consider an even length (number of edges) path
$v_{1},v_{2},\ldots ,v_{k}$
where
$w(v_{i},v_{i+1})=\unicode[STIX]{x1D716}$
if
$i$
is odd,
$w(v_{i},v_{i+1})=\unicode[STIX]{x1D6FF}$
if
$i$
is even, and
$\unicode[STIX]{x1D716}<\unicode[STIX]{x1D6FF}$
. If the Local Greedy algorithm processes the vertices in the given order, it will compute a matching with weight
$k/2\cdot \unicode[STIX]{x1D716}$
, while the optimal solution has weight
$k/2\cdot \unicode[STIX]{x1D6FF}$
.
One way to obtain a quality guarantee on the computed matching is to visit the edges in a predefined order. This gives rise to the classical greedy matching algorithm as shown in Algorithm 4. Here a matching is computed by considering each edge
$e$
by non-increasing weights. Then if
$e$
is not adjacent to an edge already in the matching it is added to the matching; otherwise it is discarded.
In the graph in Figure 3.2
Greedy will compute
$M=\{(c,e),(b,d)\}$
of weight 16. The following result shows that Greedy always gives a solution of weight at least half of the optimal one.
Lemma 3.2. The Greedy algorithm computes a matching
$M$
that is a
$1/2$
-approximation to a maximum weight matching
$M^{\ast }$
.
Proof. We show that
$M$
does not admit a
$1$
-augmentation, and the result will then follow from Lemma 3.1. For every
$e\in E\setminus M$
there must be either one or two edges in
$M$
adjacent to
$e$
, otherwise
$e$
would have been added to
$M$
. Let
$e^{\prime }\in M$
be an edge adjacent to
$e$
of maximum weight. If
$w(e)>w(e^{\prime })$
then
$e$
would have been considered before any of its adjacent edges in
$M$
and then added to
$M$
. It follows that
$w(e)\leq w(e^{\prime })$
and that
$e$
cannot be part of a 1-augmentation with respect to
$M$
.◻
It is clear that the Greedy algorithm runs in time
$O(m\log n)$
due to the sorting of the edges. However, it is possible to compute a
$1/2$
-approximation in linear time. One such is the Path Growing algorithm (Drake and Hougardy Reference Drake and Hougardy2003b
), shown in Algorithm 5. In line 9 of the algorithm, we concatenate the edge
$(u,v)$
to the path
$P$
.
In its original form the algorithm starts at an arbitrary vertex
$u$
and then grows a path
$P$
from
$u$
by traversing a heaviest edge incident on
$u$
that leads to an unvisited vertex
$v$
. The process is then continued from
$u$
and terminates when a vertex is reached such that there is no edge leading to an unvisited vertex. The result is a path
$P=e_{0},e_{1},\ldots ,e_{k}$
. This is then repeated starting from every unvisited vertex. For each such path one selects the heavier set of the odd or even numbered edges to add to
$M$
.
In the graph in Figure 3.2 starting from vertex
$a$
Path Growing would follow the path
$a,e,c,d,b,f$
. The edges of this path would then be divided into sets
$\{(a,e),(c,d),(b,f)\}$
(odd) of weight 15 and
$\{(c,e),(b,d)\}$
(even) of weight 16. The final solution consists of the even set.
The run time of Path Growing is clearly
$O(n+m)$
as the search for a path is only started once from each vertex and each edge is only considered twice (once from each of its endpoints). Note that the resulting matching might contain 1-augmentations. This is the case for a path of length four,
$e_{0},e_{1},e_{2},e_{3}$
with edge weights 3, 1, 2 and 3. Then the resulting matching will consist of the edges
$e_{0}$
and
$e_{2}$
; however,
$e_{2}$
and
$e_{3}$
form a 1-augmentation. Thus it is not possible to use Lemma 3.1 to show the performance guarantee. Still, it is not hard to prove that the resulting matching is a
$1/2$
-approximation.
Lemma 3.3. The Path Growing algorithm computes a matching
$M$
that is a
$1/2$
-approximation to a maximum weight matching
$M^{\ast }$
.
Proof. Let
$K=P_{0},P_{1},\ldots ,P_{k}$
be the non-empty paths generated by Path Growing. We show that
$\sum _{i}w(P_{i})\geq w(M^{\ast })$
. The result then follows since
Consider an edge
$(u,v)\in M^{\ast }$
. Then if
$(u,v)$
is not part of some
$P_{i}$
at least one of
$u$
and
$v$
must be part of some path
$P_{j}$
, otherwise Path Growing would have started a new path from either
$u$
or
$v$
. Assume therefore that
$u$
is part of
$P_{i}$
and that if
$v$
is part of
$P_{j}$
then
$i<j$
. This ensures that
$u$
is visited before
$v$
irrespective of if
$v$
is part of some
$P_{j}$
or not. Thus when Path Growing visits
$u$
it is possible to choose the edge
$(u,v)$
. Since this is not done it must choose an edge
$(u,x)$
to add to
$P_{i}$
such that
$w(u,x)\geq w(u,v)$
. Note that
$u$
can only be incident on at most one edge in
$M^{\ast }$
. It therefore follows that for every edge
$e\in M^{\ast }$
either
$e$
is in some
$P_{i}$
or there is a unique edge
$e^{\prime }\in P_{i}$
such that
$w(e)\leq w(e^{\prime })$
.◻
The Path Growing algorithm can be improved further without increasing its asymptotic run time, by noting that one can compute an optimal matching for each
$P_{i}$
instead of just choosing between the even and odd numbered edges. This is done using dynamic programming as follows. Let
$P=e_{0},e_{1},\ldots ,e_{k}$
be the edges on a selected path and let
$\operatorname{Opt}(i)$
denote the weight of an optimal matching on
$e_{0},e_{1},\ldots ,e_{i-1}$
. Then the weight of an optimal matching on
$P$
can be computed in linear time using the recursion
with
$\operatorname{Opt}(0)=0$
and
$\operatorname{Opt}(1)=w(e_{0})$
. The actual matching can be calculated by storing a Boolean value for each
$i$
to indicate if
$e_{i-1}$
is used in the computation of
$\operatorname{Opt}(i)$
. We denote this algorithm as Path Growing-DP.
The first linear time
$1/2$
-approximation algorithm for weighted matching was given by Preis (Reference Preis1999), and it is based on the notion of a dominating edge. An edge
$e$
is dominating if it is heavier than all of its incident edges. This Locally Dominant Edge algorithm repeatedly locates and adds dominant edges to the matching. When an edge is added to the matching, all adjoining edges are removed from the graph before the next dominant edge is found. The outline of this strategy is shown in Algorithm 6.
To be able to break ties we rank edges of equal weight first by the ID of the higher-numbered endpoint and then by the lower-numbered one. In practice we will only be comparing edges of equal weight incident on the same vertex and thus we always break ties by comparing the ID of the opposing vertex.
To achieve the linear time run time Algorithm 6 performs a carefully designed depth-first search (DFS) of
$G$
, locating and removing dominating edges as it progresses. Since the actual algorithm is quite involved, we do not list the details. Moreover, a DFS search is inherently linear, thus prohibiting parallel execution. Hence we present variants of Algorithm 6 that have worse theoretical run times, but which are faster in practice and that also lend themselves better to parallel execution.
Lemma 3.4. If tie-breaking is done consistently, Algorithm 6 computes the same matching as the Greedy algorithm.
Proof. Let
$M$
and
$M^{\prime }$
be the matchings computed by Algorithms 4 and 6, respectively. Let
$S=e_{0},e_{1},\ldots ,e_{m-1}$
be the edges in
$E$
by non-increasing weight. The proof is by induction on the edges in
$S$
with the induction hypothesis being that
$M$
and
$M^{\prime }$
consists of exactly the same edges from
$e_{0},e_{1},\ldots ,e_{k}$
.
For
$k=0$
we only consider the heaviest edge in
$G$
. Obviously this will be included in the matchings computed by both algorithms. Assume therefore that the induction hypothesis holds for all
$l<k$
, where
$k\geq 1$
, and consider edge
$e_{k}$
. If
$e_{k}$
is not used by Greedy then it must be adjacent to some edge
$e_{l}$
where
$l<k$
and
$e_{l}\in M$
. By assumption
$e_{l}\in M^{\prime }$
, and since it is not possible for two adjacent edges to be picked by Algorithm 6, it follows that
$e_{k}\not \in M^{\prime }$
.
If
$e_{k}\in M$
then it cannot be adjacent to any edge
$e_{l}\in M$
where
$l<k$
. The only way that Algorithm 6 can avoid including
$e_{k}$
in
$M^{\prime }$
is if it is removed because some adjacent edge
$e_{l}$
is included in
$M^{\prime }$
. For
$e_{l}$
to be dominant before
$e_{k}$
is removed requires that
$w(e_{l})>w(e_{k})$
. Since the edges are considered by non-increasing weight this implies that
$l<k$
, and thus by the induction hypothesis
$e_{l}\not \in M^{\prime }$
. It follows that
$e_{k}\in M^{\prime }$
if and only if
$e_{k}\in M$
.◻
The simplest algorithm based on discovering dominating edges is the Local Max algorithm of Birn et al. (Reference Birn, Osipov, Sanders, Schulz and Sitchinava2013). The algorithm operates in stages. At each stage a maximal set of dominating edges are discovered and added to the matching. These edges, along with their vertices, are then removed from the graph before the process is repeated. The algorithm terminates when the graph is empty. It is not hard to see that the run time of each stage is linear in the size of the remaining graph. It is possible that only a constant number of vertices and edges are removed at each stage, thus leading to a worst-case run time of
$O(nm)$
. However, it can be shown that if the edge weights are drawn from a uniform random distribution, then half of the remaining edges will be removed at each iteration (Birn et al.
Reference Birn, Osipov, Sanders, Schulz and Sitchinava2013). Thus in this case the expected number of rounds is
$O(\log n)$
and the expected run time is
$O(m)$
.
3.2.2 The Suitor algorithm
The Suitor algorithm, designed by Manne and Halappanavar (Reference Manne and Halappanavar2014), is another variant of Algorithm 6 that also computes the same matching as Greedy. The algorithm is based on considering the vertices as players that are making bids to match with one of their neighbours. The value of a bid from a vertex
$u$
to a vertex
$v$
is
$w(u,v)$
. We denote the highest bid a vertex
$u$
has received as its suitor value, denoted by
$s(u)$
.
The algorithm works by each vertex
$u$
proposing to its neighbour
$v$
such that
$w(u,v)$
is maximized under the constraint that
$v$
has not already received a higher offer than
$w(u,v)$
. (We say that a vertex
$v$
that satisfies this property is an eligible neighbour of
$u$
.) If at a later stage in the algorithm
$v$
receives a better offer, then the bid from
$u$
to
$v$
is annulled, and
$u$
has to make a new bid to its next heaviest eligible neighbour. The algorithm terminates when every vertex
$u$
is either a suitor of one of its neighbours or when
$u$
has no more vertices to propose to. At this point the edges where
$s(u)=v$
and
$s(v)=u$
constitute the matching.
There is no restriction on the order in which the vertices in
$V$
are processed nor on the order in which rejected suitors are processed. This leaves considerable freedom in how the algorithm is implemented. Two of the most natural ways to handle this is to use either a queue or a stack to organize the vertices that still need to be processed. If a queue is used then all vertices are initially put in the queue and the next considered vertex is always taken as the head of the queue. Any vertex that gets dislodged as a suitor because its chosen neighbour receives a better offer will be added at the end of the queue. The algorithm terminates when the queue is empty.
When using a stack all vertices are initially put on the stack and the next vertex to process is taken from the top of the stack. Any vertex that gets dislodged as a suitor is put on the top of the stack. Note that this is equivalent to processing each vertex exactly once and then immediately starting to process any vertex that gets dislodged. This variant of the Suitor algorithm is shown in Algorithm 7. In the algorithm, if a vertex
$x$
does not have a suitor, i.e.
$s(x)=\operatorname{NULL}$
, then
$w(u,s(x))=0$
.
As to correctness consider any initial dominating edge
$(u,v)$
, for instance the heaviest edge in
$E$
. Then the first time
$u$
is processed, the value of
$s(v)$
will be set to
$u$
. This follows since
$u$
has no better alternative and it cannot be prevented from doing so by any other neighbour
$x\in N(v)$
as
$w(u,v)>w(v,x)$
. Using the same argument it follows that
$s(u)$
will be set to
$v$
when
$v$
is initially processed. The suitor values of
$u$
and
$v$
will remain unchanged throughout the execution for the rest of the algorithm, again because
$(u,v)$
is dominant. It follows that for the final result of the vertices in
$V-\{u,v\}$
, the net effect is the same as if
$u$
and
$v$
were removed initially along with their adjacent edges. The only difference is that some vertices might become temporary suitors of
$u$
or
$v$
, but when they are dislodged, as they will be, they will behave as if
$u$
and
$v$
had been removed initially. Thus Algorithm 7 follows the same pattern as Algorithm 6 in computing the same matching as
Greedy.
For the time complexity note first that a vertex can only propose once to each of its neighbours. Thus it follows that there can at most be
$2m$
proposals. The time complexity therefore depends on how the next vertex to propose to is determined. If a linear search is performed each time, the time complexity is
$O(n+m\unicode[STIX]{x1D6E5})$
. If the weights of the edges incident on each vertex are sorted initially, then the rest of the algorithm runs in
$O(n+m)$
time. The run time will then be dominated by the sorting, which takes time
$O(m\log \unicode[STIX]{x1D6E5})$
. Other strategies include using a partial Quicksort partitioning to find the heaviest neighbours, and then only when these do not contain any more potential candidates to match with are more candidates found.
In order to say something about the expected run time of Suitor we note that there is a strong relationship between computing a greedy matching and the stable marriage problem (SM).
In the SM problem we are given two equal-sized sets
$L=\{l_{1},l_{2},\ldots ,l_{n}\}$
and
$R=\{r_{1},r_{2},\ldots ,r_{n}\}$
, typically referred to as ‘men’ and ‘women’ respectively. Every man and woman has a total ranking of all the members of the opposite sex. These give the ‘desirability’ for each participant to match with a member of the other set. The object is to find a complete matching
$M$
(i.e. a pairing) between the entries in
$L$
and
$R$
such that no two
$l_{i}\in L$
and
$r_{j}\in R$
would both obtain a higher-ranked partner if they were to abandon their current partner in
$M$
and rematch with each other. Any such solution is stable.
The main differences between computing a matching in a bipartite graph and an SM instance is that for SM one only considers how attractive two partners are relative to each other and also that attractiveness might not be symmetric. Thus one can have cycles such as
$l_{1},r_{1},l_{2},r_{2},l_{1}$
where each one prefers to match with the next one in the list. This does not happen in the matching problem. Moreover, the overall objective is to find any stable solution, whereas in a matching instance possible solutions can be ranked.
Gale and Shapley (Reference Gale and Shapley1962) formulated the stable marriage problem and also proposed the first algorithm for solving it. The algorithm operates in rounds as follows. In the first round each man in
$L$
proposes to his most preferred woman in
$R$
. Each woman will then reject all proposals she has received in this round except the one that is the highest in her ranking. In subsequent rounds each man that was rejected in the previous round will again propose to the woman that he has ranked highest, but now disregarding any woman that he has already proposed to in previous rounds. Gale and Shapley showed that this process will terminate with each man in
$L$
being matched to a woman in
$R$
and that this solution is stable. The algorithm also converges to a stable solution even if each participant has only ranked a subset of the opposing participants. For a recent discussion of stable matching and generalizations such as stable room-mates, stable fixtures, etc., see the book by Manlove (Reference Manlove2013).
Manne, Naim, Lerring and Halappanavar (Reference Manne, Naim, Lerring and Halappanavar2016) show that a greedy matching on a graph
$G$
can be computed by reformulating the problem as an appropriately constructed instance of SM and then solving this using the Gale–Shapley algorithm. In fact, the Gale–Shapley algorithm has a strong resemblance to the Suitor algorithm when using a queue. Similarly, there is a variation of the Gale–Shapley algorithm due to McVitie and Wilson (Reference McVitie and Wilson1971) corresponding to the Suitor algorithm when using a stack.
Wilson (Reference Wilson1972) showed that for any profile of women’s preferences, if the men’s preferences are random, then the expected sum of men’s rankings of their mates as assigned by the Gale–Shapley algorithm is bounded above by
$nH_{n}$
, where
$H_{n}$
is the
$n$
th harmonic number. Knoblauch (Reference Knoblauch2007) showed that this is also an approximate lower bound in the sense that the ratio of the expected sum of men’s rankings of their assigned mates and
$(n+1)H_{n}-n$
has limit 1 as
$n\rightarrow \infty$
. Thus if the men’s preferences are random then this sum is
$\unicode[STIX]{x1D6E9}(n\ln n)$
for large
$n$
. However, it is not hard to design instances where this sum is
$\unicode[STIX]{x1D6E9}(n^{2})$
. One such case is when the men have identical preferences. These results carry over to the Suitor algorithm in that for a graph with random weights the expected number of proposals made is also bounded by
$O(n\ln n)$
, and if the graph is sufficiently dense by
$\unicode[STIX]{x1D6E9}(n\ln n)$
.
The depth of a parallel algorithm is the length of the critical path in the algorithm, and the work in the algorithm is the total number of operations performed by the algorithm. Blelloch, Fineman and Shun (Reference Blelloch, Fineman and Shun2012) have shown that a maximal matching in a graph can be computed with
$O(m)$
work and
$O(\log m\log \unicode[STIX]{x1D6E5})$
depth. Their proof technique was adapted by Khan, Pothen and Ferdous (Reference Khan, Pothen and Ferdous2018b
) to show that the parallel Suitor algorithm has
$O(m)$
work and
$O(\log m\log \unicode[STIX]{x1D6E5})$
depth when the edge weights are chosen uniformly at random.
Among the algorithms presented thus far, experimental evaluations have shown that the highest-weight matching is obtained by Path Growing-DP. This is due to the use of dynamic programming to select an optimal solution on the discovered paths. The Global Paths Algorithm by Maue and Sanders (Reference Maue and Sanders2007) further expands this idea, by trying to get a heavier set of edges on which to perform the dynamic programming. The algorithm starts by sorting the edges and then considers each edge by order of non-increasing weight, similar to the Greedy algorithm. An edge is kept for further consideration in a set
$S$
if it either connects at most two paths already contained in
$S$
, or if it completes a cycle of even length contained in
$S$
. The algorithm then uses dynamic programming on the paths and cycles in
$S$
to obtain the final matching. Even though the Global Paths Algorithm in most instances gives higher weight matchings compared to Path Growing-DP, it does not improve the approximation ratio beyond half.
The idea of computing optimal matchings on restricted subgraphs was also used by Manne and Halappanavar (Reference Manne and Halappanavar2014) in the M1M2 algorithm. This algorithm is based on the observation that the union of the edges from two matchings always consists of paths and even length cycles. The M1M2 algorithm first computes a greedy matching
$M_{1}$
on a graph
$G(V,E,w)$
. It then computes a second greedy matching
$M_{2}$
on
$G(V,E\setminus M_{1},w)$
before performing dynamic programming on
$M_{1}\cup M_{2}$
in the same way as was done in Global Paths Algorithm. This gave results of a similar quality to Global Paths Algorithm. Further use of this idea was shown in Idelberger and Manne (Reference Idelberger and Manne2014) where the dynamic programming was expanded to maximum weight spanning trees, while also performing mergers of multiple matchings following a tree-like structure.
While the algorithms presented thus far tend to perform quite well in practice, often producing optimal or close to optimal solutions, they all have in common that they cannot guarantee a performance ratio higher than
$1/2$
. To do so requires that one considers augmentations containing more than one unmatched edge.
Drake and Hougardy (Reference Drake and Hougardy2005) presented the first such algorithm which computes a
$(2/3-\unicode[STIX]{x1D716})$
-approximation in time
$O(m\unicode[STIX]{x1D716}^{-1})$
. The algorithm is based on increasing the weight of a maximal matching by repeatedly performing 2-augmentations. This algorithm was subsequently simplified by Pettie and Sanders (Reference Pettie and Sanders2004) who also improved the run time to
$m\log \unicode[STIX]{x1D716}^{-1}$
. Their algorithm is based on finding the best 2-augmentation centred in a node
$u$
. For a matching
$M$
and 2-augmenting path
$P$
, a centre node
$u\in P$
has the property that each edge
$(x,y)\in P\setminus M$
is either incident on
$u$
or on the matching partner
$v$
of
$u$
. For a particular vertex
$u$
one can then find the best 2-augmenting path centred in
$u$
in time
$O(\deg (u)+\deg (v))$
.
Pettie and Sanders presented both a simple randomized algorithm RAMA and a slightly more involved deterministic one. In RAMA one picks a random vertex
$u$
and then finds the best 2-augmentation centred at
$v$
and augments if this gives a positive gain. By repeating this
$(1/3)\log \unicode[STIX]{x1D716}^{-1}$
times the algorithm has an expected run time of
$O(m\log \unicode[STIX]{x1D716}^{-1})$
and an expected performance ratio of
$2/3-\unicode[STIX]{x1D716}$
(Pettie and Sanders Reference Pettie and Sanders2004). The algorithm can either start with an empty matching or from an existing one. A variant of RAMA, named ROMA was later determined to be more effective in practice (Maue and Sanders Reference Maue and Sanders2007). In ROMA the algorithm iterates multiple times through all vertices in a random order and performs the same augmentation step as in RAMA. This algorithm computed a higher weight matching when initialized with a matching given by Global Paths Algorithm, albeit at the cost of higher run times. Subsequent developments have given
$(3/4-\unicode[STIX]{x1D716})$
-approximation algorithms running in time
$O(m\log n\log \unicode[STIX]{x1D716}^{-1})$
(Duan and Pettie Reference Duan and Pettie2010, Hanke and Hougardy Reference Hanke and Hougardy2010). However, these have not been tested in practice.
Finally, Duan and Pettie (Reference Duan and Pettie2014) presented a
$(1-\unicode[STIX]{x1D716})$
-approximation algorithm that runs in time
$O(m\unicode[STIX]{x1D716}^{-1}\log \unicode[STIX]{x1D716}^{-1})$
. This algorithm employs the scaling approach to computing weighted matchings, with the subproblem at each scale solved by a primal–dual linear programming formulation of matching. The feasibility and complementary slackness conditions are enforced approximately, with the violation of these conditions dynamically dependent on the scale of the computation.
Structural properties of graphs used for weighted matching, sorted in increasing order of edges.

3.3 Experiments on edge-weighted matching algorithms
The data set consists of ten graphs taken from the SuiteSparse collection (Davis and Hu Reference Davis and Hu2011). Structural properties of these graphs are shown in Table 3.1.
3.3.1 Comparison of exact and approximation algorithms
We begin by comparing the performance of exact algorithms for maximum edge-weighted matching with several approximation algorithms. We report on the exact algorithm implemented in LEDA (Mehlhorn and Näher Reference Mehlhorn and Näher1999). We report on three variant algorithms: LEDA1 uses no initialization, LEDA2 employs a greedy
$1/2$
-approximation matching, and LEDA3 uses a fractional matching initialization. The latter initialization computes a fractional
$\{0,1/2,1\}$
solution to a linear programming formulation of the edge-weighted matching problem; the solution is computed by a combinatorial algorithm, not an LP solver. The fractional solution is then rounded to obtain an initial matching. The
$(2/3-\unicode[STIX]{x1D716})$
-approximation algorithm ROMA is initialized with the Global Paths Algorithm and the Suitor algorithms. We report results for the RAMA algorithm without any initialization since the initialized versions computed lower weights than the corresponding variants of the ROMA algorithm; however, it is faster than the latter. The Duan and Pettie
$(1-\unicode[STIX]{x1D716})$
-approximation algorithm for weighted matching was implemented by Al-Herz and Pothen (Reference Al-Herz and Pothen2019), and we report results for it as well.
For the experiments we used an Intel Xeon E5-2660 processor-based system (part of the Purdue University Community Cluster), called Rice.Footnote 1 The machine consists of two processors, each with ten cores running at 2.6 GHz (20 cores in total) with 25 MB unified L3 cache and 64 GB of memory. The operating system is Red Hat Enterprise Linux release 6.9. All code was developed using C++ and compiled using the g++ compiler (version: 4.4.7) using the –O3 flag.
Comparing the run times of exact and approximation algorithms for maximum edge-weighted matching. Edge weights are from a uniform random distribution in the range
$[1\,1000]$
. Run times of LEDA without any initialization are reported in LEDA1, and for all other algorithms the ratios of the run time of LEDA1 to the other algorithm are presented. For the last problem in the set, LEDA1 did not complete in four hours, and LEDA with greedy initialization (LEDA2) is the baseline. LEDA3 is the LEDA matching algorithm with fractional matching initialization.

Comparison of weights obtained by the exact and approximation algorithms for maximum edge-weighted matching. For each algorithm, we report the difference between one and the ratio of the weight computed by the approximation algorithm and the maximum weight obtained by the exact algorithm, expressed as a percentage.

Comparison of cardinalities obtained by the maximum edge-weighted matching algorithm and the approximation algorithms. Note that this is not the cardinality obtained by a maximum cardinality matching. For each algorithm, we report the difference between one and the ratio of the cardinality of the matching computed by the approximation algorithm and the cardinality of the maximum edge-weighted matching, expressed as a percentage.

Run times and relative performances are reported in Table 3.2. Note that LEDA1 does not terminate on the last problem in the set, whereas LEDA2 and LEDA3 do. For the other nine problems, there is not much difference between the uninitialized version and the greedy initialization, whereas the fractional matching initialization is more effective, about four times faster than the uninitialized version. The
$(2/3-\unicode[STIX]{x1D716})$
-algorithms and the
$(1-\unicode[STIX]{x1D716})$
-approximation algorithms are 20–30 times faster than LEDA1, while the Suitor algorithm is about 1700 times faster, in geometric mean. For the last problem, we use LEDA2 as the baseline algorithm, the Suitor algorithm is 2000 times faster than LEDA2, while for the other approximation algorithms the factor is in the range 35–50.
Now we compare the weights computed by the algorithms. All the exact algorithmic variants compute the same weight, and this is reported in Table 3.3. For the approximation algorithms we report the gap to optimality expressed as a percentage. This value is computed as the ratio of the difference in weight between the maximum and approximate weights and the maximum weight. The Suitor algorithm computes more than 94% of the maximum weight in geometric mean, with the lowest value being 78%. ROMA obtains a lower gap than RAMA, and the ROMA algorithm initialized with the Suitor algorithm computes the highest weight among the
$(2/3-\unicode[STIX]{x1D716})$
-approximation algorithms, but the
$(1-\unicode[STIX]{x1D716})$
-algorithm with
$\unicode[STIX]{x1D716}=1/4$
lowers the gap further to about 1.6%. Note that all these algorithms obtain much better weights than their worst-case approximation ratios.
Finally we compare the cardinalities of the maximum weight matching and approximate matchings in Table 3.4. Note that the cardinality of the exact algorithm is not necessarily equal to that of the maximum cardinality matching. The gap in cardinality is computed analogously to the gap in weights. The cardinality of the approximation algorithms is lower than that of the exact algorithm. The gap in cardinalities is about 3% for Suitor, while it is less than 0.5% for the other approximation algorithms.
The relative performance of these algorithms has a strong dependence on the weights. When we use these algorithms to solve vertex-weighted matchings (with vertex weights chosen uniformly at random, and edge weights computed by adding the vertex weights on the endpoints of an edge), there are problems for which the exact algorithms do not terminate in hundreds of hours. For these problems the
$(2/3-\unicode[STIX]{x1D716})$
-algorithms tend to obtain better weights than the
$(1-\unicode[STIX]{x1D716})$
-approximation algorithm. We discuss these in Section 5 on vertex-weighted matchings.
3.3.2 Comprehensive comparison of approximation algorithms
Now we compare the various approximation algorithms using original edge weights from the graphs rather than the random integer weights used in the previous experiments. We first compare the
$1/2$
-approximation algorithms. Figure 3.3 shows the run time of the Global Paths Algorithm (GPA), and the Greedy, Suitor, Path Growing-DP and M1M2 algorithms for the ten graphs. For Greedy and Path Growing-DP the time to sort the edges is shown separately. This is done using the standard
$qsort$
routine in C. Thus for an application where the edges are not already sorted, then this time must be added to get the total run time.
For these experiments we used a Dell computer running GNU/Linux equipped with four 10 core 2.00 GHz Intel Xeon E7-4850 processors with a total of 128 GB memory. Algorithms were implemented in C using OpenMP for parallelization and compiled with gcc using the –O3 flag.
Run times for five
$1/2$
-approximation algorithms.

As can be seen from the figure, for all but one graph the time to sort dominates the time taken by all other algorithms, in many cases by as much as an order of magnitude. When one excludes the time to sort, Greedy is the fastest algorithm followed by Suitor and Path Growing-DP. These again outperform M1M2 and the Global Paths Algorithm. If one includes the time to sort the edges then Suitor outperforms Greedy while M1M2 outperforms the Global Paths Algorithm.
To measure the quality of the solutions given by these algorithms we compute the average performance ratio for each algorithm compared to the best algorithm for each graph. This shows that Greedy, Path Growing-DP, M1M2 and Path Growing algorithms have an average performance ratio of 2.44%, 1.67%, 0.21% and 0.04%, respectively, higher than the best algorithm for each graph. Thus it follows that the more time-consuming algorithms also gives better results.
Next, we compare the use of either RAMA or ROMA for post-processing a solution. We first note that in terms of run time RAMA is about 10% slower than ROMA. Each application of ROMA is on average 4.9 times slower than the corresponding edge sorting. Thus there is a fairly large cost for using this post-processing. As there is also a slight advantage of using ROMA over RAMA in terms of quality of solution, we only present results from using ROMA.
How much improvement ROMA gives depends on the starting configuration. The average improvement for using Suitor followed by ROMA was 4.9% while both M1M2 and Global Paths Algorithm were improved by 2.6%. In terms of absolute quality of the final solution Suitor followed by ROMA always gave the best solution. On average M1M2 was 0.19% worse while Global Paths Algorithm was 2.11%. Thus, in terms of both run time and quality, the preferred strategy is to use Suitor followed by ROMA.
In Figure 3.4 we show the speedup curves for Suitor, M1M2 and Local Max algorithms when run on the graph nlpkkt200. For both Suitor and M1M2 the speedups increase almost linearly as long as there are available threads. Although the CPUs can perform hyper-threading, this does not give any additional speedup when using 50 threads. The speedup for Local Max drops off earlier than Suitor. The sequential run time for Local Max is about 70% higher than that of Suitor. Combined with the lower speedup it follows that the parallel run time of Local Max is even worse.
Speedup for Suitor, M1M2 and Local Max algorithms on the nlpkkt200 graph.

Approximation algorithms for edge-weighted matchings have been implemented on GPUs by several authors. We list some of these papers: Cohen and Castonguay (Reference Cohen and Castonguay2012), Fagginger Auer and Bisseling (Reference Fagginger Auer, Bisseling, Keller, Kramer and Weiss2012), Halappanavar et al. (Reference Halappanavar, Feo, Villa, Dobrian and Pothen2012) and Naim et al. (Reference Naim, Manne, Halappanavar, Tumeo and Langguth2015).
3.4 Applications of matchings
3.4.1 Maximum cardinality matching
Maximum cardinality matchings in bipartite graphs have been employed in sparse matrix algorithms for several purposes. A maximum matching can be used to permute a sparse matrix to place the largest number of non-zeros on the diagonal. This number is the structural rank of the matrix, which is an upper bound on the numerical rank.
In the following we say that a matrix has a row-perfect matching to mean that its bipartite graph consisting of row vertices and column vertices has a matching in which all rows are matched. The concept of a column perfect matching is similar, and a perfect matching is both row-perfect and column-perfect.
A maximum matching can be used to compute the block (lower) triangular form (BTF) of a sparse matrix, which has the block matrix structure
$$\begin{eqnarray}A=\left(\begin{array}{@{}ccc@{}}A_{11} & A_{12} & A_{13}\\ 0 & A_{22} & A_{23}\\ 0 & 0 & A_{33}\end{array}\right)\!,\end{eqnarray}$$
where
$A_{11}$
has fewer rows than columns and has a row-perfect matching,
$A_{22}$
is a square matrix with a perfect matching, and
$A_{33}$
has fewer columns than rows and has a column-perfect matching. The submatrices
$A_{12}$
,
$A_{13}$
and
$A_{23}$
could be zero. The submatrix
$A_{11}$
has the strong Hall property with respect to its rows (Coleman, Edenbrandt and Gilbert Reference Coleman, Edenbrandt and Gilbert1986, Pothen and Fan Reference Pothen and Fan1990). This property states that every set of
$k$
rows has non-zeros in at least
$(k+1)$
columns. The submatrix
$A_{33}$
has the strong Hall property with respect to its columns, and
$A_{22}$
has the strong Hall property with respect to both rows and columns (in this last case
$k<n$
, where
$n$
is the dimension of
$A_{22}$
).
The BTF of a sparse matrix is derived from the Dulmage–Mendelsohn decomposition of the bipartite graph of the matrix, which could be computed from a maximum matching in the graph. The subgraph corresponding to
$A_{11}$
is obtained by following all alternating paths from unmatched columns, and including all rows and columns reached in the subgraph. The subgraph corresponding to
$A_{33}$
is obtained by following all alternating paths from unmatched rows, and including all rows and columns reached. The submatrix corresponding to
$A_{22}$
consists of all rows and columns not reached thus far, and they must be matched to each other since all unmatched columns and rows have been accounted for. (There is a finer decomposition for
$A_{22}$
which we do not describe here.) The decomposition is unique for a bipartite graph and is independent of the specific maximum matching used to induce it. Further details may be found in Pothen and Fan (Reference Pothen and Fan1990).
The BTF can be used to reduce the work in solving sparse linear systems of equations by a factorization-based algorithm, since only the diagonal blocks in the BTF need to be factored. The BTF has been used to solve Kirchoff’s equations in circuit design within the Xyce circuit simulation code (Keiter et al.
Reference Keiter, Thornquist, Hoekstra, Russo, Schiek, Rankin, Li, Silveira and Feldmann2011), and it is also used to solve nonlinear systems of equations in systems modelling software such as Modelica (Fritzson Reference Fritzson2014). The strong Hall matrices in the BTF could be used to correctly predict the non-zero structures of orthogonal-triangular (
$QR$
) factors of sparse matrices (Coleman et al.
Reference Coleman, Edenbrandt and Gilbert1986, Pothen Reference Pothen1993). Matchings have also been used to compute sparse bases for the null space of sparse, under-determined matrices, as also sparse bases for the column space of such matrices (Coleman and Pothen Reference Coleman and Pothen1987, Pinar, Chow and Pothen Reference Pinar, Chow and Pothen2006).
In applications such as the BTF, one needs to compute a maximum cardinality matching in bipartite graphs, and an approximation will not suffice. Duff, Kaya and Uçar (Reference Duff, Kaya and Uçar2011) have addressed the several choices one needs to obtain an efficient practical algorithm. The Karp–Sipser algorithm is used as an initialization, and then there are choices to be made on if the augmenting path searches should use breadth-first search (BFS) or depth-first search (DFS) or some combination of them. It is also clear from their work and other authors, that the theoretically less efficient
$O(nm)$
time algorithms are faster than the Hopcroft–Karp algorithm with
$O(n^{1/2}m)$
time complexity. Azad, Buluç and Pothen (Reference Azad, Buluç and Pothen2017) have designed efficient shared-memory parallel algorithms for this problem. A distributed-memory parallel algorithm scaling to hundred-thousand cores has been implemented using sparse matrix vector products using the Graph-BLAS operations by Azad and Buluç (Reference Azad and Buluç2016).
3.4.2 Maximum edge-weighted matchings
An important application we consider is sparse Gaussian elimination (
$LU$
factorization). Here, permuting the sparse matrix to have large elements on the diagonal before the numerical factorization makes it less likely that numerical pivoting (row permutations) will be required during the computation to prevent large element growth in the factors. Olschowka and Neumaier (Reference Olschowka and Neumaier1996) described a pivoting strategy using a primal–dual algorithm for the assignment problem, which was then adapted and implemented for sparse bipartite graphs by Duff and Koster (Reference Duff and Koster2001). A perfect matching that has the maximum product of matched elements is computed in this context, and the resulting code, MC64, is widely used. Hogg and Scott (Reference Hogg and Scott2013) discuss several pivoting strategies, including matching-based orderings, to solve symmetric, indefinite systems of equations.
As parallel computers are able to solve systems of linear equations with millions of rows and columns, one challenge that has remained here is that the primal–dual algorithm used to compute perfect matchings does not have much concurrency. Hogg and Scott (Reference Hogg and Scott2015) have employed the auction algorithm on shared-memory machines to compute the matching in parallel, but scaling to the large numbers of cores on distributed-memory machines remained an open problem. This raised the possibility that approximation algorithms for matching could be employed in this context. In recent work Azad et al. (Reference Azad, Buluç, Li, Wang and Langguth2018) have described an approach that scales to 17 000 cores, and we consider this next.
Azad et al. (Reference Azad, Buluç, Li, Wang and Langguth2018) first compute a perfect matching in the bipartite graph and then seek to increase its weight. (A perfect matching must exist if the matrix is non-singular.) The perfect matching is computed by a distributed-memory parallel algorithm that recasts the problem in terms of matrix–vector products in a suitable semi-ring using the Graph-BLAS operations (Azad and Buluç Reference Azad and Buluç2016). The increase in weight is accomplished by means of the
$(2/3-\unicode[STIX]{x1D716})$
-approximation algorithm of Pettie and Sanders (Reference Pettie and Sanders2004), which can be simplified here because the graph is bipartite and the matching is perfect. Hence they search for weight-increasing cycles with four edges (see Figure 3.1), finding for each vertex a cycle that leads to the largest increase in matching weight. From the set of cycles obtained, a maximal set of vertex-disjoint cycles is chosen using a greedy algorithm, and the matching weight is increased without affecting the cardinality of the perfect matching. The approximation guarantee of this algorithm is
$(2/3-\unicode[STIX]{x1D716})$
and it is computed in
$O(m\log \unicode[STIX]{x1D716}^{-1})$
time.
In a distributed-memory parallel implementation, it is not easy to find a maximal set of vertex-disjoint cycles without extensive communication, and hence these authors instead use only local comparisons to obtain a heavy set of vertex-disjoint cycles. Thus the parallel algorithm does not have the approximation guarantee, but it computes a heavy-weight matching that performs well in practice; it runs in
$O((m/p)(1+\unicode[STIX]{x1D6FD})+\unicode[STIX]{x1D6FC}p)$
time, where
$p$
is the number of processors,
$\unicode[STIX]{x1D6FC}$
is the latency and
$\unicode[STIX]{x1D6FD}$
is the inverse bandwidth. The authors report results for the algorithm on distributed-memory machines with 17 000 cores. Their code has been incorporated into the distributed-memory SuperLU solver for sparse, unsymmetric, linear systems of equations (Li and Demmel Reference Li and Demmel2003). Additional details on the applications of matchings in sparse matrix algorithms is provided in Duff and Uçar (Reference Duff, Uçar, Naumann and Schenk2012).
Exact algorithms for maximum cardinality matchings and maximum edge-weighted matchings in bipartite and non-bipartite graphs are available in the LEDA library (Mehlhorn and Näher Reference Mehlhorn and Näher1999). We compare the performance of approximation algorithms for vertex- and edge-weighted matchings with the LEDA codes in Section 5.
3.5 Matching software
In Table 3.5 we tabulate software libraries available for several matching problems. Software for
$b$
-matching, edge cover and
$b$
-edge cover will be discussed in their respective sections. An earlier discussion of matching algorithms and software is provided by Burkard et al. (Reference Burkard, Dell’Amico and Martello2009).
Matching software libraries.

The MC64 code in the Harwell Subroutine Library (HSL) computes a maximum product edge-weighted perfect matching in a bipartite graph in order to place large elements on the diagonal of a sparse, square matrix (Duff and Koster Reference Duff and Koster2001). The primal–dual Hungarian algorithm is employed with a logarithmic transformation of the weights to compute a maximum product matching. Code for computing a maximum sum edge-weighted perfect matching is also included. This code is widely used in the pre-processing step in solving sparse systems of linear equations.
LEDA (Mehlhorn and Näher Reference Mehlhorn and Näher1999) has codes for computing maximum edge-weighted matchings in both bipartite graphs and non-bipartite graphs. In our experience, this code is the fastest of the exact matching codes available for this problem. The algorithm uses a fractional matching initialization for non-bipartite graphs, which speeds it up over a greedy initialization. It is commercial software. The LEMON library (Dezső, Jüttner and Kovács Reference Dezső, Jüttner and Kovács2011) contains an exact maximum edge-weighted matching code. BLOSSOM V is another code for minimum weight perfect matching in non-bipartite graphs by Kolmogorov (Reference Kolmogorov2009).
The colleagues and students of the first author have created a software library called Matchbox, which contains a number of exact and approximation algorithms for several variants of the matching problem. Included are exact algorithms for maximum cardinality matching in bipartite and non-bipartite graphs, and a
$1/2$
-approximation algorithm for bipartite graphs. For edge-weighted matching, it has exact algorithms for maximum edge weight, perfect matching with maximum edge weight, and maximum weight semi-perfect matching, all for bipartite graphs. It also has a
$1/2$
-approximate greedy algorithm for both bipartite and non-bipartite graphs. For vertex-weighted matchings, it has exact algorithms for both bipartite and non-bipartite graphs. The collection of approximation algorithms includes
$2/3$
-,
$(1-\unicode[STIX]{x1D716})$
- and several variants of
$1/2$
-approximation algorithms (Greedy, Locally Dominant Edge, Path Growing-DP, Suitor), for both bipartite and non-bipartite graphs. (The bipartite graph algorithms for vertex-weighted matching make use of the Mendelsohn–Dulmage theorem to make them more efficient.)
Codes for several
$1/2$
-approximation algorithms for edge-weighted matching, including the Suitor algorithm, will be available from the third author’s website. Included are Suitor, Local Max, Locally Dominant Edge, Path Growing, Path Growing-DP, Global Paths Algorithm and M1M2 algorithms. Multi-threaded parallel implementations of some of these algorithms are also included.
Implementations of ten variants of exact algorithms for maximum cardinality matching in bipartite graphs are provided by Kamer Kaya in a code called Matchmaker. The algorithms are based on breadth-first search, depth-first search and push–relabel techniques. MATLAB interfaces to the codes are also included. A GPU code for this problem, Matchmaker2, is also available (Deveci, Kaya, Uçar and Çatalyürek Reference Deveci, Kaya, Uçar and Çatalyürek2013).
A parallel multi-threaded code for computing
$1/2$
-approximate maximum cardinality matchings in bipartite graphs has been provided by Azad. Distributed-memory parallel codes for exact maximum cardinality matching,
$1/2$
-approximate cardinality matching and heavy-weight perfect matching, all in bipartite graphs, are also available. These codes employ Combinatorial BLAS (matrix operations in a suitably defined semi-ring) (Buluç and Gilbert Reference Buluç and Gilbert2011) to compute the matchings.
4 The
$b$
-matching problem
4.1 Background on
$b$
-matching
We turn to a generalization of the matching problem. Given a graph
$G=(V,E)$
and a function
$b(.)$
that maps each vertex to a natural number, a
$b$
-matching is a subset of edges
$M$
such that at most
$b(v)$
edges in
$M$
are incident on each vertex
$v$
. We assume that
$b(v)\leq \deg (v)$
for all
$v$
. If
$b(v)$
is identically equal to one, then we have the matching problem. If the edges have weights
$w$
, then the weight of a
$b$
-matching is the sum of the weights of the matched edges, and we seek to compute a
$b$
-matching of maximum weight. We denote
$b(V)=\sum _{v\in V}b(v)$
and
$\unicode[STIX]{x1D6FD}=\max _{v\in V}b(v)$
.
An exact algorithm for a maximum weight
$b$
-matching was first designed by Edmonds (Reference Edmonds1965), and Pulleyblank (Reference Pulleyblank1973) later gave a pseudo-polynomial time algorithm with complexity
$O(mnb(V))$
. Anstee (Reference Anstee1987) proposed a three-stage algorithm where the
$b$
-matching problem is solved by transforming it to a Hitchcock transportation problem, rounding the solution to integer values, and finally invoking Pulleyblank’s algorithm. Derigs and Metz (Reference Derigs and Metz1986) and Miller and Pekny (Reference Miller and Pekny1995) improved the Anstee algorithm further. Padberg and Rao (Reference Padberg and Rao1982) developed another algorithm using the branch and cut approach, and Grötschel and Holland (Reference Grötschel and Holland1985) solved the problem using the cutting plane technique. A survey of exact algorithms for
$b$
-matchings was provided by Müller-Hannemann and Schwartz (Reference Müller-Hannemann and Schwartz2000). More recently, Huang and Jebara (Reference Huang and Jebara2011) proposed an exact
$b$
-matching algorithm based on belief propagation. The algorithm assumes that the solution is unique, and otherwise it does not guarantee convergence.
We now describe work on approximate
$b$
-matching. Mestre (Reference Mestre2006) showed that a
$b$
-matching is a relaxation of a matroid called a 2-extendible system, and hence that the greedy algorithm gives a
$1/2$
-approximation for a maximum weight
$b$
-matching. We describe his proof in the next subsection. Mestre also generalized the path-growing algorithm of Drake and Hougardy (Reference Drake and Hougardy2003b
) to obtain an
$O(\unicode[STIX]{x1D6FD}m)$
time 1/2-approximation algorithm. These algorithms are slower in practice than a serial
$b$
-Suitor algorithm that generalizes the Suitor algorithm (Khan et al.
Reference Khan, Pothen, Patwary, Satish, Sundaram, Manne, Halappanavar and Dubey2016b
). Since the Path Growing algorithm is inherently sequential, it is not a good candidate for parallelization. Additionally, Mestre (Reference Mestre2006) generalized a randomized algorithm for matching to obtain a
$(2/3-\unicode[STIX]{x1D716})$
-approximation algorithm with expected run time
$O(\unicode[STIX]{x1D6FD}m\log (1/\unicode[STIX]{x1D716}))$
. De Francisci Morales, Gionis and Sozio (Reference De Francisci Morales, Gionis and Sozio2011) have adapted the Greedy algorithm and an integer linear program (ILP) based algorithm to the MapReduce environment to compute
$b$
-matchings in bipartite graphs.
$b$
-matching algorithms have also been developed using linear programming (Koufogiannakis and Young Reference Koufogiannakis and Young2011, Manshadi et al.
Reference Manshadi, Awerbuch, Gemulla, Khandekar, Mestre and Sozio2013), but these methods are orders of magnitude slower than the
$b$
-Suitor algorithm. Georgiadis and Papatriantafilou (Reference Georgiadis and Papatriantafilou2013) have developed a distributed algorithm based on adding locally dominating edges to the
$b$
-matching, which leads to a Locally Dominant Edge algorithm. Our recent work on
$b$
-matching algorithms have focused on developing the Locally Dominant Edge and
$b$
-Suitor algorithms, and implementing them efficiently on serial computers and shared-memory and distributed-memory multiprocessors (Khan et al.
Reference Khan, Pothen, Patwary, Halappanavar, Satish, Sundaram and Dubey2016a
, Reference Khan, Pothen, Patwary, Satish, Sundaram, Manne, Halappanavar and Dubey2016b
). We will discuss the
$b$
-Suitor algorithm later in this section.
4.2 Half-approximation algorithms for
$b$
-matching
4.2.1 The Greedy algorithm
Algorithm 8 describes the Greedy algorithm for computing a
$b$
-matching in a graph
$G$
.
The Greedy algorithm is a
$1/2$
-approximation algorithm for the maximum weight
$b$
-matching problem. We prove this by an argument that employs matroid theory due to Mestre (Reference Mestre2006).
Let
$E$
be a set of elements, and
${\mathcal{I}}$
a collection of subsets of
$E$
. The tuple
$(E,{\mathcal{I}})$
is a matroid if
(i) for all
$A\subseteq B$
, if
$B\in {\mathcal{I}}$
, then
$A\in {\mathcal{I}}$
, and(ii) for all
$A,B\in {\mathcal{I}}$
with
$|A|<|B|$
, there exists an element
$x\in B\setminus A$
such that
$A+x\in {\mathcal{I}}$
.
The sets in
${\mathcal{I}}$
are called the independent sets of the matroid, and by the first property, the empty set is independent. Maximal independent sets are called the bases of the matroid, and by the second property, all bases have the same cardinality. The reader unfamiliar with matroids may find two examples helpful. If
$E$
is the set of columns of a matrix, and independence corresponds to linear independence in a vector space, then we have a matric matroid. If
$E$
is the set of edges of a connected undirected graph without loops, and a subset of edges is defined to be independent if the edges do not induce a cycle, then we have a graphic matroid. A basis here corresponds to a spanning tree of the graph.
Assign every element in
$E$
a non-negative weight, define the weight of a set as the sum of the weights of its elements, and consider the problem of finding an independent set of largest weight. The Greedy algorithm begins with the empty set, and at each step adds an element of largest weight if its addition will preserve independence, and rejects it otherwise. The Greedy algorithm finds an independent set (a basis) of maximum weight if and only if the tuple
$(E,{\mathcal{I}})$
is a matroid.
It is well known that a matching does not correspond to a matroid, but a matching in a bipartite graph is the intersection of two matroids. We now consider a more general system called a
$k$
-extendible system related to a matroid. A
$k$
-extendible system is a tuple
$(E,{\mathcal{I}})$
that satisfies property (i) of a matroid, but property (ii) is replaced by
(ii′) for all
$A\subseteq B\in {\mathcal{I}}$
and
$x\in E$
, if
$A+x\in {\mathcal{I}}$
but
$B+x\notin {\mathcal{I}}$
, then there exists
$Y\subseteq B\setminus A$
, such that
$B\setminus Y+x\in {\mathcal{I}}$
and
$|Y|\leq k$
.
In words, this means that if we can augment a smaller independent set
$A$
with a new element
$x$
and preserve its independence, then it should be possible to remove a subset of size at most
$k$
from any superset of
$A$
that is independent, add
$x$
to the new set and still preserve independence. Maximal independent sets do not necessarily have unique maximum cardinality for
$k$
-extendible systems.
As a concrete example, let us consider an undirected graph
$G=(V,E,w)$
with vertex set
$V$
, edge set
$E$
and non-negative weights on its edges
$W$
. Further, we are given a set of natural numbers
$b(v)\leq \deg (v)$
for each
$v\in V$
. Let the collection of independent sets
${\mathcal{I}}$
be defined as subsets of edges that consist of a
$b$
-matching in
$G$
, i.e. subsets of edges
$M$
such that
$\deg _{M}(v)\leq b(v)$
for all
$v\in V$
. Let
$A$
be a
$b$
-matching in
$G$
and let
$B\supset A$
be another
$b$
-matching. Let
$x=(u,v)$
be an edge that could be added to
$A$
but not to
$B$
to obtain a larger
$b$
-matching. The reason that this edge cannot be added to
$B$
is that the values of one or both of
$b(u)$
and
$b(v)$
would be exceeded. By removing one edge incident on
$u$
and another edge incident on
$v$
from
$B$
, we would be able to add the edge
$(u,v)$
to
$B$
and preserve a
$b$
-matching. Thus we have shown that a
$b$
-matching is a 2-extendible system.
We now provide some concepts and prove a preliminary lemma in order to prove that the Greedy algorithm computes a
$1/2$
-approximation algorithm. We prove a more general result for
$k$
-extendible systems. An extension of an independent set
$A\in {\mathcal{I}}$
is a superset
$B$
of
$A$
with
$B\in {\mathcal{I}}$
. We denote an extension of maximum weight of a set
$A$
by
$\text{OPT}(A)$
.
Let the Greedy algorithm choose elements
$x_{1},x_{2},\ldots ,x_{l}$
on a maximization problem on a
$k$
-independence system
$(E,{\mathcal{I}})$
. We denote the set of chosen elements at the end of the
$i$
th iteration of the Greedy algorithm by
$S_{i}$
, with
$S_{0}=\emptyset$
and
$S_{i}=S_{i-1}+x_{i}$
. Note that
$\text{OPT}(\emptyset )$
is the optimal solution to the maximization problem, and
$\text{OPT}(S_{l})=S_{l}$
, since the set
$S_{l}$
is maximal. Furthermore, we have
since with increasing index
$i$
,
$S_{i}$
has fewer extensions available than
$S_{i-1}$
.
Lemma 4.1. If
$(E,{\mathcal{I}})$
is a
$k$
-extendible system, then the element
$x_{i}$
chosen by the Greedy algorithm at the
$i$
th step satisfies
Proof. By the definition of
$k$
-extendibility,
$S_{i-1}\in {\mathcal{I}}$
and
$\text{OPT}(S_{i-1})\in {\mathcal{I}}$
. Now since the Greedy algorithm chooses the element
$x_{i}$
at the
$i$
th step, it does not belong to
$S_{i-1}$
, but it could belong to
$\text{OPT}(S_{i-1})$
. If it does, then
$\text{OPT}(S_{i-1})=\text{OPT}(S_{i})$
, and the lemma holds trivially. Hence consider the situation when the element
$x_{i}\not \in \text{OPT}(S_{i-1})$
. By
$k$
-extendibility, there exists
$Y\in \text{OPT}(S_{i-1})\setminus S_{i-1}$
such that
$\text{OPT}(S_{i-1})\setminus Y+x_{i}\in {\mathcal{I}}$
, where
$|Y|\leq k$
. We have the relationships
The first line of the equation above follows since
$Y$
belongs to
$\text{OPT}(S_{i-1})$
but
$x_{i}$
does not. The second follows because
$\text{OPT}(S_{i-1})\setminus Y+x_{i}$
is an extension of the set
$S_{i}=S_{i-1}+x_{i}$
by the choice of
$Y$
, and
$\text{OPT}(S_{i})$
is an extension of maximum weight of the set
$S_{i}$
.
Now we show that any element
$y\in Y$
is not heavier than the element
$x_{i}$
, i.e.
$w(y)\leq w(x_{i})$
. Assume for the sake of contradiction that
$w(y)>w(x_{i})$
. If
$y$
is heavier than
$x_{i}$
, then since
$y\notin S_{i-1}$
by the choice of
$Y$
, the element
$y$
must have been considered by the Greedy algorithm before
$x_{i}$
was included in
$S_{i}$
, but was not included in the greedy solution. Thus there exists
$j\leq i$
such that
$S_{j}+y\notin {\mathcal{I}}$
, but
$S_{j}+y\subseteq \text{OPT}(S_{i-1})\in {\mathcal{I}}$
. But this contradicts property (i) of a
$k$
-independence system. Thus
$w(y)\leq w(x_{i})$
, and since all weights are positive,
$w(Y)\leq kw(x_{i})$
.◻
Theorem 4.2 (Mestre).
If
$(E,{\mathcal{I}})$
is a
$k$
-extendible system, then the Greedy algorithm is a
$1/k$
-approximation algorithm for computing an independent set of maximum weight.
Proof. Let
$\{x_{i}:i=1,2,\ldots ,l\}$
be the elements chosen by the Greedy algorithm, and the corresponding sets of chosen elements be denoted by
$\{S_{i}:i=1,2,\ldots ,l\}$
. We apply Lemma 4.1
$l$
times, beginning with the empty set
$S_{0}$
, to get
$$\begin{eqnarray}\displaystyle w(\text{OPT}(S_{0})) & \leq & \displaystyle w(\text{OPT}(S_{1}))+(k-1)\,w(x_{1})\nonumber\\ \displaystyle & \leq & \displaystyle w(\text{OPT}(S_{l}))+(k-1)\,\mathop{\sum }_{i=1}^{l}w(x_{i})\nonumber\\ \displaystyle & = & \displaystyle w(S_{l})+(k-1)\,w(S_{l})=k\,w(S_{l}).\nonumber\end{eqnarray}$$
The first term in last line of the equation follows from the fact that the set
$S_{l}$
is maximal, and the second term is obtained by the summing the weight of the elements in
$S_{l}$
. Since
$\text{OPT}(S_{0})$
is an independent set of maximum weight, we obtain the
$1/k$
-approximation property of the Greedy algorithm.◻
4.2.2 The
$b$
-Suitor algorithm
The
$b$
-Suitor algorithm, designed by Khan et al. (Reference Khan, Pothen, Patwary, Satish, Sundaram, Manne, Halappanavar and Dubey2016b
), computes a
$1/2$
-approximate
$b$
-matching; indeed it computes a matching identical to the one obtained by the Greedy algorithm, provided ties in weights are broken consistently in both algorithms. This algorithm is based on proposals, much like the algorithms for the stable marriage problem and its variants (here the stable fixtures problem), and is a generalization of the Suitor algorithm. Vertices can propose to their heaviest neighbours, and these proposals may be reciprocated or annulled by other vertices. Two vertices are matched when both propose to each other. Unlike the Greedy algorithm, the
$b$
-Suitor algorithm does not need to process edges in non-increasing order of weights; instead, it can process vertices in any order, although each vertex has to make proposals to its available neighbours in non-increasing order of weights.
The pseudo-code for the
$b$
-Suitor algorithm is described in Algorithm 9. It maintains a priority queue
$S$
to track the proposals made in the algorithm. The queue
$S(u)$
consists of the suitors of a vertex
$u$
, i.e. those neighbours of
$u$
that currently have an active proposal to
$u$
. The operation
$S(u).insert(v)$
adds a vertex
$v$
to the priority queue
$S(u)$
, and
$S(u).remove(v)$
removes it. The value
$r(u)$
is the number of proposals that a vertex
$u$
currently has made to its neighbours. We keep track of the lowest weight of a proposal received by a vertex
$u$
(made by a suitor of
$u$
) in
$S(u).\text{last}$
. If
$u$
has received fewer than
$b(u)$
proposals, this value is
$\operatorname{NULL}$
.
In each iteration of the outer while loop, the algorithm processes vertices that have their current
$b(.)$
values unsatisfied, and makes the requisite number of proposals to satisfy the
$b(.)$
values; these vertices are stored in a set
$Q$
. During the iteration it collects vertices whose
$b(.)$
values may be decremented in a set
$Q^{\prime }$
so that they could be processed in the next iteration. For each vertex
$u\in Q$
, while its
$b(u)$
value is not satisfied and
$\text{adj}(u)$
has not been exhaustively searched, the algorithm finds eligible neighbours to propose to. A neighbour
$v$
is an eligible neighbour of
$u$
if it holds fewer than
$b(v)$
proposals, or
$u$
can beat the lowest offer that
$v$
currently has, which is
$S(v).\text{last}$
. If
$u$
cannot beat this offer, then it considers its next heaviest neighbour, and this prevents proposals being extended which at the current stage of the algorithm have no chance of success, saving work. But if
$v$
has fewer than
$b(v)$
proposals, or if
$u$
can beat the lowest offer that
$v$
has, then
$u$
proposes to
$v$
, and becomes a suitor of
$v$
. In the latter case,
$u$
annuls the lowest-weight proposal of
$v$
, say from a vertex
$y$
, and
$y$
has to make another proposal in the next iteration. The value of
$S(v).\text{last}$
is also updated.
Algorithm 9 shows that when a proposal made by a vertex
$y$
is annulled, it is placed into a queue to be processed in the next iteration. This corresponds to the Gale–Shapley algorithm for stable marriage which processes proposals in rounds. Instead, one could consider the vertex
$y$
making a proposal immediately, and this would correspond to the McVitie–Wilson algorithm. It is the possibility of proposals being annulled that permits vertices to be processed in any order, thus increasing the concurrency in the algorithm. We have shown that if the edge weights are chosen uniformly at random, then the total expected work in the algorithm is linear in the number of edges in the graph, so that the algorithm does not create a lot of unnecessary work (Khan et al.
Reference Khan, Pothen and Ferdous2018b
). This paper also shows that the depth (the length of the critical path) is
$O(\log m\log \unicode[STIX]{x1D6E5})$
.
4.3 Implementation and applications of
$b$
-matchings
The
$b$
-Suitor algorithm was implemented on serial, shared-memory and distributed-memory computers, and it is currently the fastest practical algorithm that we know of (Khan et al.
Reference Khan, Pothen, Patwary, Halappanavar, Satish, Sundaram and Dubey2016a
, Khan et al.
Reference Khan, Pothen, Patwary, Satish, Sundaram, Manne, Halappanavar and Dubey2016b
). It has been compared with the Greedy algorithm and the Locally Dominant Edge algorithm (LDE), and it outperforms both these algorithms with regard to run times. All of these algorithms compute the same
$b$
-matching provided ties in weights are broken in a consistent manner. The
$b$
-Suitor algorithm has the desirable property that the parallel algorithms and the serial algorithm compute the same
$b$
-matching. This algorithm was scaled to more than 12 000 cores on a distributed-memory parallel computer. An implementation on GPUs was reported by Naim and Manne (Reference Naim and Manne2018).
$b$
-matchings have been applied to a number of problems such as finite element mesh refinement (Müller-Hannemann and Schwartz Reference Müller-Hannemann and Schwartz2000), median location problems (Tamir and Mitchell Reference Tamir and Mitchell1998), spectral data clustering (Jebara and Shchogolev Reference Jebara and Shchogolev2006), etc. An important application of
$b$
-matching is in graph-based semi-supervised machine learning, where a
$b$
-matching has been used to replace the well-known
$k$
-nearest neighbour graph construction (Jebara, Wang and Chang Reference Jebara, Wang and Chang2009). Both of these constructions are discussed in this context by Subramanya and Talukdar (Reference Subramanya and Talukdar2014). We will discuss this matter in more detail when we consider applications of
$b$
-edge cover, but we state here that an approximate
$b$
-matching construction reduces the time complexity of this approach from
$O(b(V)m\log n)$
to
$O(m\log \unicode[STIX]{x1D6FD})$
, without any discernible loss in quality in the classification. Recently, Choromanski, Jebara and Tang (Reference Choromanski, Jebara, Tang and Burges2013) used
$b$
-matching to solve a data privacy problem called adaptive anonymity. Again, we will discuss this problem as an application of
$b$
-edge cover.
An implementation of
$b$
-Suitor is available at https://github.com/Exa-Graph. Parallel versions of this code will be included in this repository.
5 Vertex-weighted matching
We consider a variant of the matching problem that has not been well studied. We are given a graph
$G=(V,E)$
, and a weight function
$w:V\mapsto \mathbb{R}_{\geq 0}$
that assigns non-negative real-valued weights to vertices. The weight of a matching in
$G$
is now the sum of the weights on the matched vertices. The problem is to compute a matching of maximum (vertex-) weight in the graph
$G$
(MVM).
By summing the weights on the endpoints of an edge and assigning it to the edge, we can transform the vertex-weighted matching problem into an edge-weighted matching problem. So at first blush it appears that we can solve MVM problems with edge-weighted matching algorithms. But at least for exact algorithms, this can increase the run times of the edge-weighted matching algorithms by three or four orders of magnitude (Dobrian, Halappanavar, Pothen and Al-Herz Reference Dobrian, Halappanavar, Pothen and Al-Herz2018). Additionally the MVM problem has a rich structure that leads to simpler algorithms than those employed for the MEM problem. We can say that the MVM problem is closer to the maximum cardinality matching problem than the maximum edge-weighted matching problem. Dobrian et al. (Reference Dobrian, Halappanavar, Pothen and Al-Herz2018) have designed both exact and approximation algorithms for this problem.
An MVM can be characterized in two different ways. The first characterization is in terms of augmenting paths and weight-increasing paths. An augmenting path is defined as earlier, a path that has alternating unmatched edges and matched edges, with one more unmatched edge than matched edges. By augmenting a matching using this path, we add the weights of the unmatched endpoints of the path to the matching, and hence the cardinality of the matching increases while the weight of the augmented matching cannot decrease since vertex weights are non-negative. A reversing path is an alternating path with an even number of edges that begins with a matched edge and ends with an unmatched edge. A reversing path is weight-increasing if the matched endpoint of the path has lower weight than the unmatched endpoint. In this case, by switching the matched and unmatched edges on the path we increase the weight of the matching. Dobrian et al. (Reference Dobrian, Halappanavar, Pothen and Al-Herz2018) proved the following result.
Theorem 5.1. A matching
$M$
is an MVM if and only if there is neither an augmenting path nor a weight-increasing path with respect to
$M$
.
The second characterization is in terms of weight vectors. For any matching
$M$
, consider a weight vector which lists the weights of the matched vertices in non-increasing order. Now we can compare two matchings by comparing their weight vectors lexicographically. The following result may also be found in Dobrian et al. (Reference Dobrian, Halappanavar, Pothen and Al-Herz2018).
Theorem 5.2. A matching
$M$
is an MVM if and only if its weight vector is lexicographically maximum among all weight vectors of matchings.
These results lead to two different exact algorithms for the MVM problem.
One of these algorithms processes vertices in non-increasing order of their weights, and from each unmatched vertex
$u$
searches for a heaviest unmatched vertex
$v$
it can reach by augmenting paths. If the augmenting path search is successful, then the matching is augmented. If it is not successful, we discard this unmatched vertex
$u$
(we will not find an augmenting path from
$u$
in the future steps of the algorithm). In both cases, we process the next heaviest unmatched vertex, terminating when we have processed or matched all the vertices. In this algorithm by the choice of vertices matched at each step, there will be no weight-increasing path, and it suffices to search for augmenting paths.
A second algorithm would first compute a maximum cardinality matching (of arbitrary weight) in the graph. Then we search for weight-increasing paths of even length from each unmatched vertex. If we succeed, then we switch matched to unmatched edges and vice versa on this path, and increase the matching weight. If we do not succeed, then we process the next unmatched vertex. Note that in this case, by construction, there cannot be an augmenting path. This algorithm is attractive practically for several reasons. The first is that this algorithm does not need to process vertices in non-increasing order of weights, and hence there is more concurrency in this algorithm, making an implementation on a parallel computer feasible. The second is that it is attractive if we compute the Gallai–Edmonds decomposition (Lovász and Plummer Reference Lovász and Plummer2009), since this decomposition identifies a subgraph that has a perfect matching in any maximum cardinality matching. We can remove this subgraph from further consideration, since all vertices in the subgraph are matched and every maximum cardinality matching has the same weight. Hence we need to run the MVM algorithm only on the residual graph.
The first of these algorithms was designed by Dobrian et al. (Reference Dobrian, Halappanavar, Pothen and Al-Herz2018) and has time complexity
$O(nm)$
. Spencer and Mayr (Reference Spencer and Mayr1984) have designed an exact MVM algorithm with lower
$O(m\sqrt{n}\log n)$
time complexity, which employs recursion to compute the matching. As far as we know, this algorithm has not been implemented, and it is not clear if it is practical.
An important reason for designing the exact algorithm discussed in the previous paragraph is that by restricting the length of the augmenting path to at most three, we may obtain a
$2/3$
-approximation algorithm. This result was first obtained for bipartite graphs by Dobrian et al. (Reference Dobrian, Halappanavar, Pothen and Al-Herz2018). Here one can split the MVM problem into two ‘one-side-weighted’ subproblems. This means given a bipartite graph
$G=(V_{1},V_{2},E)$
in the first subproblem we ignore the weights on
$V_{2}$
, and in the second subproblem we ignore the weights on
$V_{1}$
. The advantage is that now we can find any augmenting path from an unmatched vertex in
$V_{1}$
(
$V_{2}$
) for the first (second) subproblem. The vertices still need to be processed in non-increasing order of weights as in the exact algorithm, and we limit the search for augmenting paths to length at most three. Once the two matchings
$M_{1}$
and
$M_{2}$
are obtained, the Mendelsohn and Dulmage (Reference Mendelsohn and Dulmage1958) theorem can be invoked to find a matching
$M$
in which all the
$V_{1}$
vertices (the weighted vertices) in
$M_{1}$
and the
$V_{2}$
vertices (again the weighted vertices) in
$M_{2}$
are matched. The new matching
$M$
has the same weight as the sum of the matchings
$M_{1}$
and
$M_{2}$
, and it is a
$2/3$
-approximation to the maximum vertex-weighted matching. The time complexity of this algorithm is
$O(m+n\log n)$
, which is linear, except for the sorting step. While this algorithm is easy to state, its proof of correctness is somewhat involved. The proof works by finding, for each vertex that is not matched in the approximation algorithm but matched by the exact algorithm (failed vertices), two matched vertices in the approximate matching that are at least as heavy as the failed vertex.
Al-Herz and Pothen (Reference Al-Herz and Pothen2019) have extended this result to non-bipartite graphs. Here, since there is no bipartition of the vertices, we cannot invoke the Mendelsohn–Dulmage theorem, and new concepts about augmenting paths are needed. The
$2/3$
-approximation algorithm is described in Algorithm 10; it processes vertices in non-increasing order of weights, and matches each vertex if possible to a heaviest unmatched vertex reachable by augmenting paths of length at most three. The time complexity of this algorithm is
$O(m\log \unicode[STIX]{x1D6E5}+n\log n)$
. The proof of the approximation ratio involves charging the weight of each failed vertex to two distinct matched vertices in the approximate matching such that they have equal or higher weight relative to the failure. These vertices are found by examining the augmenting paths in the approximation algorithm, where we distinguish between a vertex from which an augmenting path search begins (an origin), and a vertex where it ends (a terminus).
Al-Herz and Pothen (Reference Al-Herz and Pothen2019) have implemented the
$2/3$
-approximation algorithm for MVM and compare it with an exact maximum edge-weighted matching algorithm in LEDA (Mehlhorn and Näher Reference Mehlhorn and Näher1999), the
$(2/3-\unicode[STIX]{x1D716})$
-approximation algorithms of Maue and Sanders (Reference Maue and Sanders2007), the
$(1-\unicode[STIX]{x1D716})$
-algorithm of Duan and Pettie (Reference Duan and Pettie2014) and a greedy
$1/2$
-approximation algorithm for MVM. The LEDA algorithm benefits from the fractional matching initialization; it is about twelve times faster relative to the LEDA algorithm without any initialization, on problems where both terminated. There are a number of problems where LEDA without initialization did not terminate in four hours. On problems where LEDA with fractional initialization terminated in at most four hours but where the algorithm with no initialization did not, we use the former algorithm as the baseline. The exact MVM algorithm (it does not use any initialization) was slower than the LEDA algorithm by a factor less than two. The
$(1-\unicode[STIX]{x1D716})$
-approximation algorithm with
$\unicode[STIX]{x1D716}=1/3$
was faster than LEDA by a factor of seven for these problems; the
$(2/3-\unicode[STIX]{x1D716})$
-approximation algorithm with a Global Paths Algorithm initialization was about nine times faster; the
$2/3$
-approximate MVM was 140 times faster than LEDA; the
$1/2$
-approximation algorithm for MVM was 400 times faster. There was also a problem (nlpkkt200) where none of the exact algorithms terminated in four hours, but the
$2/3$
-approximate MVM computed a matching in under a minute. In terms of weights, the
$2/3$
-approximate MVM and the
$(2/3-\unicode[STIX]{x1D716})$
-approximate MEM computed more than 99.99% of the maximum weight; the
$(1-\unicode[STIX]{x1D716})$
-approximation algorithm was about 1% off the optimal, and the
$1/2$
-approximate algorithm was 3% off the optimal.
Vertex-weighted matchings have been applied to the design of network switches (Tabatabaee, Georgiadis and Tassiulas Reference Tabatabaee, Georgiadis and Tassiulas2001), and scheduling of astronaut training sessions (Bell Reference Bell1994). More recently, online algorithms for vertex-weighted matchings in bipartite graphs have been surveyed by Mehta (Reference Mehta2012) due to applications in internet advertising. Our interest in this problem was spurred by its application to computing sparse null space and column space bases of sparse, under-determined matrices (Coleman and Pothen Reference Coleman and Pothen1987, Pinar et al. Reference Pinar, Chow and Pothen2006).
6 The edge cover problem
An edge cover in a graph
$G=(V,E)$
is a set of edges
$C$
such that there is at least one edge belonging to
$C$
incident on each vertex in
$V$
. The set of edges
$E$
is a trivial edge cover of the graph
$G$
. We consider the problem of finding an edge cover with minimum cardinality. The following relationship between a maximum matching and a minimum edge cover is due to Gallai (Reference Gallai1959) and Norman and Rabin (Reference Norman and Rabin1959), and is described in Theorems 19.1 and 19.2 of Schrijver (Reference Schrijver2003).
Theorem 6.1. Every maximum cardinality matching of a graph
$G=(V,E)$
is contained in a minimum cardinality edge cover, and every minimum cardinality edge cover contains a maximum cardinality matching. Moreover if we have a maximum cardinality matching in
$G$
, we can find a minimum cardinality edge cover in
$O(m)$
time, and vice versa.
The
$O(m)$
time in the last part of Theorem 6.1 comes from a simple algorithm due to Norman and Rabin (Reference Norman and Rabin1959). Given a maximum cardinality matching, we add the matched edges to the edge cover; additionally we add one of the edges incident on each unmatched vertex to the edge cover. This results in a minimum cardinality edge cover. Further, a minimum cardinality edge cover can be computed in
$O(\sqrt{n}m)$
time, the time needed for a maximum cardinality matching.
Now we consider a weighted graph
$G=(V,E,w)$
, where
$w:E\mapsto \mathbb{R}_{\geq 0}$
is a weight function that maps each edge to a non-negative weight. Recall that the weight of a set
$S$
is the sum of all the weights of the edges in
$S$
. We seek to minimize the weight of an edge cover of
$G$
. In the graph in Figure 3.2, there are two minimum weight edge covers of weight
$15$
: the set of edges
$\{(a,e),(b,f),(c,d)\}$
and
$\{(a,c),(a,e),(b,f),(d,f)\}$
.
The simplest algorithm for computing a minimum weight edge cover selects an edge of minimum weight incident on each vertex and adds it to the cover. This Nearest Neighbour algorithm (and many other algorithms that we consider) does not compute a minimal edge cover; that is, there could be redundant edges that decrease the weight of an edge cover when they are removed, while retaining the property of being an edge cover of the graph. We will show later in the context of the more general
$b$
-edge cover problem that this algorithm computes a 2-approximation to an edge cover of minimum weight, even without the removal of the redundant edges.
Next we describe an approximation-preserving reduction of the minimum weight edge cover problem to the maximum weight matching problem. The reduction is mentioned in Chapter 27 of Schrijver (Reference Schrijver2003), and Huang and Pettie (Reference Huang and Pettie2017) proved that it is approximation-preserving. We proceed to describe this reduction next.
For each vertex
$v\in V$
we define
$\unicode[STIX]{x1D707}(v)$
to be the minimum weight of any edge incident on
$v$
. Now we compute a transformed weight
$w^{\prime }$
for each edge
$e=(u,v)$
as
(Note that we write
$w(u,v)$
instead of
$w((u,v))$
.) Consider how the weight of an edge is transformed under this mapping. There are three cases.
Case 1.
$\unicode[STIX]{x1D707}(u)=\unicode[STIX]{x1D707}(v)=w(u,v)$
. We call such an edge locally subdominant, since this edge is of minimum weight among all of its neighbouring edges. The reader can verify that the transformation does not change the weight of such an edge; thus
$w^{\prime }(u,v)=w(u,v)$
.
Case 2.
$\unicode[STIX]{x1D707}(u)=w((u,v))>\unicode[STIX]{x1D707}(v)$
. The reader can verify that
$w^{\prime }(u,v)=\unicode[STIX]{x1D707}(v)<w(u,v)$
.
Case 3.
$w(u,v)>\unicode[STIX]{x1D707}(v)>\unicode[STIX]{x1D707}(u)$
. It is easily verified that
$w^{\prime }(u,v)<\unicode[STIX]{x1D707}(u)<w(u,v)$
.
The other cases may be obtained from the symmetry of
$u$
and
$v$
. In all cases, we see that the transformed weight of an edge is no larger than the minimum weight among its neighbouring edges.
Assume that we are given a matching
$M$
with the transformed weights on the edges. Define
$V(M)$
to be the set of matched vertices in
$M$
, and let
$e(v)$
denote an edge of minimum weight incident on
$v$
. We can compute an edge cover
$C$
as follows:
Hence the edge cover consists of the matched edges and a set of minimum weight edges incident on the unmatched vertices.
If
$M^{\ast }$
is a maximum weight matching with respect to the weights
$w^{\prime }$
, then the resulting edge cover
$C^{\ast }$
is an edge cover of minimum weight with respect to the weights
$w$
. Furthermore, Huang and Pettie showed that this reduction is approximation-preserving.
Theorem 6.2. Let
$M$
be
$(1-\unicode[STIX]{x1D716})$
-approximate matching obtained with the transformed weights
$w^{\prime }$
from a graph
$G=(V,E,w)$
. Then the edges in
$M$
together with a set of minimum weight edges incident on the unmatched vertices constitute a
$(1+\unicode[STIX]{x1D716})$
-approximate edge cover
$C$
of the graph
$G$
with respect to the original weights
$w$
.
Proof. Let
$C^{\ast }$
denote an optimal edge cover with respect to the weights
$w$
and let
$M^{\ast }$
denote an optimal matching with respect to the weights
$w^{\prime }$
. Since we have shown that
$w^{\prime }(u,v)\leq w(u,v)$
for all edges
$(u,v)$
, we have that
We make use of this result in the following.
From the construction of
$C$
and the definition of
$M$
, we have
$$\begin{eqnarray}\displaystyle w(C) & = & \displaystyle w(M)+\unicode[STIX]{x1D707}(V\setminus V(M))\nonumber\\ \displaystyle & = & \displaystyle \unicode[STIX]{x1D707}(V(M))-w^{\prime }(M)+\unicode[STIX]{x1D707}(V\setminus V(M))\nonumber\\ \displaystyle & = & \displaystyle \unicode[STIX]{x1D707}(V)-w^{\prime }(M).\nonumber\end{eqnarray}$$
Similarly we obtain
Making use of the approximation ratio of the matching algorithm that computed
$M$
, we obtain
$$\begin{eqnarray}\displaystyle w(C) & = & \displaystyle \unicode[STIX]{x1D707}(V)-w^{\prime }(M)\nonumber\\ \displaystyle & \leq & \displaystyle \unicode[STIX]{x1D707}(V)-(1-\unicode[STIX]{x1D716})w^{\prime }(M^{\ast })\nonumber\\ \displaystyle & = & \displaystyle \unicode[STIX]{x1D707}(V)-w^{\prime }(M^{\ast })+\unicode[STIX]{x1D716}\,w^{\prime }(M^{\ast })\nonumber\\ \displaystyle & = & \displaystyle w(C^{\ast })+\unicode[STIX]{x1D716}\,w^{\prime }(M^{\ast })\nonumber\\ \displaystyle & \leq & \displaystyle (1+\unicode[STIX]{x1D716})\,w(C^{\ast }).\nonumber\end{eqnarray}$$
In the third line we used (6.1), and in the fourth line we made use of the inequality from the first paragraph. This completes the proof.◻
We can conclude that the time complexity of computing a minimum weight edge cover is the same as that of computing a maximum weight matching,
$O(mn+n^{2}\log n)$
(Gabow Reference Gabow2018). Furthermore, we can compute an approximate minimum weight edge cover using one of the approximate maximum weight matching algorithms.
We now turn to a reduction of an edge cover to a minimum weight perfect matching problem, described in Schrijver (Reference Schrijver2003). We make a second copy of the graph
$G$
which we call
$G^{\prime }$
. We join each vertex
$v$
in
$G$
with its corresponding vertex
$v^{\prime }$
in
$G^{\prime }$
by an edge with weight set to twice the minimum weight edge incident on
$v$
. We call these latter edges the linking edges. By construction the doubled graph has a perfect matching. Furthermore, we can choose the matched edges in
$G^{\prime }$
to correspond to copies of the matched edges in
$G$
. We replace each linking edge
$(v,v^{\prime })$
in the matching by a minimum weight edge incident on the vertex
$v$
, and add it to the edge cover. To these edges we add the matched edges from
$G$
, to obtain a minimum weight edge cover of
$G$
. This reduction of an edge cover to a perfect matching was modified to compute a prize-collecting variant of the minimum weight edge cover (in which vertices might not be covered by paying a cost) by Azad et al. (Reference Azad, Langguth, Fang, Qi and Pothen2010) to compute a dissimilarity measure for high-dimensional proteomic data.
A third reduction to matching, also mentioned in Schrijver (Reference Schrijver2003), computes
$b^{\prime }(v)=\deg (v)-1$
, and then computes a
$b^{\prime }$
-matching of maximum weight. A minimum weight edge cover is the set of edges complementary to the matching. We will discuss this algorithm in more detail when we consider the
$b$
-edge cover problem. We will also describe some computational results on the edge cover problem after we discuss the latter problem.
7 The
$b$
-edge cover problem
Given a graph
$G=(V,E)$
and a function
$b(v)$
that maps each vertex
$V\in V$
to a natural number, a
$b$
-edge cover is a subset of edges
$C$
such that at least
$b(v)$
edges in
$C$
are incident on
$v$
. We assume that
$b(v)\leq \deg (v)$
. If
$b(v)$
is identically equal to one for all vertices
$v$
, then we have the edge cover problem. If the edges are weighted by a non-negative function
$w(.)$
, then the weight of a
$b$
-edge cover is the sum of weights of the edges in the cover. The problem we consider is to compute a
$b$
-edge cover of minimum weight. Unfortunately the weight transformation approach we used to compute a minimum weight edge cover from a maximum weight matching does not work for
$b$
-edge cover. An exact algorithm for the problem has polynomial time complexity, since it can be computed as the complement of a maximum weight
$b^{\prime }$
-matching, where
$b^{\prime }(v)=\deg (v)-b(v)$
for all
$v\in V$
. We seek to design approximation algorithms that have near-linear time complexity and have more concurrency.
7.1
$b$
-edge cover algorithms
The simplest algorithm that one could think of for the
$b$
-edge cover problem is for each vertex
$v$
to independently choose
$b(v)$
edges to add to the cover. This is the
$b$
-Nearest Neighbour algorithm (bNN) described in Algorithm 11, and we show in Section 7.5 that this leads to a 2-approximation algorithm for the minimum weight
$b$
-edge cover problem.
Practically the weight of the edge cover could be reduced by removing redundant edges. An edge
$(u,v)$
is redundant if there are more than
$b(u)$
edges from the cover incident on
$u$
and there are more than
$b(v)$
edges from the cover incident on
$v$
. We say that such a vertex
$u$
or
$v$
is over-saturated; if there are exactly
$b(u)$
edges incident on a vertex
$u$
it is saturated; and if fewer than
$b(u)$
edges are incident on
$u$
(this can happen only during the computation of an edge cover since it violates the requirements of an edge cover), then it is unsaturated.
The next algorithm one could think of is a greedy algorithm, except that unlike the matching problem, here the weights have to be dynamically updated. This algorithm is inspired by a greedy algorithm for the set multicover problem, in which we are given a collection of subsets of a set, and we are required to choose subsets from the collection so that each element
$v$
in the set is covered
$b(v)$
times. The Greedy algorithm for the set cover problem is described by Chvatal (Reference Chvatal1979). The
$b$
-edge cover problem is a special case of the set multicover problem where the elements in the set correspond to vertices, and subsets to edges, which consist of pairs of vertices.
We define the effective weight of an edge as the weight of the edge divided by the number of its unsaturated endpoints. The Greedy algorithm for minimum weight edge cover works as follows. Initially, no vertices are covered, and the effective weights of all the edges are half of the edge weights. At each iteration the algorithm chooses an edge of minimum effective weight and adds it to the cover. It then decrements the
$b(.)$
values of the endpoints of this edge by one, and updates the effective weights of its neighbouring edges. For the effective weight update, there are three possibilities for each edge: (i) none of its endpoints is saturated, and there is no change in its effective weight, (ii) one of the endpoints is saturated, and its effective weight doubles, or (iii) both endpoints are saturated, its effective weight becomes infinite, and the edge is marked as deleted. The algorithm iterates until all vertices are saturated. The algorithm is described in Algorithm 12.
We can see from an analysis of a Primal Dual algorithm for this problem (provided in Section 7.4) that this algorithm produces an edge cover whose weight is at most
$3/2$
the minimum weight. The worst-case time complexity of the Greedy algorithm is
$O(\unicode[STIX]{x1D6FD}m\log n)$
.
The next algorithm we consider is the Lazy Greedy algorithm. The effective weight of an edge can only increase during the Greedy algorithm, and we exploit this observation to design a faster variant. The idea is to delay updating effective weights of edges, which is the most expensive step in the algorithm, until they are needed. If the edges are maintained in non-increasing order of weights in a heap, then we update the effective weight of only the top edge; if after the update, its effective weight is no larger than the effective weight of the next edge in the heap, then we could add the top edge to the cover as well. A similar property of greedy algorithms has been exploited in submodular optimization, where this algorithm is known as the Lazy Greedy algorithm (Minoux Reference Minoux and Stoer1978). Its time complexity is
$O(m\log n)$
, which is better than the Greedy algorithm, and in practice it performs even better. We refer the reader to Ferdous, Pothen and Khan (Reference Ferdous, Pothen and Khan2018) for more details on this algorithm.
Yet another variant of the Greedy algorithm is the Locally Subdominant Edge (LSE) algorithm. An edge is locally subdominant if it has minimum effective weight among all of its neighbouring edges. The LSE algorithm identifies locally subdominant edges, adds them to the cover, and updates the effective weight of its neighbouring edges. This process iterates until no unsaturated vertices remain. This algorithm was proposed by Khan et al. (Reference Khan, Pothen, Patwary, Halappanavar, Satish, Sundaram and Dubey2016a
), and they proved that it is also a
$3/2$
-approximation algorithm.
We briefly consider an algorithm that obtains a
$b$
-edge cover from the complement of a
$b^{\prime }$
-matching. For each vertex
$v$
, define
$b^{\prime }(v)=\deg (v)-b(v)$
, and then compute a
$b^{\prime }$
-matching of maximum weight. The complement of the matching is a
$b$
-edge cover of minimum weight. What is interesting is that if we use a
$1/2$
-approximation algorithm that matches locally dominant edges such as the Greedy
$b^{\prime }$
-matching algorithm or the
$b^{\prime }$
-Suitor algorithm, then we can show that the resulting
$b$
-edge cover is a 2-approximation to a minimum weight
$b$
-edge cover. This algorithm, called the matching complement edge cover (MCE) algorithm, was designed by Khan et al. (Reference Khan, Pothen and Ferdous2018b
). The MCE algorithm works with static edge weights since it computes a matching, not an edge cover, and hence it has much more concurrency than the other algorithms described thus far except for the
$b$
-Nearest Neighbour algorithm. An important feature of the MCE algorithm is that it computes a maximal
$b^{\prime }$
-matching, and hence the complement is a minimal
$b$
-edge cover, which implies that there are no redundant edges to remove.
There are interesting relationships among the algorithms that have been described in this section. The Greedy, Lazy Greedy and LSE algorithms compute the same
$b$
-edge cover of a graph if (1) ties in weights are broken consistently, and (2) redundant edges are removed greedily. By this we mean that we consider the subgraph induced by the over-saturated vertices, compute a maximum weight matching in this graph, and remove these edges as redundant. These results are obtained in Khan and Pothen (Reference Khan and Pothen2016) and Ferdous, Pothen and Khan (Reference Ferdous, Pothen and Khan2018). The Primal Dual algorithm we describe in the next section will also compute the same
$b$
-edge cover under the two conditions mentioned above. Since we prove that this last algorithm has the approximation ratio
$3/2$
, we can conclude that all the algorithms mentioned in this paragraph have the same approximation ratio.
Finally we discuss the
$(1+\unicode[STIX]{x1D716})$
-approximation algorithm for
$b$
-edge cover designed by Huang and Pettie (Reference Huang and Pettie2017). One way to solve a minimum weight
$b$
-edge cover is to reduce it to a capacitated
$b$
-matching problem and then solve the latter problem (Schrijver Reference Schrijver2003). Unfortunately this reduction is not approximation-preserving. However, the authors show that if a
$b$
-matching is constructed maintaining a certain approximate complementary slackness condition, then the complement graph, a
$b$
-edge cover, would also satisfy an approximate complimentary slackness condition, which results in the desired approximation preservation. They describe a linear time algorithm to find such a
$b$
-matching. This linear time scaling algorithm is a generalization of the approximation algorithm for maximum weight matching designed by Duan and Pettie. As a by-product they also obtain an
$O(m\sqrt{b(V)})$
-time algorithm for the cardinality version of these problems.
7.2 A linear programming formulation
Now we turn to a linear programming formulation of the
$b$
-edge cover problem to describe primal–dual algorithms for the
$b$
-edge cover problem. Using the primal–dual framework, we will describe a
$3/2$
-approximation algorithm, analyse the bNN algorithm and show that it is a 2-approximation algorithm, and describe a
$\unicode[STIX]{x1D6E5}$
-approximation algorithm.
We begin by describing the primal and dual linear programming (LP) formulations of the minimum weight
$b$
-edge cover problem. Recall that we consider a graph
$G=(V,E,w,b)$
, where
$w(.)$
denotes the non-negative weights on the edges, and we need to choose at least
$b(v)$
edges incident on each vertex
$v$
. Recall that a vertex
$v$
is uncovered or unsaturated if a current
$b$
-edge cover has fewer than
$b(v)$
edges in it.
Define a vector
$\mathbf{x}\in \{0,1\}^{m}$
with the intent that
$x(e)=1$
if the edge is in the cover, and
$0$
otherwise. Denote the set of edges incident on a vertex
$v$
by
$\unicode[STIX]{x1D6FF}(v)$
(i.e. the set of edges one of whose endpoints is
$v$
). The integer linear program (ILP) formulation of the minimum weight edge cover problem is as follows:
$$\begin{eqnarray}\displaystyle \text{min}~\mathop{\sum }_{e\in E}w(e)x(e),~\text{subject to}~\mathop{\sum }_{e\in \unicode[STIX]{x1D6FF}(v)}x(e)\geq b(v),~\text{for all}~v\in V, & & \displaystyle \nonumber\\ \displaystyle x(e)\in \{0,1\},~\text{for all}~e\in E. & & \displaystyle\end{eqnarray}$$
The linear programming relaxation of the ILP is obtained by relaxing the binary constraint
$x(e)\in \{0,1\}$
to
$0\leq x(e)\leq 1$
. The relaxation is as follows:
$$\begin{eqnarray}\displaystyle \text{min}~\mathop{\sum }_{e\in E}w(e)x(e),~\text{subject to}~\mathop{\sum }_{e\in \unicode[STIX]{x1D6FF}(v)}x(e)\geq b(v),~\text{for all}~v\in V, & & \displaystyle \nonumber\\ \displaystyle x_{e}\geq 0,~-x(e)\geq -1,~\text{for all}~e\in E. & & \displaystyle\end{eqnarray}$$
The final constraint, equivalent to
$x(e)\leq 1$
, indicates that we may use each edge
$e$
at most once in the cover. Any
$\mathbf{x}$
satisfying the constraints of this linear program is a feasible solution.
To construct the dual program of the relaxed linear program we define a dual variable for each of the constraints. We define two sets of variables, namely
$\mathbf{y}\in \mathbb{R}_{\geq 0}^{n}$
and
$\mathbf{z}\in \mathbb{R}_{\geq 0}^{m}$
. The dual is as follows:
$$\begin{eqnarray}\displaystyle \text{max}~\mathop{\sum }_{v\in V}b(v)y(v)-\mathop{\sum }_{e\in E}z(e), & & \displaystyle \nonumber\\ \displaystyle \text{subject to}~y(i)+y(j)-z(e)\leq w(e),~\text{for all}~e=(i,j)\in E, & & \displaystyle \nonumber\\ \displaystyle y(v),z(e)\geq 0,~\text{for all}~v\in V~\text{and}~e\in E. & & \displaystyle\end{eqnarray}$$
Again, any
$\mathbf{y}$
and
$\mathbf{z}$
satisfying the constraints of the dual program are dual feasible.
For 1-edge cover, the upper bound constraints on the primal variables for the LP relaxation shown in (7.2), i.e.
$x(e)\leq 1$
for all
$e\in E$
, are not necessary. If in the solution there is any
$x(e)>1$
, we can change it to
$x(e)=1$
, producing a feasible solution with a lower objective value. For the
$b$
-edge cover formulation, without the upper bound constraints we cannot guarantee that the relaxation produces a solution in
$[0,1]$
. Consider the dual problem, (7.3). The dual variable corresponding to each upper bound constraint on
$x(e)$
in the primal is
$z(e)$
. These variables serve the same purpose as its counterpart constraints in the primal, by helping the program to choose distinct edges in the cover by providing enough slack to make some of the dual constraints feasible. We will discuss the role of
$z(e)$
variables in our analysis of the algorithm.
Let
$\mathit{EC}^{\,\ast }$
be the objective value of an optimum
$b$
-edge cover solution,
$\mathit{EC}_{\mathit{LP}}$
the objective value of an optimum solution of the relaxed LP shown in (7.2), and
$\mathit{EC}_{\mathit{dual}}$
the objective value of a feasible solution of the dual problem shown in (7.3). Then from linear programming and weak duality theory we have
7.3 Dual fitting algorithms
Now let us assume
$\mathbf{x}$
is a feasible integral solution to the primal linear program, and let
$\mathbf{y}^{\mathbf{a}}$
,
$\mathbf{z}^{\mathbf{a}}$
be the approximate dual solutions to the corresponding dual program. We say these are approximate dual variables as they may not necessarily satisfy the dual constraints.
Suppose we have a hypothetical algorithm that satisfies the following two properties.
Property 7.1 (paid in full).
The algorithm finds these primal and approximate dual variables that maintain the equality of primal and approximate dual objective values, that is,
Property 7.2 (shrinking factor).
Let
$\unicode[STIX]{x1D6FC}>0$
be a constant such that
$\mathbf{y}=\mathbf{y}^{\mathbf{a}}/\unicode[STIX]{x1D6FC}$
and
$\mathbf{z}=\mathbf{z}^{\mathbf{a}}/\unicode[STIX]{x1D6FC}$
become dual feasible variables.
We can prove that this hypothetical algorithm guarantees an
$\unicode[STIX]{x1D6FC}$
-approximation. Replacing
$\mathbf{y}^{\mathbf{a}}$
and
$\mathbf{z}^{\mathbf{a}}$
in (7.5), we have
Since
$\mathbf{y}$
and
$\mathbf{z}$
are dual feasible, from (7.4) and (7.6) we have
This proves the required
$\unicode[STIX]{x1D6FC}$
-approximation guarantee. We now show how to instantiate this hypothetical algorithm to obtain
$3/2$
- and 2-approximation algorithms for
$b$
-edge cover.
7.4 A
$3/2$
-approximation algorithm
Rajagopalan and Vazirani (Reference Rajagopalan and Vazirani1993) have employed dual fitting to design an algorithm for set multicover. The Primal Dual algorithm that we present for
$3/2$
-approximation of
$b$
-edge cover is motivated by this algorithm. It also generalizes a primal–dual edge cover algorithm discussed in Ferdous, Pothen and Khan (Reference Ferdous, Pothen and Khan2018). Our aim is to formulate approximate dual variables such that the two properties mentioned earlier are satisfied. We first define a few concepts and variables required to understand the algorithm and its analysis.
∙ An unsaturated vertex
$v$
is covered by one of its incident edges
$e$
if during the execution of the algorithm
$e$
is selected to cover that vertex. This edge
$e$
is called a covering edge of the vertex
$v$
. Note that after covering a vertex
$v$
by
$e$
it may still be unsaturated. Note also that a
$b$
-edge cover might include edges incident on
$v$
that are not covering edges of
$v$
, since an edge
$(u,v)$
may have been chosen as a covering edge of
$u$
but not
$v$
. We denote by
$S_{v}$
the set of covering edges of
$v$
.∙ In general during the run of the algorithm an edge
$e$
is available if it can cover at least one of its endpoints. We define a set
$Q_{e}$
to denote the endpoints that
$e$
covers, and hence
$0\leq |Q_{e}|\leq 2$
. The set
$C$
includes the edges in the cover.∙ The effective weight of an edge,
$\text{eff}\_\text{weight}(e)$
, is defined as the ratio of the weight of the edge and the number of its unsaturated endpoints. The effective weight of an edge can be thought of as the price the algorithm needs to pay to cover its unsaturated endpoints. Hence we define
$\text{price}(v,e)$
as the effective weight of
$e$
where
$v$
is an unsaturated endpoint of
$e$
. When an edge
$e$
is included in the cover, we fix the
$\text{price}(v,e)$
value(s) of the endpoint(s) it covers.∙ Let
$r(v)$
be a variable defined on each vertex
$v$
. We call it the dynamic requirement of saturation since this variable will let us know whether the vertex
$v$
is already saturated or not. The
$r(v)$
values are initialized to the
$b(v)$
values.∙ We maintain a list
$L(v)$
that consists of
$r(v)$
edges of lowest effective weight incident on a vertex
$v$
. Only these edges will be considered for inclusion in the
$b$
-edge cover. If there are two or more vertices with the
$r(v)$
th lowest effective weight, this list removes the need to process the edges in non-decreasing order of effective weights. Recall that both the effective weights and the values of
$r(v)$
are dynamically changing in the algorithm.
The output of the algorithm is a set of edges
$C$
. We can derive an integral primal solution from
$C$
by setting
$x_{e}=1$
for all
$e\in C$
and
$x_{e}=0$
for all
$e\in E\setminus C$
. We now introduce
$\text{max}\_\text{price}(v)$
, a non-negative variable defined on each vertex
$v$
, which is equivalent to the approximate dual variable
$y^{a}(v)$
. During the execution of the algorithm we set
We create another non-negative variable
$\text{excess}(e)$
equivalent to
$z^{a}(e)$
for each edge
$e$
. Unlike the max_price, the excess variable is not necessary during the run of our algorithm, but it is needed for the proof analysis. Hence we defer its definition till then.
The pseudocode of the algorithm is shown in Algorithm 13. The algorithm iterates until all the vertices become saturated. In each iteration there are two phases: the Price Assignment phase and the Augment Cover phase. The Price Assignment phase computes the
$\text{max}\_\text{price}(v)$
values of each unsaturated vertex. These values are used by the Augment Cover phase to add as many edges to the cover as possible.
We provide the pseudocode for the Price Assignment phase in Algorithm 14.
The second phase of the algorithm, the Augment Cover phase, adds vertices to the edge cover using the max_price information set by the first phase. The pseudo-code for the Augment Cover phase is presented in Algorithm 15. This phase scans the edges to find eligible ones to add in the cover. An edge
$e$
is selected as follows. If the edge
$e=(i,j)$
covers both of its endpoints and if its effective weight is less than or equal to the
$\text{max}\_\text{price}(.)$
values of both of its endpoints, then it would be included in the cover. Upon finding such an edge
$e$
the algorithm fixes the values of
$\text{price}(i,e)$
and
$\text{price}(j,e)$
to the value of
$\text{eff}\_\text{weight}(e)$
. Note that the equation
$\text{price}(i,e)+\text{price}(j,e)=w(e)$
is then satisfied by this edge. On the other hand if the edge
$e$
covers only one endpoint
$u$
, to be included in the cover its effective weight must be less than or equal to the
$\text{max}\_\text{price}(u)$
value. In this case we fix
$\text{price}(u,e)$
to be
$w(e)$
so that the equation
$\text{price}(u,e)=w(e)$
holds. Whenever we add an edge to the cover, we mark it as deleted and update the
$r(v)$
values of its endpoints. (We update both
$r(u)$
and
$r(v)$
when an edge
$(u,v)$
is deleted for identifying redundant edges in a post-processing.)
Once the algorithm terminates, we have settled the
$\text{price}(v,e)$
values for each vertex and covering edge pair. We have also updated
$\text{max}\_\text{price}(v)$
values for each vertex. For each vertex
$v$
there are two kinds of edges incident on
$v$
. One kind is the set of covering edges, which were the edges used to cover vertex
$v$
. The second kind would be other edges incident on
$v$
that were necessary to cover the other endpoint
$w$
of an edge
$(v,w)$
. Let
$S_{v}$
denote the set of covering edges incident on each vertex
$v$
, and note that
$|S_{v}|=b(v)$
. Observe also that when the algorithm terminates, the value of
$\text{max}\_\text{price}(v)=\max \{\text{price}(v,e):e\in S_{v}\}$
.
We have not yet defined how we get the other set of approximate dual variables, i.e. excess. These variables are not necessary for the execution of the algorithm, but they are needed for the proof analysis. We motivate this variable by means of a small example.
A small graph whose
$b$
-edge cover is to be computed.

Example 7.3. Consider the graph with four vertices
$v_{1}$
,
$v_{2}$
,
$v_{3}$
and
$v_{4}$
in Figure 7.1, with the edge labels and weights also shown. The
$b(v)$
value is 2 for each vertex
$v$
except
$v_{4}$
, for which it is 1. The optimal edge cover is the graph itself. We run the Primal Dual algorithm on this problem. First, in the Price Assignment phase, we assign the price values of each vertex and edge pair. Here
$\text{price}(v_{1},e_{1})=\text{price}(v_{2},e_{1})=5$
,
$\text{price}(v_{1},e_{2})=\text{price}(v_{3},e_{2})=10$
,
$\text{price}(v_{2},e_{3})=\text{price}(v_{3},e_{3})=15$
and
$\text{price}(v_{3},e_{4})=\text{price}(v_{4},e_{4})=15$
. The
$\text{max}\_\text{price}(v)$
values are as follows:
$\text{max}\_\text{price}(v_{1})=15$
,
$\text{max}\_\text{price}(v_{2})=10$
,
$\text{max}\_\text{price}(v_{3})=15$
and
$\text{max}\_\text{price}(v_{4})=15$
. In the next phase, suppose we scan through edges in the order
$e_{1}$
,
$e_{2}$
,
$e_{3}$
and
$e_{4}$
. We select
$e_{1}$
since the effective weight of this edge is less than the
$\text{max}\_\text{price}(.)$
values for both endpoints. We decrease the
$r(v_{1})$
and
$r(v_{2})$
values by 1 and mark
$e_{1}$
as deleted. Similarly we select
$e_{2}$
and
$e_{3}$
. Note that
$v_{1}$
,
$v_{2}$
and
$v_{3}$
are saturated. We cannot add
$e_{4}$
in this phase because the effective weight of
$e_{4}$
, which is now 30, is greater than
$\text{max}\_\text{price}(v_{4})$
which is 15. Next we start the second iteration. In the Price Assignment phase, we set
$\text{max}\_\text{price}(v_{4})$
as 30 and in the Augment Cover phase we select
$e_{4}$
, since the effective weight of
$e_{4}$
equals
$\text{max}\_\text{price}(v_{4})$
.
At the termination of the algorithm, the
$\text{max}\_\text{price}$
values for our example are as follows:
$\text{max}\_\text{price}(v_{1})=10$
,
$\text{max}\_\text{price}(v_{2})=15$
,
$\text{max}\_\text{price}(v_{3})=15$
and
$\text{max}\_\text{price}(v_{4})=30$
. Let us consider the dual constraints defined in (7.3). For
$e_{1}$
the left side of the constraint using the approximate duals is
$\text{max}\_\text{price}(v_{1})+\text{max}\_\text{price}(v_{2})-\text{excess}(e_{1})$
. But
$\text{max}\_\text{price}(v_{1})+\text{max}\_\text{price}(v_{2})=25$
, which is much greater than the weight of
$e_{1}$
. So we have a large excess on the summation that we need to balance. This is the purpose of the approximate dual, excess. If an edge
$e$
was not included in a cover we set
$\text{excess}(e)=0$
. If an edge
$e=(i,j)$
covered both of its endpoints when
$e$
was added to the cover, we set
Otherwise if
$e$
covered only one endpoint
$i$
when it was added to the cover, then
We can restate this as
In the example, the excess values of the edges are as follows:
$\text{excess}(e_{1})=(10-5)+(15-5)=15$
,
$\text{excess}(e_{2})=(10-10)+(15-10)=5$
,
$\text{excess}(e_{3})=(15-15)+(15-15)=0$
and
$\text{excess}(e_{4})=30-30=0$
. Observe that all of the dual constraints now become feasible except for
$e_{4}$
, where the left side of the constraint is
$\text{max}\_\text{price}(v_{3})+\text{max}\_\text{price}(v_{4})-\text{excess}(e_{4})=15+30-0=45$
, which is greater than the weight of the edge. We will show that we can scale the approximate duals in such a way that the scaled dual variables always satisfy the constraints.
Lemma 7.4. The approximation ratio of the Primal Dual algorithm is 3/2.
Proof. First note that by construction
$\text{max}\_\text{price}(v)$
is non-negative; since it is the maximum of the price values of incident edges of a vertex,
$\text{excess}(e)$
is also non-negative. We need to show that by setting
$\unicode[STIX]{x1D6FC}=3/2$
, the paid in full and shrinking factor properties defined in Section 7.3 are maintained. Using the approximate duals, max_price and excess, we first show that the objective value of dual LP defined in (7.3) equals the weight of the cover that we get from the algorithm. Let us first consider the right side of the (approximate) dual objective value, i.e.
$\sum _{e\in E}\text{excess}(e)$
. Note that
since
$\text{excess}(e)=0$
if
$e$
is not in the cover. Then we have
$$\begin{eqnarray}\displaystyle \mathop{\sum }_{e\in C}\text{excess}(e) & = & \displaystyle \mathop{\sum }_{e\in C}\mathop{\sum }_{q\in Q_{e}}(\text{max}\_\text{price}(q)-\text{price}(q,e))\nonumber\\ \displaystyle & = & \displaystyle \mathop{\sum }_{e\in C}\mathop{\sum }_{q\in Q_{e}}\text{max}\_\text{price}(q)-\mathop{\sum }_{e\in C}\mathop{\sum }_{q\in Q_{e}}\text{price}(q,e)\nonumber\\ \displaystyle & = & \displaystyle \mathop{\sum }_{v\in V}b(v)\cdot \text{max}\_\text{price}(v)-\mathop{\sum }_{e\in C}w(e).\end{eqnarray}$$
The second term in the last line of (7.8) follows because
$\sum _{q\in Q_{e}}\text{price}(q,e)$
is equal to
$w(e)$
, an invariant we maintain during the execution of Augment Cover phase. For the first term note that a particular vertex
$v\in V$
will appear exactly
$b(v)$
times in the sum.
Replacing
$\sum _{e\in E}\text{excess}(e)$
in the objective value of the dual LP from (7.3),
$$\begin{eqnarray}\displaystyle & & \displaystyle \mathop{\sum }_{v\in V}b(v)\cdot \text{max}\_\text{price}(v)-\mathop{\sum }_{e\in E}\text{excess}(e)\nonumber\\ \displaystyle & & \displaystyle \quad =\mathop{\sum }_{v\in V}b(v)\cdot \text{max}\_\text{price}(v)-\mathop{\sum }_{v\in V}b(v)\cdot \text{max}\_\text{price}(v)+\mathop{\sum }_{e\in C}w(e)\nonumber\\ \displaystyle & & \displaystyle \quad =\mathop{\sum }_{e\in C}w(e).\end{eqnarray}$$
But we cannot substitute max_price for
$\mathbf{y}$
and excess for
$\mathbf{z}$
because these are not dual feasible. Define
$\unicode[STIX]{x1D6FC}\equiv 3/2$
, and set
$\mathbf{y}=$
max_price/
$\unicode[STIX]{x1D6FC}$
and
$\mathbf{z}=$
excess/
$\unicode[STIX]{x1D6FC}$
. We show that the scaled variables
$\mathbf{y}$
and
$\mathbf{z}$
now become feasible. There are two scenarios to consider.
For the first scenario assume that an edge
$e$
belongs to the cover. We have two cases.
Case 1.
$e=(i,j)$
covers both of its endpoints. Then replacing
$y(i)$
,
$y(j)$
and
$z(e)$
, the left side of the first constraint in (7.3),
$$\begin{eqnarray}\displaystyle & & \displaystyle \displaystyle \frac{1}{\unicode[STIX]{x1D6FC}}\cdot (\text{max}\_\text{price}(i)+\text{max}\_\text{price}(j)-(\text{max}\_\text{price}(i)-\text{price}(i,e))\nonumber\\ \displaystyle & & \displaystyle \qquad -\,(\text{max}\_\text{price}(j)-\text{price}(j,e)))\nonumber\\ \displaystyle & & \displaystyle \quad =\displaystyle \frac{1}{\unicode[STIX]{x1D6FC}}(\text{price}(i,e)+\text{price}(j,e))\leq \displaystyle \frac{1}{\unicode[STIX]{x1D6FC}}w(e)\leq w(e).\end{eqnarray}$$
The last line follows from the fact that during the algorithm we maintain
$\text{price}(i,e)+\text{price}(j,e)=w(e)$
.
Case 2. The edge
$e$
covers only one endpoint, say
$i$
. Using the definitions of
$y(i)$
,
$y(j)$
and
$z(e)$
with
$e=(i,j)$
, the left side of the constraint in (7.3) becomes
$$\begin{eqnarray}\displaystyle & & \displaystyle \displaystyle \frac{1}{\unicode[STIX]{x1D6FC}}\cdot (\text{max}\_\text{price}(i)+\text{max}\_\text{price}(j)-(\text{max}\_\text{price}(i)-\text{price}(i,e)))\nonumber\\ \displaystyle & & \displaystyle \quad =\displaystyle \frac{1}{\unicode[STIX]{x1D6FC}}(\text{max}\_\text{price}(j)+\text{price}(i,e)).\end{eqnarray}$$
From the algorithm,
$\text{price}(i,e)=w(e)$
. When vertex
$j$
was saturated, vertex
$i$
was still unsaturated. We have not picked
$e$
as a covering edge for
$j$
. Since
$e$
was in the list of eligible edges
$L(j)$
, the price values of the covering edges incident on
$j$
must be less than or equal to
$w(e)/2$
. Since
$\text{max}\_\text{price}$
of a vertex is the maximum of the price values of the covering edges incident on that vertex,
$\text{max}\_\text{price}(j)\leq w(e)/2$
. So we have
We now consider the second scenario when
$e$
is not part of the
$b$
-edge cover, and
$\text{excess}(e)=0$
. So the left side of the constraint becomes
Without loss of generality assume
$i$
has become saturated first and then
$j$
. This immediately establishes that
$\text{max}\_\text{price}(i)\leq w(e)/2$
and
$\text{max}\_\text{price}(j)\leq w(e)$
. We have
We combine the analysis as follows:
$$\begin{eqnarray}\displaystyle & & \displaystyle \mathop{\sum }_{e\in C}w(e)\nonumber\\ \displaystyle & & \displaystyle \quad =\mathop{\sum }_{v\in V}b(v)\cdot \text{max}\_\text{price}(v)-\mathop{\sum }_{e\in E}\text{excess}(e)\quad \text{(from (7.9))}\nonumber\\ \displaystyle & & \displaystyle \quad =\unicode[STIX]{x1D6FC}\cdot \biggl(\mathop{\sum }_{v\in V}b(v)y(v)-\mathop{\sum }_{e\in E}z(e)\biggr)\quad \text{(replacing max\_price and excess)}\nonumber\\ \displaystyle & & \displaystyle \quad =\unicode[STIX]{x1D6FC}\cdot \mathit{EC}_{\mathit{dual}}\leq \unicode[STIX]{x1D6FC}\cdot \mathit{EC}_{\mathit{LP}}\leq \unicode[STIX]{x1D6FC}\cdot \mathit{EC}^{\,\ast }\quad \text{(from (7.6)).}\nonumber\end{eqnarray}$$
This gives the
$3/2$
-approximation ratio.◻
A tight example for the Primal Dual algorithm.

The approximation ratio is tight, and a tight example is the graph shown in Figure 7.2. Suppose
$b=1$
for each vertex. In the first iteration the Primal Dual algorithm will add
$(v_{1},v_{4})$
to the cover, and it cannot add any other edge. In the second iteration since all the remaining edges have the same effective weight, it may add any one of the edges
$(v_{1},v_{3})$
,
$(v_{1},v_{2})$
or
$(v_{2},v_{3})$
. Suppose it chooses the edge
$(v_{1},v_{3})$
. Then to cover the vertex
$v_{2}$
, it has to choose either
$(v_{1},v_{2})$
or
$(v_{2},v_{3})$
, resulting in a cover with weight
$3w+\unicode[STIX]{x1D716}$
, whereas the optimal weight is
$2w+\unicode[STIX]{x1D716}$
. So as
$\unicode[STIX]{x1D716}\rightarrow 0$
, we get the approximation ratio
$3/2$
.
Next we derive the time complexity of the algorithm. We can do a couple of optimizations on the general algorithm presented in Algorithm 13, which are as follows.
∙ In the Augment Cover phase, when an edge is selected we mark all the neighbouring vertices of its covered endpoints as potential vertices. During the Price Assignment phase we need only update the
$\text{max}\_\text{price}$
values of the potential vertices.∙ In the Price Assignment phase, when the
$\text{max}\_\text{price}$
value changes, we mark all of its incident edges as potential covering edges. In Augment Cover phase we can scan only these edges.
Lemma 7.5. The time complexity of Algorithm 13 is
$O(\unicode[STIX]{x1D6FD}\,\unicode[STIX]{x1D6E5}m)$
.
Proof. Initially all the vertices and edges are marked as potential (see the optimization of the algorithm just mentioned). During the execution of the algorithm a vertex
$v$
can be marked at most
$\deg (v)$
times as potential. Each time it is marked it will have to find an edge incident on it with the
$r(v)$
th minimum effective weight. One can find such an entry in
$O(\unicode[STIX]{x1D6FD}\deg (v))$
time. Summing over all vertices we obtain
$O(\unicode[STIX]{x1D6FD}\,\unicode[STIX]{x1D6E5}m)$
.
Similarly, during the Price Assignment phase, an edge
$e=(i,j)$
can be marked at most
$\deg (i)+\deg (j)=O(\unicode[STIX]{x1D6E5})$
times. Summing over
$m$
edges we obtain
$O(\unicode[STIX]{x1D6E5}m)$
. Hence the time complexity is
$O(\unicode[STIX]{x1D6FD}\,\unicode[STIX]{x1D6E5}m)$
.◻
7.5 A
$2$
-approximation algorithm
We have presented in Algorithm 11 the
$b$
-Nearest Neighbour algorithm for finding a
$b$
-edge cover. It is similar to the popular and well-known
$k$
-nearest neighbour graph construction algorithm, used in many domains including machine learning and data mining to represent data by a sparse graph or to sparsify a graph. The difference between these problems is how the values of
$k$
and
$b$
are defined. In the former case
$k$
is constant for all vertices while the latter case is more general, with the option to set user-defined values of
$b(v)$
for each vertex in the graph. This algorithm, like many other algorithms for the
$b$
-edge cover problem, could have redundant edges in the cover, i.e. edges that could be removed while the residual edges form a
$b$
-edge cover, thus resulting in an edge cover of lower weight. However, even without removing such edges, we can show that this algorithm gives us an approximate solution to the
$b$
-edge cover problem, where the weight of the cover is at most twice the optimal weight. In this section we prove this result using the dual fitting framework developed in Section 7.3.
Lemma 7.6. The approximation ratio of the
$b$
-Nearest Neighbour algorithm is 2.
Proof. Let
$\mathbf{x}$
be the primal integral solution and
$C$
a
$b$
-edge cover computed by the algorithm; hence
$x(e)=1$
if
$e\in C$
, and otherwise
$x(e)=0$
. Let
$S_{v}$
denote the set of the
$b(v)$
lightest edges incident on
$v$
. We define a
$\text{price}$
value for each covering vertex and edge pair, and consider an edge
$e=(i,j)\in C$
. If the weight of the edge
$e$
is among the lightest
$b(i)$
edges incident on the vertex
$i$
and the lightest
$b(j)$
edges incident on
$j$
, then we set
$\text{price}(i,e)=\text{price}(j,e)=w(e)/2$
. In this case we say the edge
$e$
covers both of its endpoints. Otherwise if
$e$
is only among the lightest
$b(i)$
(
$b(j)$
) edges incident on
$i$
(
$j$
), we assign
$\text{price}(i,e)=w(e)$
(
$\text{price}(j,e)=w(e)$
). In this case the edge
$e$
covers only one of its endpoints. Next we set the approximate dual variables. We define for each vertex
$v$
,
$\text{max}\_\text{price}(v)=\max _{e\in S_{v}}\text{price}(v,e)$
. For each edge
$e\in C$
, let
$Q_{e}$
denote its covered endpoints. Note that
$Q_{e}$
may contain one or two vertices. We define for each
$e\in C$
,
$\text{excess}(e)=\sum _{q\in Q_{e}}(\text{max}\_\text{price}(q)-\text{price}(q,e))$
. If an edge
$e$
is not included in the cover then we set
$\text{excess}(e)=0$
. Note that since price values of a vertex and edge pair are always non-negative,
$\text{max}\_\text{price}$
is non-negative. Again, as
$\text{max}\_\text{price}(v)\geq \text{price}(v,e)$
for all
$e\in S_{v}$
, the
$\text{excess}$
variable is also non-negative.
We now show that with
$\unicode[STIX]{x1D6FC}=2$
, the two properties mentioned in Section 7.3 are satisfied by the approximate dual variables
$\mathbf{max\_price}$
and
$\mathbf{excess}$
.
The first property is the equality of primal objective and approximate dual objective functions, and this follows directly from the corresponding proof in the 3/2-approximation algorithm described in Section 7.4.
For the second property, we show that setting
$y(v)=\text{max}\_\text{price}(v)/\unicode[STIX]{x1D6FC}$
and
$z(e)=\text{excess}(\text{e})/\unicode[STIX]{x1D6FC}$
for
$\unicode[STIX]{x1D6FC}=2$
make these dual feasible. We consider two scenarios for an edge
$e\in E$
.
In the first scenario
$e$
belongs to the cover. Then replacing
$y(v)$
and
$z(e)$
on the left side of the first constraint of (7.3), we obtain
$$\begin{eqnarray}\displaystyle y(i)+y(j)-z(e) & = & \displaystyle \displaystyle \frac{1}{\unicode[STIX]{x1D6FC}} (\text{max}\_\text{price}(i)+\text{max}\_\text{price}(j)\nonumber\\ \displaystyle & & \displaystyle -\,\mathop{\sum }_{q\in Q_{e}}(\text{max}\_\text{price}(q)-\text{price}(q,e))).\end{eqnarray}$$
We have two cases to consider.
Case 1. The edge
$e$
covers both of the endpoints, and hence
$Q_{e}=\{i,j\}$
. Recall that in this case
$e$
is among the lightest
$b(i)$
edges incident on
$i$
, and the lightest
$b(j)$
edges incident on
$j$
. The
$\text{price}$
values are then assigned as
$\text{price}(i,e)=\text{price}(j,e)=w(e)/2$
. Simplifying, we obtain
$$\begin{eqnarray}\displaystyle & & \displaystyle y(i)+y(j)-z(e)=\displaystyle \frac{1}{\unicode[STIX]{x1D6FC}} ((\text{max}\_\text{price}(i)+\text{max}\_\text{price}(j))\nonumber\\ \displaystyle & & \displaystyle \quad \qquad -\,(\text{max}\_\text{price}(i)-\text{price}(i,e))-(\text{max}\_\text{price}(j)-\text{price}(j,e)))\nonumber\\ \displaystyle & & \displaystyle \quad =\displaystyle \frac{1}{\unicode[STIX]{x1D6FC}}(\text{price}(i,e)+\text{price}(j,e))\nonumber\\ \displaystyle & & \displaystyle \quad =\displaystyle \frac{1}{\unicode[STIX]{x1D6FC}}(w(e)/2+w(e)/2)\leq w(e).\end{eqnarray}$$
Case 2.
$e$
covers only one endpoint, say
$i$
. In this case we assign
$\text{price}(i,e)=w(e)$
:
$$\begin{eqnarray}\displaystyle y(i)+y(j)-z(e) & = & \displaystyle \displaystyle \frac{1}{\unicode[STIX]{x1D6FC}} (\text{max}\_\text{price}(i)+\text{max}\_\text{price}(j)\nonumber\\ \displaystyle & & \displaystyle \qquad -\,(\text{max}\_\text{price}(i)-\text{price}(i,e))\nonumber\\ \displaystyle & = & \displaystyle \displaystyle \frac{1}{\unicode[STIX]{x1D6FC}}(\text{max}\_\text{price}(j)+\text{price}(i,e))\nonumber\\ \displaystyle & \leq & \displaystyle \displaystyle \frac{1}{\unicode[STIX]{x1D6FC}}(w(e)+w(e))\leq \displaystyle \frac{1}{2}(2w(e))\leq w_{e}.\end{eqnarray}$$
The last line follows because
$\text{max}\_\text{price}(j)\leq w(e)$
, since
$j$
is saturated and
$e$
is not a covering edge for
$j$
.
We now consider the second scenario when
$e$
is not part of the cover. In this case
$\text{excess}(e)=0$
, and the left side of the constraint becomes
Without loss of generality assume
$i$
was saturated first and then
$j$
. This establishes that
$\text{max}\_\text{price}(i)\leq w(e)$
and
$\text{max}\_\text{price}(j)\leq w(e)$
since
$i$
and
$j$
were covered by an edge with lower weight than that of
$e$
. We have
We combine these analyses as follows:
$$\begin{eqnarray}\displaystyle & & \displaystyle \mathop{\sum }_{e\in C}w(e)\nonumber\\ \displaystyle & & \displaystyle \quad =\mathop{\sum }_{v\in V}b_{v}\cdot \text{max}\_\text{price}(v)-\mathop{\sum }_{e\in E}\text{excess}(e)\quad \text{(from (7.9))}\nonumber\\ \displaystyle & & \displaystyle \quad =\unicode[STIX]{x1D6FC}\cdot \biggl(\mathop{\sum }_{v\in V}b(v)y(v)-\mathop{\sum }_{e\in E}z(e)\biggr)\quad \text{(replacing max\_price and excess)}\nonumber\\ \displaystyle & & \displaystyle \quad =\unicode[STIX]{x1D6FC}\cdot \mathit{EC}_{\mathit{dual}}\leq \unicode[STIX]{x1D6FC}\cdot \mathit{EC}_{\mathit{LP}}\leq \unicode[STIX]{x1D6FC}\cdot \mathit{EC}^{\,\ast }\quad \text{(from (7.6)).}\nonumber\end{eqnarray}$$
◻
As in the
$3/2$
-approximation algorithm we can also show the tightness of the approximation ratio of the
$b$
-Nearest Neighbour algorithm. We generate a graph with
$n$
vertices, where
$n$
is odd, as follows. The vertex
$v_{0}$
is connected to all other vertices
$v_{1}\ldots v_{(n-1)}$
. Each vertex
$v_{i}$
for odd
$i>0$
is connected with
$v_{(i+1)}$
. All edges have the same weight
$x$
. We let
$b=1$
for every vertex. An example with
$n=9$
is shown in Figure 7.3.
A tight example for the
$b$
-Nearest Neighbour algorithm.

The optimal edge cover for this example would have weight
$5w$
, consisting of the four edges not incident on
$v_{0}$
and one edge incident on
$v_{0}$
. But the
$b$
-Nearest Neighbour algorithm could produce an edge cover with weight
$8w$
by choosing all edges incident on
$v_{0}$
. For a graph with
$n$
vertices, the optimal weight would be
${\textstyle \frac{1}{2}}(n-1)\ast w+w$
but the
$b$
-Nearest Neighbour algorithm could produce an edge cover with weight
$(n-1)\ast w$
. Thus the approximation ratio is
$(2(n-1))/(n+1)$
, which as
$n\rightarrow \infty$
is 2.
Lemma 7.7. The time complexity of the
$b$
-Nearest Neighbour algorithm is
$O(m\log \unicode[STIX]{x1D6E5})$
.
Proof. We can sort the adjacency list of a vertex
$v$
in
$O(\deg (v)\log (\deg (v)))$
time. Summing over all the vertices we obtain
$O(m\log \unicode[STIX]{x1D6E5})$
.◻
The time complexity can be improved to
$O(m)$
if we use the worst-case linear time selection algorithm as described in Cormen, Leiserson, Rivest and Stein (Reference Cormen, Leiserson, Rivest and Stein2009) to find the
$b_{i}$
th smallest element in the adjacency list of a vertex.
7.6
$\unicode[STIX]{x1D6E5}$
-approximation algorithm
Here we present another algorithm based on linear programming duality for
$b$
-edge cover, with an approximation ratio of
$\unicode[STIX]{x1D6E5}$
, which is larger than the ratios
$3/2$
and
$2$
for the algorithms we have considered thus far. We do this for several reasons. First, the worst-case approximation ratio does not always determine how well an algorithm does practically. Second, the analysis of this algorithm enables us to present a different technique for designing a primal–dual algorithm. This algorithm is derived from an algorithm for set multicover designed by Hall and Hochbaum (Reference Hall and Hochbaum1986), which leads to a better approximation ratio for vertex cover.
Recall that due to weak duality and LP relaxation, the objective value of any feasible solution to the dual problem in (7.3) is a lower bound for the optimum
$b$
-edge cover in (7.1). But in general a dual feasible solution does not guarantee an approximation ratio. However, there exists a particular dual feasible solution, a maximal dual feasible solution, whose objective value provides a bound on the optimum value. A dual feasible solution (denoted
$\bar{\mathbf{y}}$
and
$\bar{\mathbf{z}}$
) is maximal if it satisfies the following three properties.
I There does not exist a feasible solution(
$\mathbf{y},\mathbf{z}$
) with
$y\geq \bar{y}$
,
$z\geq \bar{z}$
and
$$\begin{eqnarray}\mathop{\sum }_{v\in V}b(v)y(v)-\mathop{\sum }_{e\in E}z(e)>\mathop{\sum }_{v\in V}b(v)\bar{y}(v)-\mathop{\sum }_{e\in E}\bar{z}(e).\end{eqnarray}$$
II
$\bar{z}(e)=0$
whenever
$\bar{y}(i)+\bar{y}(j)<w(e)$
.III
$$\begin{eqnarray}\mathop{\sum }_{v\in V}\bar{y}(v)\leq \mathop{\sum }_{v\in V}b(v)\bar{y}(v)-\mathop{\sum }_{e\in E}\bar{z}(e).\end{eqnarray}$$
The proposed algorithm is as follows.
(1) Find a maximal dual feasible solution (
$\bar{\mathbf{y}},\bar{\mathbf{z}}$
).(2) Output the cover
$C=\{e=(i,j)|\bar{y}(i)+\bar{y}(j)-\bar{z}(e)=w(e)\}$
.
We first show that such an algorithm would provide a
$\unicode[STIX]{x1D6E5}$
-approximation.
Lemma 7.8. The algorithm is a
$\unicode[STIX]{x1D6E5}$
-approximation algorithm for
$b$
-edge cover.
Proof. We first establish that
$C$
is a feasible cover. For the sake of contradiction, assume that
$C$
is not a feasible cover; hence there exists a vertex
$v$
that is not covered by at least
$b(v)$
edges. Let
We show that the value of
$\unicode[STIX]{x1D716}$
is well-defined. According to our assumption at most
$b(v)-1$
edges incident on
$v$
are included in
$C$
. Since
$\bar{y}$
and
$\bar{z}$
are dual feasible, there must be at least one edge
$e$
where
$\bar{y}(i)+\bar{y}(j)-\bar{z}(e)<w(e)$
, equivalently
$w(e)-(\bar{y}(i)+\bar{y}(j)-\bar{z}(e))>0$
. We set
$\bar{y}(v)^{\prime }=\bar{y}(v)+\unicode[STIX]{x1D716}$
, and
$\bar{z}(e)^{\prime }=\bar{z}(e)+\unicode[STIX]{x1D716}$
, for edges
$e\in \unicode[STIX]{x1D6FF}(v)$
and
$e\in C$
. The variables(
$\bar{y}^{\prime },\bar{z}^{\prime }$
) are dual feasible. But this contradicts the maximality (property I) of
$\bar{y},\bar{z}$
, since
$\bar{y}^{\prime }$
increases the first term of the dual objective value by at least
$b(v)\unicode[STIX]{x1D716}$
, and
$\bar{z}^{\prime }$
increases the second term by at most
$(b(v)-1)\unicode[STIX]{x1D716}$
, with a net increase of at least
$\unicode[STIX]{x1D716}$
. This establishes that
$C$
is a feasible cover.
Now since
$(\bar{y},\bar{z})$
is a dual feasible solution, the weak duality theorem applies:
Using property III, we obtain
From the construction of the cover we have
$$\begin{eqnarray}\displaystyle \mathop{\sum }_{e\in C}w(e)+\mathop{\sum }_{e\in C}\bar{z}(e) & = & \displaystyle \mathop{\sum }_{e=(i,j)\in C}\bar{y}(i)+\bar{y}(j)\nonumber\\ \displaystyle & = & \displaystyle \mathop{\sum }_{v\in V}\mathop{\sum }_{e\in (\unicode[STIX]{x1D6FF}(v)\cap C)}\bar{y}(v)\nonumber\\ \displaystyle & \leq & \displaystyle \mathop{\sum }_{v\in V}|\unicode[STIX]{x1D6FF}(v)|\bar{y}(v)\nonumber\\ \displaystyle & \leq & \displaystyle \unicode[STIX]{x1D6E5}\mathop{\sum }_{v\in V}\bar{y}(v)\leq \unicode[STIX]{x1D6E5}\cdot \mathit{EC}^{\,\ast }.\end{eqnarray}$$
In the last line we used (7.16). Hence we have established the
$\unicode[STIX]{x1D6E5}$
-approximation ratio for the proposed algorithm.◻
Next our goal is to design an algorithm that produces a maximal feasible dual solution. One such algorithm is shown in Algorithm 16.
The algorithm first initializes the dual variables
$(\mathbf{y},\mathbf{z})$
to zero. For each edge it maintains a variable, the residual weight
$\mathbf{w}^{\prime }$
. This is initialized by the weight of the edge. In each iteration, it picks an unsaturated vertex,
$v$
, and then it finds an adjacent edge
$f$
incident to
$v$
with minimum residual weight. Upon finding the edge
$f$
, it adds
$f$
to the cover, adds
$w^{\prime }(f)$
to
$y(v)$
, and subtracts
$w^{\prime }(f)$
from the residual weights of all edges incident on
$v$
. Note that the iteration in line 6 of the algorithm goes over all edges incident on
$v$
, including
$f$
and other edges that may have been added to the cover in earlier iterations. If the weight of any residual edge (say
$e$
) becomes negative, it subtracts
$w^{\prime }(e)$
from
$z(e)$
(thus the value of
$z(e)$
increases), and sets
$w^{\prime }(e)$
to zero. It then decreases the requirement
$r(v)$
by 1, and marks
$v$
as saturated if
$r(v)=0$
.
The output of the algorithm is the set
$C$
. We now show that the dual vectors derived are maximal and satisfy the three properties.
Claim 7.9. The variables
$\mathbf{y}$
and
$\mathbf{z}$
are non-negative.
Proof. The initial edge weights are non-negative, and the algorithm maintains the residual weight
$w^{\prime }$
to be non-negative. The variable
$y$
is updated by adding
$w^{\prime }$
to it, and
$z(e)$
is updated by subtracting
$w^{\prime }(e)$
when its value is negative, and hence these variables are non-negative as well.◻
Claim 7.10. All edges
$e$
in the cover
$C$
satisfy
$y(i)+y(j)-z(e)=w(e)$
.
Proof. Let
$i$
be a vertex at some iteration of the algorithm and
$f=(i,j)$
be an available edge with minimum residual weight
$w^{\prime }(f)$
. We have
$w^{\prime }(f)\geq 0$
from the previous claim, and then we add
$w^{\prime }(f)$
to
$y(i)$
. In the for loop over edges, we now subtract
$w^{\prime }(f)$
from all edges incident on
$i$
, including the edge
$f$
. Hence
$w^{\prime }(f)$
is set to zero. Every time the weight of an edge is decreased by some amount in the algorithm, it is transferred to the
$y(.)$
-variable of one of its endpoints. Hence at this point in the algorithm,
$y(i)+y(j)-z(e)=w(f)$
, since
$z(f)$
is zero as long as
$w^{\prime }(f)$
is non-negative. In future iterations involving other available edges incident on
$i$
or
$j$
, the invariant
$y(i)+y(j)-z(e)=w(e)$
is maintained by increasing the value of
$z(e)$
.◻
Claim 7.11. The inequality
$y(i)+y(j)-z(e)\leq w(e)$
holds for all
$e\in E\setminus C$
.
Proof. Since
$w^{\prime }(e)\geq 0$
for the edges not in the cover, the two endpoints of such edges have absorbed a weight of at most
$w(e)$
. Note that in this case
$z(e)=0$
.◻
So (
$\mathbf{y},\mathbf{z}$
) is a dual feasible solution, but we need to show that it is also maximal.
Lemma 7.12. The dual vector (
$\mathbf{y},\mathbf{z}$
) of the Dual Feasible algorithm is maximal.
Proof. (I) Each vertex
$v$
is covered by
$b(v)$
edges for which the dual constraints
$y(v)+y(u)-z((v,u)=w(v,u)$
are tight (according to Claim 7.9). Suppose we increase a dual variable
$y(v)$
by a non-negative amount
$\unicode[STIX]{x1D716}$
. Now at least
$b(v)$
constraints (those corresponding to the covering edges of
$v$
) are violated. (We say at least, since if there is an edge incident on
$v$
that is not a covering edge with residual weight less than
$\unicode[STIX]{x1D716}$
, its constraint is also violated.) To compensate for the constraint violations, we need to add
$\unicode[STIX]{x1D716}$
to at least
$b(v)$
elements of
$\mathbf{z}$
. So the increase in objective function is exactly
$b(v)\unicode[STIX]{x1D716}$
while the decrease is at least
$b(v)\unicode[STIX]{x1D716}$
. Hence the objective function value for
$(y,z)$
is not greater than that of
$(\bar{y},\bar{z})$
.
(II) According to the construction, the residual weight
$w^{\prime }(e)\geq 0$
, for all
$e\in E\setminus C$
. That means for such edges
$e$
we have
$y(i)+y(j)\leq w(e)$
. Since
$w^{\prime }(e)\geq 0$
, line 8 of the algorithm will never be satisfied for
$e$
, resulting in
$z(e)=0$
.
(III) Since
$z(e)=0$
, for all
$e\in E\setminus C$
, it suffices to show that
We will prove this using induction on the number of iterations in the algorithm. Let
$y^{(t)}$
and
$z^{(t)}$
denote the variable
$y$
and
$z$
after
$t$
iterations, and let the number of iterations in the algorithm be denoted by
$T$
. We show that the inequality above is true in every iteration:
For
$t=1$
, the left side is zero since the
$w^{\prime }(e)$
values for all the edges are non-negative after the first iteration, and the right side is
$\geq 0$
, since we must have identified an edge incident on a vertex
$v$
with the minimum weight and added its weight to
$y(v)$
. Note that if
$b(v)$
equals 1 the right side is zero, and otherwise it is greater than zero. We inductively assume that the inequality holds for
$t=1,\ldots ,k-1$
.
Denote the vertex selected at the
$k$
th iteration by
$v$
, and let
$f$
be the minimum weight edge incident on
$v$
with weight
$w^{\prime }(f)$
. Then the right-hand side of the displayed equation increases by
$(b(v)-1)w^{\prime }(f)$
. Now this could lead to increase in some
$z(e)^{k}$
, where
$e$
is incident on
$v$
. When
$f$
is included in the cover, there are at most
$(b(v)-1)$
covering edges already incident on the vertex
$v$
. In the current iteration, only the
$z(.)$
values of these edges can increase, and hence the net increase on the left side is at most
$(b(v)-1)w^{\prime }(f)$
. Hence the inequality is preserved at the end of this iteration.◻
We can show a tight example of the
$\unicode[STIX]{x1D6E5}$
-approximation algorithm by considering the graph in Figure 7.3 with different weights as follows. The weights of the edges
$(v_{i},v_{(i+1)})$
, where
$i=1\cdots 7$
, are changed to
$2\unicode[STIX]{x1D716}/\unicode[STIX]{x1D6E5}$
. Other weights remain the same. The maximum degree in this graph is
$n-1$
. Assuming
$b=1$
for every vertex, the optimal cover weight is
$\unicode[STIX]{x1D6E5}/2\ast (2\unicode[STIX]{x1D716}/\unicode[STIX]{x1D6E5})+w=\unicode[STIX]{x1D716}+w$
, whereas if the Dual Feasible algorithm picks the first vertex to be
$v_{0}$
, the weight of the edge cover could be
$\unicode[STIX]{x1D6E5}x$
. Taking the ratio we have
$(\unicode[STIX]{x1D6E5}w)/(\unicode[STIX]{x1D716}+w)$
. As
$\unicode[STIX]{x1D716}\rightarrow 0$
, the ratio approaches
$\unicode[STIX]{x1D6E5}$
.
Lemma 7.13. The time complexity of the Dual Feasible algorithm is
$O(\unicode[STIX]{x1D6FD}\,m)$
.
Proof. A vertex
$v$
can be selected at most
$b(v)$
times. When it is selected it has to find the edge with minimum residual weight, which can be found in
$O(\deg (v))$
time. Summing over all vertices we get
$\sum _{v\in V}b(v)\cdot \deg (v)=O(\unicode[STIX]{x1D6FD}~m)$
.◻
7.7 Computational results
7.7.1 Experimental set-up
All the experiments were conducted on a Purdue community cluster computer called Rice, described in Section 3.3.
Structural properties of our graphs listed in increasing order of edges.

Our test set consists of both real-world and synthetic graphs shown in Table 7.1. We generated two classes of RMAT graphs: (a) G500, representing graphs with skewed degree distributions from the Graph 500 benchmark (Murphy, Wheeler, Barrett and Ang Reference Murphy, Wheeler, Barrett and Ang2010), and (b) SSCA, from the HPCS Scalable Synthetic Compact Applications graph analysis (SSCA#2) benchmark. We used the following parameter settings: (a)
$a=0.57$
,
$b=c=0.19$
and
$d=0.05$
for G500, and (b)
$a=0.6$
and
$b=c=d=0.4/3$
for SSCA. Additionally we consider seven problems taken from the SuiteSparse Matrix Collection (Davis and Hu Reference Davis and Hu2011) covering application areas such as medical science, structural engineering and sensor data. We also have a large web-crawl graph (eu-2015) (Boldi, Marino, Santini and Vigna Reference Boldi, Marino, Santini and Vigna2014) and a movie-interaction network (hollywood-2011) (Boldi and Vigna Reference Boldi and Vigna2004).
All reported results are the average of five runs on graph with random edge weights. For edge cover the uniform random weights are in the range
$[1~100]$
. Since LEDA works only with integer weights, the real-valued weights are then rounded to their nearest integers. For the
$b$
-edge cover experiment, the uniform random weights are chosen from the range
$[1~1000]$
.
7.7.2 Edge cover results
We compare four algorithms: the exact algorithm that computes the minimum weight of an edge cover using the weight transformation described in Section 6, the Nearest Neighbour algorithm (NN), the
$3/2$
-approximation Primal Dual algorithm (PD), and a
$1/2$
-approximate maximum weight matching algorithm that with the approximation-preserving weight transformation obtains a
$3/2$
-approximation minimum weight edge cover (Match). We use LEDA’s maximum weight matching code to compute the maximum matching with transformed weights, and the Suitor algorithm to compute the approximate matching. We removed redundant edges from the edge covers computed by these algorithms.
Comparison of weights of edge covers computed by approximation algorithms with respect to the exact algorithm.

In Table 7.2 we report the minimum weight computed by the exact algorithm, and the distance to optimality of the other algorithms, computed as
$(\text{approx}-\text{opt})/\text{opt}\ast 100$
, where
$\text{opt}$
and
$\text{approx}$
are weights from the optimal and approximation algorithms, respectively. Note that all three algorithms perform much better than their worst-case ratios (
$3/2$
for PD and Match; 2 for the NN algorithm). The Match algorithm is the best performer, followed by PD and then NN.
Relative performance of run times of approximation algorithms with respect to the exact algorithm for edge cover.

In Table 7.3 we compare the run times of the algorithms. We report the time taken by the exact algorithm, and report the relative performance of the approximation algorithms as the ratio of the run time of the exact to that of the approximation algorithm. The larger the relative performance, the faster the algorithm. Note that the NN algorithm is the fastest, followed by the Match algorithm and then the PD algorithm. But the run times of the approximation algorithms are within a factor of two of each other.
7.7.3
$b$
-edge cover results
We do not have an exact algorithm to compare the approximation algorithms against since the weight transformation reduction does not work for
$b$
-edge cover. We compare the Primal Dual algorithm (PD), the Lazy Greedy algorithm (LG) and the
$b$
-Nearest Neighbour algorithm (bNN). Both the PD and LG algorithms are
$3/2$
-approximate and compute the same
$b$
-edge cover, while bNN is 2-approximate. In Table 7.4 we report the weights of the
$b$
-edge covers. We include the weight computed by the original algorithm, and then the weight obtained by removing redundant edges. The last two columns show the percentage difference in weights between the bNN and PD algorithms. The results show that the PD algorithm computes smaller weights for the edge cover. The difference in weights between the two original algorithms can be large, up to 13% for these problems, with a geometric mean of about 5%. However, after removing redundant edges, this difference narrows to at most 3%. This implies that more redundant edges are removed from the bNN algorithm.
Weight of
$b$
-edge covers computed by the Primal Dual algorithm. ‘Increase’ is the percentage of increase in weight of edge covers computed by the
$b$
-Nearest Neighbour algorithm with respect to those from the Primal Dual algorithm.

The run times of the algorithms are plotted in Figure 7.4 as the ratio of the run time of the LG algorithm to the run time of the second algorithm. Values higher than one for an algorithm mean that the algorithm is faster than LG. Note that in geometric mean, the PD algorithm is twice as fast as LG, and the bNN algorithm is about six times as fast as LG.
Relative performance of run times of the Primal Dual and
$b$
-Nearest Neighbour algorithms for
$b$
-edge cover with respect to the Lazy Greedy algorithm.

The
$\unicode[STIX]{x1D6E5}$
-approximation algorithm was implemented by Khan and Pothen (Reference Khan and Pothen2016) and compared with the LSE algorithm, which has an approximation ratio of
$3/2$
. The performance of the latter algorithm was highly sensitive to the order in which the vertices are processed, for both weights and run times. Generally the LSE algorithm computed lower weights and it was also faster.
Several of the approximation algorithms for the
$b$
-edge cover problem have been implemented on parallel computers. The LSE algorithm and the matching complement edge cover (MCE) algorithm have been implemented on shared-memory parallel machines: an IBM Power-8 with 764 cores and an Intel Xeon with 36 cores (Khan et al.
Reference Khan, Pothen and Ferdous2018b
). The Primal Dual
$3/2$
-approximation algorithm has been implemented by us on multiple cores of an Intel Xeon (Ferdous and Pothen, unpublished). The MCE algorithm has also been implemented on 8192 cores of a distributed-memory parallel computer with good speedups (Khan et al.
Reference Khan, Choromanski, Pothen, Ferdous, Halappanavar and Tumeo2018a
), and it has been used to solve the adaptive anonymity problem, which we discuss in the next subsection.
Software for exact (based on the weight transformation to a matching problem) and approximation algorithms for edge cover and
$b$
-edge cover (Greedy, Lazy Greedy,
$b$
-Nearest Neighbour and Primal Dual algorithms) will be included at https://github.com/CSCsw/EdgeCover. Code for the
$b$
-Suitor algorithm from which the MCE
$b$
-edge cover could be computed is available at https://github.com/Exa-Graph.
7.8 Applications of
$b$
-edge cover
A widely used application of
$b$
-edge cover is in computing
$b$
-Nearest Neighbour graphs (bNN graphs) to construct sparse graphs out of noisy data, although practitioners do not seem to know about the relationship of this construction to the
$b$
-edge cover problem. Subramanya and Talukdar (Reference Subramanya and Talukdar2014) provide a recent discussion of the bNN graph construction in semi-supervised machine learning, and compare it with other methods such as
$b$
-matching (Jebara et al.
Reference Jebara, Wang and Chang2009). (In the literature this is called the
$k$
-nearest neighbour graph.) We have shown here that the minimum weight
$b$
-edge cover formulation leads to a more general formulation where we are not constrained to use an identical value of
$b(v)$
for all vertices. This is practically important since choosing
$b(v)$
adaptively, e.g. to be proportional to the degree of
$v$
, could lead to a graph that more faithfully represents the data. Furthermore, linking the
$b$
-nearest neighbour problem to the
$b$
-edge cover problem leads to several
$3/2$
-approximation algorithms, while the bNN graph construction leads to a 2-approximation algorithm. We have also shown that the bNN graph construction leads to the inclusion of many redundant edges, which could be removed to reduce the weight of the edge cover, although the worst-case approximation ratio is not reduced by this technique. Use of the bNN graph construction is seen experimentally to lead to highly skewed degree distributions, since several neighbours of a vertex
$v$
could include it among its nearest neighbours, whereas the other
$b$
-edge cover algorithms provide better control of the degree distribution. This can influence the quality of the classification results obtained in semi-supervised machine learning.
A small example illustrating adaptive anonymity. From top to bottom: original input, dissimilarity matrix (Hamming distances) and anonymized output.

Jebara et al. (Reference Jebara, Wang and Chang2009) have proposed the use of
$b$
-matching to solve this problem, using an exact belief propagation-based algorithm for computing perfect
$b$
-matchings from a complete graph that represents the data. The use of an exact algorithm makes this approach quite expensive relative to using a
$1/2$
-approximation algorithm to compute the
$b$
-matching. Furthermore, working with a complete graph of the data makes the algorithm expensive for large data, whereas with a sparse representation of the data, the
$b$
-edge cover formulation ensures that each vertex
$v$
has at least
$b(v)$
neighbours in the constructed graph (the
$b$
-matching only ensures at most
$b(v)$
neighbours).
We discuss a problem in data privacy, adaptive anonymity, that stimulated our work on the
$b$
-edge cover problem.
Table 7.5 shows a small example to illustrate the adaptive anonymity problem. The top matrix contains binary data measured on six features for six individuals. Each individual is willing to permit their data to be published provided each one is confused with at least one other person in the database. The idea is that a ‘
$\ast$
’ could correspond to a 0 or a 1. The problem is to mask the least number of data items with ‘
$\ast$
’ so that the privacy requirement of every individual is met. The matrix in the middle shows the Hamming distances between pairs of individuals, which is a measure of dissimilarity that indicates in how many entries the data of the two individuals differ. Now we compute a minimum weight 1-edge cover of the complete graph corresponding to the dissimilarity matrix, which includes the edges
$(1,2)$
,
$(3,4)$
and
$(5,6)$
. Finally, we pair individuals using this edge cover, and introduce ‘
$\ast$
’s in the columns where these pairs of individuals differ. Note that the weight of the edge cover is five, and there are ten ‘
$\ast$
’s in the anonymized output matrix that could be published for machine learning purposes.
More formally, in adaptive anonymity, each individual
$v$
expresses a required level of privacy, to be confused with
$b(v)-1$
other individuals. We are given a data set
$X\in \mathbb{Z}^{n\times f}$
, where
$n$
is the number of individuals and
$f$
is the number of features. Each row
$x_{v}\in \mathbb{Z}^{f}$
of
$X$
is a contribution of the individual
$v$
to the data set and consists of
$f$
discrete features. A feature might be race, age, height, weight, income bracket, etc., but not unique identifiers such as social security number. A vector
$\mathbf{b}$
of length
$n$
, where an element
$b(v)$
is a privacy requirement of the
$v$
th individual, is also given. The value
$b(v)$
specifies that the data of the
$v$
th user must be indistinguishable from that of
$b(v)-1$
other users. The output of the algorithm is an anonymized data set
$Y\in (\mathbb{Z}\cup \{\ast \})^{n\times f}$
, where the ‘
$\ast$
’ symbol indicates that a particular feature has been masked.
The adaptive anonymity problem is NP-hard, but Choromanski et al. (Reference Choromanski, Jebara, Tang and Burges2013) proposed an algorithm that finds a good-quality approximate solution. The approximate solution comes from the observation that if we group similar instances together (with respect to their corresponding features) then we need to hide fewer features. The algorithm is a variational optimization method which iterates until some convergence criterion is met or a maximum number of iterations is reached. First, the algorithm creates a complete graph of
$n$
vertices corresponding to instances and a weight multiplier matrix initialized to all ones. Within an iteration, the algorithm assigns the weight of an edge between two vertices based on some dissimilarity measure between the two instances, multiplied by the weight multiplier. Next, the algorithm performs a grouping step based on the current weight assignment, and then the weight multipliers are adjusted based on the grouping. Thus at each iteration one needs to solve the grouping step.
Choromanski et al. (Reference Choromanski, Jebara, Tang and Burges2013) used a perfect
$b$
-matching of minimum weight to group similar instances together. This limited the size of the instances they could solve to a few thousand individuals, since the exact
$b$
-matching algorithm has
$O(b(V)\,m\log n)$
time complexity. Khan et al. (Reference Khan, Choromanski, Pothen, Ferdous, Halappanavar and Tumeo2018a
) have shown that one could instead use a minimum weight
$b$
-edge cover formulation, and then use an approximation algorithm to compute the
$b$
-edge cover. This results in a
$2\unicode[STIX]{x1D6FD}$
-approximation algorithm for minimizing the number of stars in the anonymized data, where
$\unicode[STIX]{x1D6FD}$
is the maximum value of the privacy requirements over individuals. The factor 2 comes from the choice of the algorithm used to compute the
$b$
-edge cover, and it could be reduced to
$3/2$
with the Greedy or the Primal Dual algorithm. These authors computed the
$b$
-edge cover by taking the complement of a
$1/2$
-approximate
$b$
-matching, using the
$b$
-Suitor algorithm. This algorithm was implemented efficiently on shared-memory and distributed-memory parallel computers, to provide the first reported parallel solutions for the adaptive anonymity problem. The work (total number of operations) in the distributed-memory parallel algorithm is
$O(b(V)m)$
, and its depth is
$O(\log \unicode[STIX]{x1D6E5}\log m)$
. This algorithm also reduced the memory required to solve the problem from quadratic to linear in the number of individuals, since for each row in the dissimilarity matrix we need to store only the top
$k(v)$
values (where
$k(v)$
is some multiple of
$b(v)$
) to compute the maximum weight
$b$
-matching. If these do not suffice to obtain the
$b$
-matching, then the elements that had been processed could be discarded, and an additional set of
$k(v)$
elements could be computed. The parallel algorithm solved an anonymity problem involving Medicare/Medicaid physician billing data with more than 700 000 individuals and 500 features on a distributed-memory computer with 8192 cores in four minutes. This represents an increase in problem size by three orders of magnitude over the earlier approaches.
8 Other approximation algorithms in CSC
We discuss two other classical problems in CSC where approximation algorithms have been designed or inapproximability results obtained.
8.1 Graph colouring
The graph colouring problem assigns the fewest colours to the vertices of a graph such that adjacent vertices receive different colours. Formally, we find a function
$c:V\mapsto \mathbb{N}$
such that for every edge
$(u,v)$
we have
$c(u)\neq c(v)$
, and
$c$
uses the minimum number of colours. The chromatic number of a graph
$G$
is the minimum number of colours needed to colour it. Computing the chromatic number of a graph is an NP-hard problem. Furthermore, an inapproximability result due to Feige and Kilian (Reference Feige and Kilian1998) states that for any
$\unicode[STIX]{x1D716}>0$
no polynomial time algorithm can approximate the chromatic number to within a factor of
$n^{1-\unicode[STIX]{x1D716}}$
unless
$P=\mathit{NP}$
.
In CSC, several variants of graph colouring problems are of interest in computing sparse Jacobians and Hessians efficiently. Despite the pessimistic approximability result for colouring, in many contexts in CSC (such as finite element methods for solving partial differential equations) the graphs that need to be coloured are bounded in degree. Any graph can be coloured in at most
$\unicode[STIX]{x1D6E5}+1$
colours, and hence the colouring problem is easy for the class of bounded degree graphs. An even tighter upper bound is the colouring number, which is obtained from an ordering computed by iteratively deleting vertices of minimum degree in the graph, updating degrees, and continuing until the graph is empty. (This is the same algorithm that computes the maximum core of a graph.) The maximum value of the minimum degree observed during this process is the colouring number. By colouring the graph in the reverse order in which the vertices are deleted from the graph, one can colour the graph in this many colours. A more detailed discussion is available in Gebremedhin, Manne and Pothen (Reference Gebremedhin, Manne and Pothen2005).
For Erdős–Rényi graphs with constant average degree, the chromatic number can be precisely computed, and the greedy colouring algorithm can be shown to colour the graph in at most twice this number of colours. Let
$G(n,d/n)$
denote an Erdős–Rényi graph on
$n$
vertices with the probability of an edge equal to
$d/n$
. We say that a property of a random graph on
$n$
vertices
$A_{n}$
holds asymptotically almost surely (a.a.s.) if the probability that
$A_{n}$
is true satisfies
$\mathbb{P}(A_{n})\rightarrow 1$
as
$n\rightarrow \infty$
. Achlioptas and Naor (Reference Achlioptas and Naor2005) proved the following result (see also Kang and McDiarmid Reference Kang, McDiarmid, Wilson and Beineke2015).
Theorem 8.1. Given
$d>0$
, let
$k_{d}$
be the least integer
$k$
for which
$d<2(k-1)\ln (k-1)$
. Then
$\unicode[STIX]{x1D712}(G(n,d/n))$
is
$k_{d}-1$
or
$k_{d}$
a.a.s. If
$d>(2k_{d}-3)\ln (k_{d}-1)$
, then
$\unicode[STIX]{x1D712}(G(n,d/n))=k_{d}$
a.a.s.
A colouring algorithm that finds maximal independent sets and colours them greedily can be shown to use at most twice the number of colours as the chromatic number (McDiarmid Reference McDiarmid1984). This paper discusses why this is simultaneously both a good and a bad result.
Now we turn to what is known about approximation algorithms for some of these colouring problems.
A distance-2 colouring of a graph
$G=(V,E)$
is a colouring such that a vertex receives a colour distinct from any of its neighbours at distance 2 or less. This variant arises in computing Hessians if one does not take into account the symmetry of the graph. McCormick (Reference McCormick1983) described a simple algorithm that computes an
$O(\sqrt{n})$
-approximation to the distance-2 chromatic number. Two other colouring problems that occur in Hessian computation where we need to compute only one among the two elements
$H_{ij}$
or
$H_{ji}$
for
$i\neq j$
, due to the symmetry of the Hessian, are star colouring and acyclic colouring. In star colouring, adjacent vertices receive distinct colours, and also every path on four vertices (
$P_{4}$
) should receive at least three colours. Thus two-coloured subgraphs should be stars. In acyclic colouring, adjacent vertices should receive distinct colours, and every cycle should receive at least three colours. Thus two-coloured subgraphs should be forests.
$\mathit{ZPP}$
is the class of all problems solvable in zero error probabilistic time. Gebremedhin, Tarafdar, Manne and Pothen (Reference Gebremedhin, Tarafdar, Manne and Pothen2007) showed that the star chromatic number and the acyclic chromatic number cannot be approximated to within a factor of
$n^{(1/3-\unicode[STIX]{x1D716})}$
unless
$\mathit{NP}\subseteq \mathit{ZPP}$
.
Bicolouring problems arise when we evaluate a Jacobian matrix using both its rows and columns. In this context, we do not need to evaluate every row and every column, since each non-zero in the Jacobian could be computed from its row or its column. Hence we have a colouring problem in which a vertex
$u$
could be assigned the colour 0 to indicate that
$u$
will not be used to compute any non-zeros in that row or column. The star bicolouring of a bipartite graph
$G=(V_{1},V_{2},E)$
is a function
$c:\{V_{1}\cup V_{2}\}\mapsto \mathbb{N}\cup \{0\}$
such that
(1)
$c(v_{i})\neq c(v_{j})$
if
$(i,j)\in E$
;(2) the set of non-zero colours (set of ‘true’ colours) of
$V_{1}$
is disjoint from the set of non-zero colours of
$V_{2}$
;(3) two vertices
$v_{i}$
and
$v_{k}$
adjacent to a vertex
$v_{j}$
with
$c(v_{j})=0$
receive distinct colours; and(4) every path on four vertices receives at least three colours.
The acyclic bicolouring problem satisfies all the conditions of the star bicolouring problem, except for the last condition, which is replaced with: every cycle receives at least three colours.
Juedes and Jones (Reference Juedes and Jones2012) have designed an approximation algorithm for the star bicolouring problem. The algorithm computes distance-
$2$
independent sets of vertices (from either
$V_{1}$
or
$V_{2}$
) containing a vertex of maximum degree in the current graph using a greedy algorithm, and then assigns them all one colour. The choice of independent sets from
$V_{1}$
or
$V_{2}$
is done based on the maximum degree and ratios of
$|V_{i}|/\unicode[STIX]{x1D6E5}$
. They show that this algorithm has
$O(n^{2/3})$
approximation ratio and that its time complexity is
$O(m^{2}/n^{1/3})$
. Since every star bicolouring is also an acyclic bicolouring, the approximation result holds for the latter problem as well. The authors have also implemented their algorithms, and showed on graphs with several hundred vertices and thousands of edges that the algorithm is competitive in run time with heuristic colouring algorithms that have been designed for star bicolouring.
8.2 Minimizing fill in sparse Cholesky factorization
The minimum fill problem is one of the most basic problems in the area of sparse matrix computations. Given a sparse, symmetric positive definite matrix
$A$
, we wish to permute its rows and columns symmetrically and compute the Cholesky factors of the permuted matrix
where
$P$
is a permutation matrix and
$L$
is the lower triangular Cholesky factor, such that the number of non-zeros in
$L$
are minimized. A fill element is a matrix element
$L_{ij}\neq 0$
such that
$A_{ij}=0$
.
In a graph model, we consider the undirected adjacency graph of
$A$
, and eliminate its vertices one by one. To eliminate a vertex, we add edges to make all of its neighbours a clique, and then delete the vertex and all edges incident on it. The problem is to find an ordering for eliminating the vertices that minimizes the edges added in this process, i.e. the fill edges. This problem was proved to be NP-complete by Yannakakis (Reference Yannakakis1981). It is well known that the graph of the Cholesky factor, the filled graph, is a chordal graph.
Nested dissection, proposed by George (Reference George1973) is a technique for solving this problem using the divide and conquer paradigm. It works by finding a vertex separator that divides the graph into roughly two equal-sized (in terms of vertices) subgraphs. The two subgraphs are ordered first followed by the separator. One recurses on the subgraphs to find separators in the subgraphs, and orders them with this process. For planar graphs there exist separators of size
$O(n^{1/2})$
, and the fill can be bounded by
$O(n\log n)$
; for graphs (finite element meshes) that can be embedded in three dimensions with good aspect ratios, the separator size is
$O(n^{2/3})$
, and the fill is
$O(n^{2})$
. Another heuristic which is widely used is the minimum degree algorithm and its many variants.
Unfortunately we cannot prove how close to optimum the solutions from these heuristic fill reduction algorithms are, although they obtained less fill than an approximation algorithm designed by Agrawal, Klein and Ravi (Reference Agrawal, Klein, Ravi, George, Gilbert and Liu1993) for many matrices. These authors obtained an algorithm with approximation ratio
$O(n^{1/2}\log ^{3.5}n)$
for the total number of edges in the filled graph. (Their objective function was the sum of the number of edges in the original graph and the fill edges.) Natanzon, Shamir and Sharan (Reference Natanzon, Shamir and Sharan2000) obtained an approximation algorithm for minimizing the fill with approximation ratio eight times the minimum fill size. A polynomial time approximation scheme (PTAS) is a polynomial time algorithm that takes a parameter
$\unicode[STIX]{x1D716}>0$
and produces an approximate solution for a minimization problem with approximation ratio
$(1+\unicode[STIX]{x1D716})$
. Recently, Cao and Sandeep (Reference Cao and Sandeep2017) proved that if the problems of minimizing the fill or the total number of edges in the filled graph has a PTAS, then
$P=\mathit{NP}$
.
9 Conclusions
We have surveyed the design and implementation of approximation algorithms for several matching and edge cover problems and their applications in combinatorial scientific computing. Our interest is in algorithms that could be implemented to obtain high performance on modern processor architectures, including serial and parallel computers, both shared-memory and distributed-memory machines. We have viewed approximation as a paradigm for designing parallel algorithms (Khan et al. Reference Khan, Pothen and Ferdous2018b ).
The paradigm of designing approximation algorithms for parallelism has been considered in the theoretical computer science community for vertex and set cover problems by Khuller, Vishkin and Young (Reference Khuller, Vishkin and Young1994), and for facility location, max cut, set cover and low stretch spanning trees, by Blelloch, Peng and Tangwongsan (Reference Blelloch, Peng and Tangwongsan2011) and Tangwongsan (Reference Tangwongsan2011). The idea underlying many of these parallel algorithms is that a greedy algorithm chooses a most cost-effective element in each iteration, and by allowing a slack, a factor of
$(1+\unicode[STIX]{x1D716})$
, more elements can be selected at the cost of a slightly worse approximation ratio. These algorithms have poly-logarithmic depth, and although some of them have linear work requirements, there are few parallel implementations that we know of. Blelloch et al. (Reference Blelloch, Fineman and Shun2012) have computed a maximal cardinality matching (which would be a
$1/2$
-approximate algorithm) in parallel.
For matching problems we have discussed new approximation algorithms for maximum cardinality matching. For edge-weighted matching, we have described
$1/2$
-approximation algorithms that employ different paradigms: greedy, path-growing, and proposals (related to the stable matching problem). We have considered
$(2/3-\unicode[STIX]{x1D716})$
-approximation algorithms for this problem as well. We have discussed
$1/2$
-approximation algorithms for the
$b$
-matching problem, including a matroid-theoretic proof that the greedy algorithm leads to
$1/2$
-approximation. We have also designed
$1/2$
- and
$2/3$
-approximation algorithms for vertex-weighted matching, using techniques that differ from those used for edge-weighted matching. We summarize the matching problems, exact and approximation algorithms to solve them, and their time complexity in Table 9.1.
Some of the exact and approximation algorithms for matching problems and their time complexity.

Some of the exact and approximation algorithms for edge cover problems and their time complexity.

For the minimum weight edge cover problem we have discussed an approximation-preserving reduction to the maximum weight matching problem, leading to both exact and several approximation algorithms. The
$b$
-edge cover problem has a rich collection of approximation algorithms, from the greedy algorithm and variants, and a primal–dual algorithm; these algorithms result in
$3/2$
-approximation. The well-known
$b$
-nearest neighbour graph construction leads to a 2-approximation for this problem, as do greedy-like algorithms that do not compute dynamic effective weights, and an algorithm that computes the complement of a suitable
$1/2$
-approximation matching algorithm. For the
$b$
-edge cover problem, we discussed a primal–dual linear programming framework that helps establish the approximation ratios of several algorithms. We summarize the edge cover problems, exact and approximation algorithms to solve them, and their time complexity in Table 9.2.
We have considered applications of matching to the solution of sparse systems of linear equations and other matrix computations. For the
$b$
-edge cover problem, we have discussed the construction and sparsification of graphs from large, noisy data sets; we have also described the solution of a data privacy problem called adaptive anonymity.
We believe that approximation algorithms represent a fruitful area for progress in designing efficient algorithms for solving problems in CSC, data science, machine learning and other emerging application domains. We expect that the increasing sizes of these problems and the availability of parallel computing resources will demand the development of efficient and concurrent approximation algorithms. We trust that this survey will stimulate further work along these lines.
Acknowledgements
We are grateful to Bora Uçar, ENS Lyon, for his extensive comments on our manuscript. It is a pleasure to thank our colleagues who have collaborated with us on matching and edge cover problems: Arif Khan and Mahantesh Halappanavar, both of Pacific Northwest National Laboratory; Florin Dobrian, Conviva Corporation; Ariful Azad, Indiana University; Ahmed Al-Herz, Purdue University; Johannes Langguth, Simula; Aydin Buluç, Lawrence Berkeley National Laboratory; Mostofa Ali Patwary, NVIDIA; Pradeep Dubey, Intel Corporation; Rob Bisseling, Utrecht University; and Seth Pettie, University of Michigan. We also thank Peter Sanders of the Karlsruhe Institute of Technology and Jens Maue of Zürich for sharing with us their code for the
$(2/3-\unicode[STIX]{x1D716})$
-approximation matching algorithms.





















