In this section we describe the algorithms for maximum orthogonal edge cover. Our 2/3-approximation algorithm runs
time. While the heuristic has the same worst-case complexity, we show in Section *Experiments on simulated datasets* that the running times are faster in practice.

Take a set *S* with a color function

**Definition 2**. *An* orthogonal partition *of set S is a partition* U_{
i
}
*S*
_{
i
} = *S*
*such that for any distinct s*, *r* ∈ *S*
_{
i
}, *c*(*s*) ≠ *c*(*r*).

Take a graph *G = (V, E)* with a color function
. Traditionally, an *edge cover* is a subset *E'* ⊆ *E* such that all vertices are present in at least one edge of *E'*; for this we reserve the term *perfect edge cover*. For our purposes, we relax the definition of "edge cover" to be *any* subset of *E*.

**Definition 3**. *An* edge cover *of G is a subset of E*.

Consider the partition of *V* induced by the connected components of an edge cover.

**Definition 4**. *An* orthogonal edge cover *of a graph G is an edge cover where the induced partition on V (by the "is connected to" relation) is orthogonal*.

A maximum orthogonal edge cover of *G* is an orthogonal edge cover which covers the maximum number of vertices, over all possible orthogonal edge covers.

Let *v*(*E*) denote the vertex set for some edge set *E*. The maximum orthogonal edge cover (MAX-OREC) problem can be stated as follows:

**Input**: Undirected graph *G* = (*V*, *E*) and color function
.

**Solution**: An orthogonal edge cover *E'* ⊆ *E* (*i.e*. for each connected component *C* of *G*' = (*V*, *E'*) we have *c*(*s*) ≠ *c*(*r*) for all distinct *s, r* ∈ *C*).

**Measure**: The number of vertices covered (*i.e*. |*v*(*E'*)|)

We present a 2/3-approximation algorithm for MAX-OREC. Our approach is to first compute edges that cover the maximum number of vertices for each color, while ignoring the orthogonality constraint. We then show that the connected components of this edge cover have a particular structure, allowing us to ensure orthogonality without removing too many edges.

### Bipartite matchings

Consider the bipartite graph *B*(*x*) = (*U*, *W*, *F*) where *U* is the subset of *V* with color *x*, *W* = *V \U*, and *F* consists of the edges that span *U* and *W* (*i.e*. *U* = {*v* : *v ∈V*, *c*(*v*) = *x*} and *F =* {(*u*, *w*) : (*u*, *w*) ∈ *E*, *u* ∈ *U*, *w* ∈ *W*}). The following property on orthogonal edge covers holds.

**Property 2**. *A maximum matching M(x) on B(x) covers the maximum (over any edge cover) number of vertices of color x, without breaking the orthogonality constraint*.

Now take a maximum orthogonal edge cover *Q**, and an edge cover consisting of all the edges from all the bipartite matchings R = ∪_{i}
*M*(*i*). The following is a direct consequence of Property 2.

**Lemma 1**. |*v*(*Q*
*****)| ≤ |*v*(*R*)|.

If every connected component of *H* = (*V*, *R*) has an orthogonal edge cover, then |*v*(*R*)| = |*v*(*Q**)|. We show in the next section that, while we can not always find an orthogonal edge cover for every component, we can always find an edge cover that includes at least 2/3rds of the vertices in the component.

### Covering bounded degree graphs

Consider the neighborhood of a particular vertex *v* from *H* = (*V*, *R*) with color *x*. Any vertex in the neighborhood of *v* with color *y* is a result of the matching *M*(*x*) or *M*(*y*). Thus, there are at most two vertices of color *y* connected to *v*. We call a graph with this property *2-neighborhood-limited* (2NL). We use the fact that *H* is 2NL to show that we can find an orthogonal edge cover that includes at least 2/3rds of the maximum number of possible vertices.

Call a path in a component *alternating* if vertices in the path alternate between two colors. The *length* of a path is the number of vertices in the path. Then we have the following two lemmas.

**Lemma 2**. *A connected 2NL graph G that contains no odd-length alternating path has a perfect orthogonal edge cover*.

*Proof*. Any even-length alternating path can be covered by taking every other edge on the path (a perfect matching). Consider the graph *G' = (V, E')* where *E'* is *E* without the edges that are removed from perfect matchings on even-length alternating paths. Note that this graph has no alternating paths and that the degree of all vertices is at least one.

Take a minimal edge cover *C' ⊆ E'* that covers all the vertices of *V*. *C*' is composed only of stars (every component has no simple path of length greater than two), otherwise it would not be minimal. Since no edge of *C'* links two vertices corresponding to the same color and there exists no alternating paths in *G'*, the edge cover *C'* must be orthogonal. □

**Lemma 3**. *Each odd-length alternating path can contribute to at most one uncovered vertex in a maximum orthogonal edge cover*.

*Proof*. Every other edge on an odd-length alternating path can be matched, leaving a single vertex uncovered. □

Lemmata 2 and 3 imply the following algorithm for finding an approximate orthogonal edge cover on a 2NL graph where *maximumMatching(H')* returns a maximum matching on *H'* and *minPerfectEdgeCover(H")* returns a minimal perfect edge cover for each component of *H"* that has more than one vertex (*i.e*. a perfect edge cover where removing any edge will result in an uncovered vertex). The correctness of the algorithm follows the same reasoning as the proof of Lemma 2.

**Algorithm 1** getMAX-2NL-OREC(*H* = (*V*, *R*))

*P* = {the set of edges in alternating paths of *H*}

*H' = (v(P), P)*

*E" = maximumMatching(H')* ∪ *(R\P)*

*H" = (V, E")*

**return**
*minPerfectEdgeCover(H")*

### Bringing things together

Say Algorithm 1 returns an edge cover *Q* for a 2NL graph while an optimal edge cover is *Q**. Then the following is a direct consequence of Lemmata 2 and 3.

**Lemma 4**. |*v*(*Q*)| > |*v*(*Q**)| - *p where p is the number of odd-length paths in a 2NL graph*.

So counting the number of odd-length paths gives us an idea of how far we could be from the optimal. Since the shortest possible odd-length path has three vertices, and two of them can be covered, we get the desired approximation guarantee.

**Lemma 5.**

Now, using Section *Bipartite matchings* along with Algorithm 1, we can use Algorithm 2 to approximate the MAX-OREC problem where *M*(*x*) is the maximum bipartite matching between the vertices with color *x* and all the other vertices. Say Algorithm 2 returns an edge cover *O* while an optimal edge cover is *O*
*. Then the following are a direct consequence of Lemmata 1, 4 and 5.

**Theorem 1**. |*v*(*O*)| > |*v*(*O*
*****)| **-**
*p*
*where p is the number of odd-length paths in a graph*.

**Theorem 2.**

**Algorithm 2** getMAX-OREC(*G*)

*R* ← Ø

**for** each color *x* in *G*
**do**

*R* ← *R* ∪ *M*(*x*)

**end for**

*O* ← Ø

**for** each component *C* of *H* = (*V*, *R*) **do**

*O* ← *O* ∪ getMAX-2NL-OREC(*C*)

**end for**

**return**
*O*

### A fast heuristic

We also developed a practical algorithm for MAX-OREC. It is simpler to implement and runs faster in practice and performs better on dense graphs (see Section

*Experiments on simulated datasets*). The algorithm does the following:

- 1.
compute *H*, the union over all maximum bipartite matchings for every pair of colors, and then

- 2.
compute *minPerfectEdgeCover*(*H*).

Note that the main difference with the approximation algorithm is that we do not compute the same maximum bipartite matchings.