A Sublinear Implicit for Maximum Bipartite Matchings

Beate Bollig and Tobias Pr¨oger

TU Dortmund, LS2 Informatik, 44221 Dortmund, Germany

Abstract. The maximum bipartite matching problem is one of the most fundamental algorithmic graph problems, e.g., many resource-allocation problems can be formulated as a maximum matching problem on a bipar- tite graph. Since in some applications graphs become larger and larger, a research branch has emerged which is concerned with the design and analysis of implicit for classical graph problems. Inputs are given as characteristic Boolean functions of the edge sets and problems have to be solved by efficient functional operations. Here, an implicit maximum bipartite matching algorithm is presented that uses only a sublinear number of functional operations with respect to the number of vertices of the input graph. This is the first sublinear implicit algorithm for a problem unknown to be in the NC. The algorithm uses a new sublinear algorithm for the computation of maximal node- disjoint paths. As a by-product a maximal matching algorithm is shown which uses only a ploylogarithmic number of operations.

1 Introduction

Since some modern applications require huge graphs, explicit representations by adjacency matrices or adjacency lists may cause conflicts with memory lim- itations and even polynomial time algorithms are sometimes not fast enough. As time and space resources do not suffice to consider individual vertices and edges, one way out seems to be to deal with sets of vertices and edges rep- resented by their characteristic functions. Ordered binary decision diagrams, denoted OBDDs, introduced by Bryant in 1986 [6], are well suited for the rep- resentation and manipulation of Boolean functions, therefore, a research branch has emerged which is concerned with the design and analysis of so-called im- plicit or symbolic algorithms for classical graph problems on OBDD-represented graph instances (see, e.g., [8, 9], [12], [19], [20, 21], and [24]). Implicit algorithms have to solve problems on a given graph instance by efficient functional opera- tions offered by the OBDD data structure. Representing graphs with regularities by means of data structures smaller than adjacency matrices or adjacency lists seems to be a natural idea but for several graph problems it has been proved that an exponential blow-up from input to output size is possible in the implicit setting ([1]-[4] and [20]). Nevertheless, OBDD-based algorithms are successful in many applications and already in [7] it has been pointed out that worst-case hardness results do not adequately capture the complexity of the problems on real-world instances. In [21,22] it has been shown that a problem can be solved with a polylogarithmic number of functional operations in the implicit setting if and only if the problem is in NC, the complexity class that contains all prob- lems computable in polylogarithmic time with polynomially many processors. As a consequence there cannot exist implicit algorithms with a polylogarithmic number of operations for P -complete problems assuming that P 6= NC.

Due to the problem’s rich area of applications the maximum bipartite match- ing problem has received a considerable amount of attention for explicit graph representations, e.g., many resource-allocation problems can be formulated as a maximum matching problem on a . It is still unknown whether the maximum bipartite matching problem is in NC. For special cases the situ- ation is different, e.g., in [16] an NC algorithm is given for perfect matchings in regular bipartite graphs and in [17] for planar bipartite graphs. In [11] the maximum bipartite matching problem is solved in O(|V |2/3 log3 |E|) time using M(|V |) processors, where M(|V |) is the number of processor needed to compute a matrix product in O(log |V |) time. An interior point based algorithm solves the problem in time O(|E|1/2 log3 |V |) using O(|E|3) processors [10]. Computing maximal matchings in parallel, i.e., a matching that is not a proper subset of another matching, seems to be easier even for general graphs. Using an efficient degree reduction procedure in [15] the first optimal parallel algorithm is pre- sented that runs in time O(log3 |V |) using O((|E| + |V |)/ log3 |V |) processors on bipartite graphs. In the paper we present an implicit algorithm for maximum matchings in bipartite graphs that uses only O(|V |3/4 log5/2 |V |) functional oper- ations. This is the first sublinear implicit algorithm for a problem unknown to be in NC. A main ingredient is an implicit algorithm for the maximal node-disjoint path problem that uses O(|V |1/2 log3 |V |) operations. An important submodule is a maximal bipartite matching algorithm with O(log4 |V |) functional opera- tions.

The paper is organized as follows. In Section 2 we define some notation and review some basics concerning OBDDs, implicit graph representations, and matchings. Furthermore, we extend slightly a result presented by Hopcroft and Karp [13] on the length of shortest augmenting paths with respect to a given matching M which allows us later on to decrease the number of functional op- erations for the computation of maximum bipartite matchings by a factor of O(log1/2 |V |). We start with the description of some implicit algorithms for sim- ple graph problems in Section 3. Section 4 contains an implicit algorithm for the maximal matching problem. Here, we make use of the algorithm presented in [15] but for the implicit setting also new ideas are necessary. Combining a method due to [11] and an improvement due to [14] an implicit algorithm for maximal node-disjoint paths is described in Section 5. The main result is presented in Section 6, an implicit sublinear maximum bipartite matching algorithm. The construction of single augmenting paths shown in [19] for an implicit maximum flow algorithm in 0-1 networks with O(|V | log2 |V |) functional operations is one

2 of the ingredients but we have to add more ideas. Finally, we finish the paper with some concluding remarks.

2 Preliminaries

In order to make the paper self-contained we briefly recall the main notions we are dealing with in this paper.

2.1 Ordered Binary Decision Diagrams When working with Boolean functions as in circuit verification, synthesis, and model checking, ordered binary decision diagrams are a very common dynamic data structure.

Definition 1. Let Xn = {x1,...,xn} be a set of Boolean variables. A variable ordering π on Xn is a permutation on {1,...,n} leading to the ordered list xπ(1),...,xπ(n) of the variables. In the following a variable ordering π is sometimes identified with the corre- sponding ordering xπ(1),...,xπ(n) of the variables if the meaning is clear from the context.

Definition 2. A π-OBDD on Xn is a G = (V, E) whose sinks are labeled by the Boolean constants 0 and 1 and whose non-sink (or de- cision) nodes are labeled by Boolean variables from Xn. Each decision node has two outgoing edges, one labeled by 0 and the other by 1. The edges between deci- sion nodes have to respect the variable ordering π, i.e., if an edge leads from an −1 −1 xi-node to an xj -node, then π (i) ≤ π (j) (xi precedes xj in xπ(1),...,xπ(n)). n Each node v represents a Boolean function fv ∈ Bn, i.e., fv : {0, 1} → {0, 1}, n defined in the following way. In order to evaluate fv(b), b ∈{0, 1} , start at v. After reaching an xi-node choose the outgoing edge with label bi until a sink is reached. The label of this sink defines fv(b). The size of a π-OBDD G is equal to the number of its nodes and the π-OBDD size of a function f is the size of the minimal π-OBDD representing f. The OBDD size of f is the minimum of all π-OBDD(f). Now, we briefly describe a list of important operations on data structures for Boolean functions and the corresponding time and additional space requirements for OBDDs (for a detailed discussion see, e.g., [23]). In the following let f and g be Boolean functions in Bn on the variable set Xn = {x1,...,xn} and Gf and Gg be π-OBDDs for the representations of f and g, respectively. n – Evaluation: Given Gf and an input b ∈{0, 1} , compute f(b). This can be done in time O(n). – Replacements by constants: Given Gf , an index i ∈{1,...,n}, and a Boolean

constant ci ∈ {0, 1}, compute a π-OBDD for the subfunction f|xi=ci . This

can be done in time O(|Gf |) and the π-OBDD for f|xi=ci is not larger than Gf .

3 – Equality test: Given Gf and Gg, decide, whether f and g are equal. This can be done in time O(|Gf | + |Gg|). – Synthesis: Given Gf and Gg and a binary Boolean operation ⊗ ∈ B2, com- pute a π-OBDD Gh for the function h ∈ Bn defined as h := f ⊗ g. This can be done in time and space O(|Gf | · |Gg|) and the size of Gh is bounded above by O(|Gf | · |Gg|). – Quantification: Given Gf , an index i ∈ {1,...,n}, and a quantifier Q ∈ {∃, ∀}, compute a π-OBDD Gh for the function h ∈ Bn defined as h :=

(Qxi)f, where (∃xi)f := f|xi=0 ∨ f|xi=1 and (∀xi)f := f|xi=0 ∧ f|xi=1. The computation of Gh can be realized by two replacements of constants and a 2 synthesis operation. This can be done in time and space O(|Gf | ).

In the rest of the paper quantifications over k Boolean variables (Qx1,...,xk)f are denoted by (Qx)f, where x = (x1,...,xk).

Sometimes it is useful to reverse the edges of a given graph. Therefore, we define the following operation (see, e.g., [20]).

Definition 3. Let ρ be a permutation on {1,...,k} and f ∈ Bkn be defined on Boolean variable vectors x(1),...,x(k) of length n. The argument reordering (1) (k) (ρ(1)) (ρ(k)) Rρ(f) ∈ Bkn with respect to ρ is Rρ(f)(x ,...,x )= f(x ,...,x ).

Given a π-OBDD Gf representing the function f ∈ Bkn a reordering can be done by renaming the variables followed by at most (k − 1)n so-called jump- up operations. A jump-up operation can be realized by two replacements of constants followed by a synthesis step (see, e.g., [5]).

2.2 OBDD-based graph representations and matching problems

n n−1 i In the following for z = (zn−1,...,z0) ∈ {0, 1} let |z| := Pi=0 zi2 . Let G = (V, E) be a graph with N vertices v0,...vN−1. The edge set E can be represented by an OBDD for its characteristic function, where

n χE(x, y)=1 ⇔ (|x|, |y|

Undirected edges are represented by symmetric directed ones. In the rest of the paper we assume that N is a power of 2 since it has no bearing on the essence of our results. Furthermore, we do not distinguish between vertices of the input graph and their Boolean encoding if the meaning is clear from the context. A matching in an undirected graph G = (V, E) is a subset M ⊆ E such that no two edges of M are adjacent. A matching M is maximum if there exists no matching M ′ ⊆ E such that |M ′| > |M|, where |S| denotes the cardinality of a set S. A perfect matching is a matching of cardinality |V |/2. A matching M is maximal if M is not a proper subset of another matching. Given a matching M a vertex v is matched if (v, w) ∈ M for some w ∈ V and free otherwise. An M-augmenting path is a simple path P = v0, v1,...,vℓ such that the endpoints v0 and vℓ are free and an edge (vi, vi+1) is in M, i ∈{0,...,ℓ − 1}, iff i is odd.

4 The length of a path is the number of edges on the path. Given an augmenting path P the matching M can be augmented by deleting from M the edges on P that are from M and adding the remaining edges on the path to M. The absence of an augmenting path implies optimality of the current matching. If a matching M has no augmenting path of length ℓ or less, then |M|≥ (1 − 1/(ℓ + 1))|Mopt|, where Mopt is a maximum matching. A graph G = (V, E) is bipartite if V can be partitioned into two disjoint nonempty sets U and W , such that for all edges (u, w) ∈ E it holds u ∈ U and w ∈ W or vice versa. The following result is a slight extension of results presented in [13]. Due to space limitations we omit the proof.

Proposition 1. Let 0 < c,c′ < 1 be constants, G = (V, E) an undirected graph and Mopt a maximum matching in G, where |Mopt|≥ 2, and M a matching in G, ′ c c where 0 ≤ |M|≤⌊|Mopt|−|Mopt| ·log |Mopt|⌋. If P is a shortest M-augmenting ′ path in G, then |P | < 2(|V |/2)1−c log−c (|V |/2).

In the implicit setting the maximum (maximal) matching problem is the following one. Given an OBDD for the characteristic function of the edge set of an undirected input graph G, the output is an OBDD that represents the characteristic function of a maximum (maximal) matching in G.

3 Some Implicit Algorithms for Simpler Graph Problems

Since sometimes a vertex (or an edge) has to be chosen out of a given set of vertices (or edges), several priority functions Π≺ have been defined in the implicit setting (see, e.g., [12, 19]). We define Π≺(x,y,z) = 1 iff y ≺x z, where ≺x is a total order on the vertex set V and x,y,z vertices in V . In the following we only use a very simple priority function independent of the choice of x, where Π≺(x,y,z) = 1 iff |y| = min(|y|, |z|). It is easy to show that Π≺ can be represented by OBDDs of linear size with respect to variable orderings, where yi and zi are tested one after another for all i ∈{0,...,n − 1}. Already in [19] the algorithm calculateDistanceInformation has been de- scribed for the computation of some distance information with respect to an implicitly defined input graph using O(log2 |V |) functional operations. For two ≤ = vertices x and y and a natural number a the function Patha (x, y) (Patha (x, y), < Patha (x, y)) is 1 iff there exists a path from x to y of length at most (equal to, a a less than) 2 . SPatha(x, y) is 1 if a shortest path from x to y has length 2 . The algorithm findSinglePath has been used very similarly in [19] for the construction of maximum flows in 0-1-networks. The input consists of a natu- ral number l, an implicitly given input graph G, and implicitly defined vertex pairs (x, y) for which a shortest path from x to y in G is l. The output is an implicitly represented path of length l between the vertices of one vertex pair. The algorithm can be computed by O(log2 |V |) functional operations. Now, let S and T be subsets of V . Using O(log2 |V |) functional operations the algorithm findShortestPathEndpoints computes all pairs of vertices (s,t),

5 s ∈ S and t ∈ T , for which there exists a path of length ℓ, where ℓ is a shortest path between a vertex in S and a vertex in T . The length ℓ is also part of the output. Our implicit maximum bipartite matching algorithm enlarges a current match- ing M in a graph G = (V, E) by shortest M-augmenting paths. For this reason we need the edges of all shortest paths from a subset S to another subset T , S,T ⊆ V . The algorithm findShortestPathSuccessor determines these edges by a BFS traversal on the implicitly defined input graph. Therefore, the algo- rithm needs O(ℓ log |V |) functional operations, where ℓ is the minimum length of a path from a vertex in S to a vertex in T . It is well-known that the transitive closure of a graph, i.e., all pairs of ver- tices (u, v) in an input graph G for which there exists a path from u to v, can be computed by O(log2 |V |) functional operations by iterative squaring in the implicit setting.

4 A Maximal Bipartite Matching Algorithm

In this section we present an implicit algorithm for the maximal bipartite match- ing problem. The idea is to use Kelsen’s parallel algorithm for the computation of maximal matchings on explicitly defined input graphs [15] and to adapt it to the implicit setting. In [15] more or less only a high-level structure of the algorithm is presented. Moreover, we have to add more ideas because we cannot access efficiently single vertices or edges in the implicit setting. Using Kelsen’s method for the decomposition of general graphs into a logarithmic number of bi- partite subgraphs our algorithm can be similarly generalized with an additional factor of a logarithmic number of functional operations. The main algorithm findMaximalBipartiteMatching is simple. Step-by- step a current matching is enlarged by computing a matching in G = (V, E) that consists only of the edges that are not incident to the current matching. The key idea is an algorithm match that computes a matching M ′ adjacent to at least |E|/6 edges in G = (V, E). Therefore, after O(log |V |) iterations the current matching is a maximal matching in G. The algorithm match makes use of another algorithm halve that halves ap- proximately the degree of each vertex in a bipartite graph. We briefly sketch the strategy of the algorithm halve that has already been used in [15]. The idea is to compute an Euler partition of the input graph such that the graph is decom- posed into edge-disjoint paths. Each vertex of odd (even) degree is the endpoint of exactly 1 (0) open path. By two-coloring the edges on each path in the Euler partition and deleting all edges of one color the degree of each vertex in the input graph is halved. In [15] a precondition of the algorithm halve is that for each vertex the incident edges have been paired. Here, we present a new algorithm called calculatePairing which computes implicitly a pairing of the edges with O(log2 |V |) functional operations. In the first step the neighbors of each edge are determined. Since almost all edges have two neighbors, every other edge incident to the same vertex is colored red. Afterwards, two edges (x, y), (x, z) are paired

6 iff (x, y) is red. Therefore, each edge has at most one neighbor. The computed pairing is used by halve to define (directed) paths in the (undirected) input graph. An edge (y,z) is a successor edge of an edge (x, y) iff the edges (y,z) and (y, x) are paired according to calculatePairing. Using the successor relation SUCC the undirected input graph is decomposed into directed edge-disjoint paths. Since the pairing is symmetric, (y, x) is also a successor of (z,y). Therefore, for each directed path from a vertex u′ to a vertex u′′ defined by the successor re- lation SUCC, there exists also a directed path from u′′ to u′. This property is important in order to guarantee that a coloring of the directed edges can be used for a unique coloring of the undirected edges in the input graph. For each directed path every other edge is colored red and (u, v) is red iff (v,u) is red. Therefore for each pair of edges computed by calculatePairing exactly one edge is red. By deleting the red edges the degree of each vertex is approximately halved. A crucial step is the choice of the first edge that is colored red on a directed path because all paths are colored simultaneously. For this reason an edge relation called Reachable is used, where REACHABLE(v,w,x,y) is 1 if there exists a directed path from the edge (v, w) to the edge (x, y) defined by the successor relation SUCC. Due to the symmetry of SUCC the relation REACHABLE is also symmetric, i.e., iff REACHABLE(v,w,x,y) = 1 then REACHABLE(y,x,w,v)=1. Therefore, using REACHABLE it is also possible to determine the predecessor of a directed edge. The first red edge on a directed path is the edge with the highest priority: for each directed path the smallest vertex v on the path according to a priority function together with the smallest vertex from all predecessors and successors of v is chosen. Afterwards each edge on a directed path for which the distance to the first red edge on the path is odd is also colored red. The following lemma is an adaption of a result in [15].

Lemma 1. Let d(v) and d′(v) denote the degree of a vertex v in the graph given by χE(x, y) before and after running procedure halve on χE(x, y). Then d′(v) ∈ {⌊d(v)/2⌋, ⌈d(v)/2⌉}.

algorithm findMaximalBipartiteMatching(χE(x, y)) (1) ⊲ Initialize. Start with the empty matching. M(x, y) ← 0 (2) while χE(x, y) 6=0 do (3) ⊲ Compute a matching M ′. ′ M (x, y) ← match(χE(x, y)) (4) ⊲ Delete the edges incident to an edge in M ′. INCNODE(x) ← (∃y)(M ′(x, y)) χE(x, y) ← χE(x, y) ∧ INCNODE(x) (5) ⊲ Add the edges from M ′ to M. M(x, y) ← M(x, y) ∨ M ′(x, y) (6) return M(x, y)

7 algorithm calculatePairing(χE(x, y)) (1) ⊲ Determine which edges are neighbored. ORDER(x,y,z) ← χE(x, y) ∧ χE(x, z) ∧ Π≺(x,y,z)∧ (∃ξ)(χE (x, ξ) ∧ Π≺(x, y, ξ) ∧ Π≺(x,ξ,z)) (2) ⊲ Compute the distance between neighbored edges using iterative squaring. DIST0(x,y,z) ← ORDER(x,y,z) for i =1, 2, ..., log |V | do DISTi(x,y,z) ← (∃ξ)(DISTi−1(x, y, ξ) ∧ DISTi−1(x,ξ,z)) (3) ⊲ Color for each vertex the incident edges alternately. RED(x, y) ← χE(x, y) ∧ (∃ξ)(χE (x, ξ) ∧ Π≺(x,ξ,y)) for i =1, 2, ..., log |V | do RED(x, y) ← RED(x, y) ∨ (∃ξ)(RED(x, ξ) ∧ DISTi(x,ξ,y)) (4) ⊲ Select only pairs ((x, y), (x, z)), where (x, y) is red. PAIRING(x,y,z) ← (ORDER(x,y,z) ∧ RED(x, y)) ∨ (ORDER(x,z,y) ∧ RED(x, z))

algorithm halve(χE(x, y)) (1) ⊲ Compute the successor relation. SUCC(x,y,z) ← PAIRING(y,x,z) (2) ⊲ Compute distance and relations on the directed edges defined by the successor relation. i ← 0;DIST0(v,w,x,y) ← (w = x) ∧ SUCC(v,w,y) REACHABLE(v,w,x,y) ← ((v = x) ∧ (w = y)) ∨ ((w = x) ∧ SUCC(v,w,y)) repeat REACHABLE′(v,w,x,y) ← REACHABLE(v,w,x,y) REACHABLE(v,w,x,y) ← REACHABLE(v,w,x,y)∨ (∃ξ,θ)(REACHABLE(v,w,ξ,θ) ∧ REACHABLE(ξ,θ,x,y)) DISTi(v,w,x,y) ← (∃ξ,θ)(DISTi−1(v,w,ξ,θ) ∧ DISTi−1(ξ,θ,x,y)) i ← i +1 until REACHABLE′(v,w,x,y)= REACHABLE(v,w,x,y) (3) ⊲ On each path, color an appropriate edge of top priority red. RED(x, y) ← χE(x, y) ∧ (∀ξ,θ)(REACHABLE(ξ,θ,x,y) ∨ (ξ = x)∨ Π≺(x, x, ξ))∧ (∀θ, ξ)(REACHABLE(θ,ξ,y,x) ∨ (θ = x) ∨ Π≺(x, x, θ))∧ (∀ξ)(((REACHABLE(x, y, x, ξ) ∧ REACHABLE(y, x, x, ξ)) ∨ Π≺(x, y, ξ)) RED(x, y) ← RED(x, y) ∨ RED(y, x) (4) ⊲ Color the edges alternately. for i =1, 2, ..., 2log |V | do RED(x, y) ← RED(x, y) ∨ (∃ξ,θ)(RED(ξ,θ) ∧ DISTi(ξ,θ,x,y)) (5) ⊲ Delete the red edges. return χE(x, y) ∧ RED(x, y) ∧ RED(y, x)

8 The algorithm halve uses O(log2 |V |) functional operations. Step (2) is the most expensive one. The graph is traversed via iterative squaring. Since the length of a simple path is at most |E|, the number of operations is O(log |E|)= O(log |V |) and the quantification over the Boolean variables that encode an edge can also be done using O(log |V |) operations. The idea for the correctness of match is that a (directed) subgraph P (x, y) of the input χE(x, y) is computed for which each vertex has indegree and outdegree at most 1. It consists only of vertex-disjoint open simple paths and trivial cycles. Therefore, the subgraph can be seen as the union of two matchings. By coloring each path in P (x, y) alternately and removing the edges that are not red, the output consists of a matching. It can be shown that at the beginning at least 1/3 of the edges are incident to vertices incident to edges defined via P (x, y), therefore the output is a matching incident to at least 1/6 of the input edges.

algorithm match(χE(x, y)) (1) ⊲ Initialize. χE′ (x, y) ← χE(x, y); P (x, y) ← 0 (2) while χE′ (x, y) 6=0 do (3) ⊲ Determine the vertices of degree at least 2. TwoOrMoreNeighbors(x) ← (∃y,z)((y 6= z) ∧ χE′ (x, y) ∧ χE′ (x, z))) (4) ⊲ Set P (x, y) = 1 iff y has only one neighbor and is the partner of x. Q(x, y) ← χE′ (x, y) ∧ TwoOrMoreNeighbors(y) ′ Q (x, y) ← Q(x, y) ∧ (∃z)(Q(x, z) ∧ Π≺(x,z,y)) P (x, y) ← Q′(x, y) ∨ (P (x, y) ∧ (∃z)(Q′(x, z))) (5) ⊲ Delete edges incident to vertices of degree 1. χE′ (x, y) ← χE′ (x, y) ∧ TwoOrMoreNeighbors(x)∧ TwoOrMoreNeighbors(y) (6) ⊲ Halve (approximately) the degree of each vertex. calculatePairing(χE′(x, y)); χE′ (x, y) ← halve(χE′ (x, y)) (7) ⊲ Add trivial cycles to the matching M ′. M1(x, y) ← P (x, y) ∧ P (y, x) (8) ⊲ Color the vertices in the graph given by P (x, y) alternately and choose the edges (x, y) iff x is red. RED(x) ← (∀ξ)(P (ξ, x));DIST0(x, y) ← P (x, y) for i =1, 2, ..., log |V | do DISTi(x, y) ← (∃ξ)(DISTi−1(x, ξ) ∧ DISTi−1(ξ,y)) RED(x) ← RED(x) ∨ (∃ξ)(RED(ξ) ∧ DISTi(ξ, x)) M2(x, y) ← P (x, y) ∧ RED(x) (9) return M1(x, y) ∨ M2(x, y) ∨ M2(y, x)

9 5 On a Maximal Node-Disjoint Paths Algorithm

In [11] a parallel algorithm for the computation of maximal node-disjoint paths in a graph G = (V, E) from a set of sources to a set of sinks is presented that runs in time O(|V |1/2 log3 |V |) using O(|V | + |E|) processors for undirected and BFS(|V |, |E|) processors for directed graphs. (BFS(|V |, |E|) is the maximum of |V | + |E| and the number of processors required to find a breath-first search tree in O(log2 |V |) time.) A set of node-disjoint paths P is said to be maximal if each path starts at a distinct source and terminates at a distinct sink, and there is no path from a source to a sink in the graph induced by the vertices which are not on a path in P . Two approaches are used, one approach finds node-disjoint paths as many as possible at the same time. For this a current set of paths is maintained and in each iteration as many paths as possible are extended. The other one finds paths one by one. The idea to obtain a sublinear time algorithm is to balance these two approaches in an appropriate way. In [14] it has been shown that by a better balance factor the algorithm can be further improved by a logarithmic factor with the same number of processors in the undirected case and by a factor of log1/2 |V | otherwise. Choosing the same balance factor |V |1/2 log |V | as in [14] we can transfer the ideas presented in [11] in the implicit setting and obtain the algorithm findMaximalNodeDisjointPaths that uses O(|V |1/2 log3 |V |) functional operations.

6 A Maximum Bipartite Matching Algorithm

Our framework for the implicit computation of maximum bipartite matchings is due to the classical algorithm of Hopcroft and Karp [13] for explicitly defined graphs. Here, G = (V, E) and V is partitioned into the sets U and W . If the length of a shortest augmenting paths is not too large, a set of shortest augment- ing paths is computed, otherwise only a single one is determined. We make use of Proposition1 by choosing 2(|V |/2)1/4/plog(|V |/2) as threshold for the paths length.

algorithm findMaximumBipartiteMatching(χU(x),χW (x),χE (x, y)) (1) ⊲ Initialize. M(x, y) ← 0; χE′ (x, y) ← χE(x, y) ∧ χU (x); F (x) ← 1 (2) repeat (3) ⊲ Compute shortest M-augmenting paths. P (x, y) ← findAugmentingPaths(χU(x),χW (x),χE′ (x, y), F (x)) (4) ⊲ Increase the cardinality of the current matching by the M-augmenting paths. χE′ (x, y) ← (χE′ (x, y) ∧ P (x, y)) ∨ P (y, x) M(x, y) ← (M(x, y) ∧ P (x, y)) ∨ (P (y, x) ∧ χU (y))

10 (5) ⊲ Determine the new free vertices. F (x) ← (∃y)(M(x, y) ∨ M(y, x)) (6) until P (x, y)=0 (7) return M(x, y) ∨ M(y, x)

algorithm findAugmentingPaths(χU(x),χW (x),χE (x, y), F (x))

(1) calculateDistanceInformation(χE(x, y)) (2) S(x) ← F (x) ∧ χU (x); T (x) ← F (x) ∧ χW (x) ∗ (3) (SPE(x, y),l) ← findShortestPathEndpoints(χE(x, y),S(x),T (x),a ) (4) ⊲ If no M-augmenting path exists: STOP. if SPE(x, y)=0 then return 0 (5) ⊲ If the length of a shortest M-augmenting path is at most 2(|V |/2)1/4/plog(|V |/2) a maximal set of shortest M-augmenting paths is computed. else if l ≤ 2(|V |/2)1/4/plog(|V |/2) then (6) S′(x) ← (∃y)(SPE(x, y)); T ′(x) ← (∃y)(SPE(y, x)) ′ ′ (7) SPS(x, y) ← findShortestPathSuccessor(χE(x, y),S (x),T (x)) ′ ′ (8) return findMaximalNodeDisjointPaths(χV (x), SPS(x, y),S (x),T (x)) (9) ⊲ Otherwise a single shortest M-augmenting path is computed. else return findSinglePath(χE(x, y), SPE(x, y),l)

If the length of a shortest augmenting path is at most 2(|V |/2)1/4/plog(|V |/2) the algorithm findAugmentingPaths needs O(|V |1/2 log3 |V |) functional opera- tions. Otherwise the algorithm findSinglePath is executed by O(log2 |V |) op- erations. It is well-known that the length of shortest augmenting paths increases during the execution of the algorithm findMaximumBipartiteMatching. There- fore, using Theorem 1 we can conclude that the algorithm works in two phases. Stage 1 can be realized with O(|V |3/4 log5/2 |V |) functional operations, there are O(|V |1/4 log−1/2 |V |) iterations using O(|V |1/2 log3 |V |) operations for the computation of a set of shortest M-augmenting paths. The second stage needs O(|V |3/4 log1/2 |V |) iterations using O(log2 |V |) functional operations. Starting with a maximal bipartite matching the number of iterations can be reduced. Decreasing the number of functional operations for the computation of a maximal set of shortest augmenting paths with length ℓ to O(ℓ polylog |V |) would lead to a maximum bipartite matching algorithm with O(|V |2/3 polylog |V |) operations. Concluding Remarks In order to investigate the algorithm’s behavior on large and structured networks it has been analyzed on grid graphs [18]. Since the running time for one functional operation on OBDD-represented inputs depends on the sizes of the OBDDs in- volved, not only the number of functional operations has been counted but the

11 overall running time has been determined. It has been shown that maximum bipartite matchings for grid graphs can be computed in O(log3 |V | log log |V |) time and O(log2 |V |) space. Similarly in [19] it has been demonstrated that O(log3 |V |) time and O(log2 |V |) space is sufficient for the computation of max- imum flows in grid graphs where all edges have capacity 1 and in [24] that a topological sorting can be computed in O(log4 |V | log log |V |)) time. References

1. Bollig, B. (2010). Exponential space complexity for OBDD-based reachability analysis. Informa- tion Processing Letters 110, 924-927. 2. Bollig, B. (2010). Exponential space complexity for symbolic maximum flow algorithms in 0-1 networks. Proc. of MFCS, LNCS 6281, 186–197. 3. Bollig, B. (2010). On symbolic OBDD-based algorithms for the minimum spanning tree problem. Proc. of COCOA 2010, LNCS 6509, 16-30. 4. Bollig, B. (2010). On symbolic representations of maximum matchings and (un)directed graphs. Proc. of TCS IFIP AICT 323, 263–300. 5. Bollig, B., L¨obbing, M., and Wegener, I. (1996). On the effect of local changes in the variable ordering of ordered decision diagrams. Information Processing Letters 59, 233–239. 6. Bryant, R. E. (1986). Graph-based algorithms for Boolean function manipulation. IEEE Trans. on Computers 35, 677–691. 7. Feigenbaum, J., Kannan, S., Vardi, M.V., and Viswanathan, M. (1998). Complexity of problems on graphs represented as OBDDs. Proc. of STACS, LNCS 1373, 216–226. 8. Gentilini, R., Piazza, C., and Policriti, A. (2003). Computing strongly connected components in a linear number of symbolic steps. Proc. of SODA, ACM Press, 573–582. 9. Gentilini, R., Piazza, C., and Policriti, A. (2008). Symbolic graphs: linear solutions to connectivity related problems. Algorithmica 50, 120–158. 10. Goldberg, A.V., Plotkin, S.A., Shmoys, D.B., and Tardos, E. (1992). Using interior-point meth- ods for fast parallel algorithms for bipartite matching and related problems. SIAM Journal on Computing 21(1): 140–150. 11. Goldberg, A.V., Plotkin, S.K., and Vaidya, P.M. (1993). Sublinear time parallel algorithms for matching and related problems. Journal of Algorithms 14(2), 180–213. 12. Hachtel, G.D. and Somenzi, F. (1997). A symbolic algorithm for maximum flow in 0−1 networks. Formal Methods in System Design 10: 207–219. 13. Hopcroft, J.E. and Karp, R.M. (1973). An n3/2 algorithm for maximum matchings in bipartite graphs. SIAM Journal on Computing 2(4), 225–231. 14. Iwano, K. (1989). An improvement of Goldberg, Plotkin, and Vaidya’s maximal node-disjoint paths algorithm. Information Processing Letters 32, 25–27. 15. Kelsen, P. (1994). An optimal parallel algorithm for maximal matching. Information Processing Letters 52(4): 223–228. 16. Lev, G.F., Pippenger, N., and Valiant, L.G. (1981). A fast parallel algorithm for routing in permutation networks. IEEE Trans. on Computers 30, 93–100. 17. Miller, G.L. and Naor, J. (1989). Flow in planar graphs with multiple sources and sinks. Proc. of FOCS, 112–117. 18. Pr¨oger, T. (2010). Implizite Graphprobleme f¨ur Matchingprobleme. Diploma thesis, in german. 19. Sawitzki, D. (2004). Implicit flow maximization by iterative squaring. Proc. of SOFSEM, LNCS 2932, 301–313. 20. Sawitzki, D. (2006). Exponential lower bounds on the space complexity of OBDD-based graph algorithms. Proc. of LATIN, LNCS 3887, 781–792. 21. Sawitzki, D. (2006). The complexity of problems on implicitly represented inputs. Proc. of SOFSEM, LNCS 3831, 471–482. 22. Sawitzki, D. (2007). Implicit simulation of FNC algorithms. ECCC Report TR07-028. 23. Wegener, I. (2000). Branching Programs and Binary Decision Diagrams - Theory and Appli- cations. SIAM Monographs on Discrete Mathematics and Applications. 24. Woelfel, P. (2006). Symbolic topological sorting with OBDDs. Journal of Discrete Algorithms 4(1), 51-71.

12 Appendix A: Simple Implicit Graph Algorithms

The following algorithm has already been presented in [19]. The idea is sim- ple, we use iterative squaring to compute some distance information using only O(log2 |V |) functional operations.

algorithm calculateDistanceInformation(χE(x, y)) (1) ⊲ Initialize. ≤ = PATH0 (x, y) ← (x = y) ∨ χE(x, y);PATH0 (x, y) ← χE(x, y) < PATH0 (x, y) ← (x = y);SPATH0(x, y) ← χE(x, y) a ← 0 (2) repeat (3) ⊲ Use iterative squaring to compute the distance information. ≤ ≤ ≤ PATHa+1(x, y) ← (∃z)(PATHa (x, z) ∧ PATHa (z,y)) = = = PATHa+1(x, y) ← (∃z)(PATHa (x, z) ∧ PATHa (z,y)) < ≤ < PATHa+1(x, y) ← (∃z)(PATHa (x, z) ∧ PATHa (z,y)) = < SPATHa+1(x, y) ← PATHa+1(x, y) ∧ PATHa+1(x, y) (4) a ← a +1 ≤ ≤ (5) until PATHa−1(x, y)= PATHa (x, y) (6) a∗ ← a − 1

13 The following algorithm is an adaption of an algorithm already presented in [19] and uses O(log2 |V |) functional operations.

algorithm findSinglePath(χE(x, y), SPE(x, y),l) (1) ⊲ If no start-end vertex pairs exist: STOP. if SPE(x, y)=0 then return 0 (2) ⊲ Subdivide paths for iterative squaring. 1 2 l0 ← l; l0 ← l − 1; t ← 0 1 1 1 2 1 while lt 6=1 do lt+1 ←⌈lt /2⌉; lt+1 ← lt+1 − 1; t ← t +1 (3) ⊲ Compute possible single paths of length l. ∗ ∗ P 1 (x, z) ← χE(x, z); P 2 (x, z) ← (x = z) lt lt for m ← t − 1 downto 0 do 1 if 2|lm then e ← 1; o ← 2 else e ← 2; o ← 1 ∗ ∗ Ple (x,y,z) ← P e (x, y) ∧ P e (y,z) m lm+1 lm+1 ∗ ∗ Plo (x,y,z) ← P e (x, y) ∧ P o (y,z) m lm+1 lm+1 ∗ for a ∈{1, 2} do P a (x, z) ← (∃y)(Pla (x,y,z)) lm m (4) ⊲ Select an appropriate start-end vertex pair. B′(x) ← (∃y)(SPE(x, y)) ′ ′ B(x) ← B (x) ∧ (∃y)(B (y) ∧ Π≺(x, y, x)) D 1 (x, z) ← B(x) ∧ SPE(x, z) ∧ (∃y)(SPE(x, y) ∧ Π (x,y,z) l0 ≺ D 2 (x, z) ← 0 l0 (5) ⊲ Perform the single path construction. for m ← 0 to t − 1 do 1 if 2|lm then e ← 1; o ← 2 else e ← 2; o ← 1 for a ∈{1, 2} do

a a a Qlm (x,y,z) ← Plm (x,y,z) ∧ Dlm (x, z) a a Tlm (x,y,z) ← Qlm (x,y,z)∧ ′ a ′ ′ (∃y )(Qlm (x, y ,z) ∧ Π≺(x, y ,y)) D e (x, z) ← (∃y)(T e (x,z,y) ∨ T e (y,x,z)∨ lm+1 lm lm o Tlm (x,z,y) o o Dlm+1 (x, z) ← (∃y)(Tlm (y,x,z)) (6) return D1(x, z)

14 Using O(log2 |V |) functional operations the following simple algorithm com- putes all pairs of vertices (s,t), s ∈ S and t ∈ T , for which there exists a path of length ℓ, where ℓ is a shortest path between a vertex in S and a vertex in T . The length ℓ is also part of the output. Part of the input is a number a such that ℓ is less than 2a+1.

algorithm findShortestPathEndpoints(χE(x, y),S(x),T (x),a) (1) if a =0 then (2) P (x, y) ← χE(x, y) ∧ S(x) ∧ T (y); return (P (x, y), 1) < (3) else if (PATHa (x, y) ∧ S(x) ∧ T (y)) 6=0 then (4) return findShortestPathEndpoints(χE(x, y),S(x),T (x),a − 1) = (5) else if (PATHa (x, y) ∧ S(x) ∧ T (y)) 6=0 then = a (6) P (x, y) ← PATHa (x, y) ∧ S(x) ∧ T (y); return (P (x, y), 2 ) (7) else ′ (8) S (x) ← (∃y)(S(y) ∧ SPATHa(y, x)) ′ ′ ′ (9) (P (x, y),l ) ← findShortestPathEndpoints(χE (x, y),S (x),T (x),a − 1) ′ ′ a (10) P (x, y) ← S(x) ∧ (∃z)(SPATHa(x, z) ∧ P (z,y)); return (P (x, y),l +2 )

Let S and T be subsets of V and ℓ be the minimum length of a path from a vertex in S to a vertex in T . The algorithm findShortestPathSuccessor computes all edges on paths of length ℓ from a vertex in set S to a vertex in T .

algorithm findShortestPathSuccessor(χE(x, y),S(x),T (x)) (1) SPS(x, y) ← 0;ACTIVE(x) ← T (x);SEEN(x) ← T (x) (2) while (ACTIVE(x) ∧ S(x))=0 do (3) ACTIVE′(x) ← ACTIVE(x) ′ (4) ACTIVE(x) ← SEEN(x) ∧ (∃y)(χE(x, y) ∧ ACTIVE (y)) (5) if ACTIVE(x)=0 then return 0 (6) SEEN(x) ← SEEN(x) ∨ ACTIVE(x) ′ (7) SPS(x, y) ← SPS(x, y) ∨ (ACTIVE(x) ∧ ACTIVE (y) ∧ χE(x, y)) (8) return SPS(x, y)

The algorithm findShortestPathSuccessor needs O(ℓ log |V |) functional operations. The quantification in (4) is the most time-consuming step and costs O(log |V |) operations.

15 Appendix C: The algorithm findMaximalNodeDisjointPaths

The following implicit algorithm is due to an algorithm presented in [11] for explicitly defined graphs with an improved balancing factor shown in [14].

algorithm findMaximalNodeDisjointPaths(χV (x),χE (x, y),S(x),T (x)) (1) ⊲ Initialize. ACTIVE(x) ← S(x);IDLE(x) ← ACTIVE(x);DEAD(x) ← 0 H(x) ← S(x); BelongsToPath(x, y) ← S(x) ∧ (x = y); π(x, y) ← 0 Pa(x) ← S(x); Pc(x) ← 0;PATHS(x, y) ← 0 1/2 (2) ⊲ Stage 1: |Pa| ≥ |V | log |V | 1/2 while |Pa(x)| ≥ |V | log |V | do (3) ⊲ Determine the set H′ of idle adjacent vertices of H. ′ H (x) ← IDLE(x) ∧ (∃y)(H(y) ∧ χE(y, x)) (4) ⊲ Compute the subgraph G′ = (H ∪ H′, (H × H′) ∩ E) and a maximal matching in G′. ′ Subgraph(x, y) ← H(x) ∧ H (y) ∧ χE(x, y) M ′(x, y) ← findMaximalBipartiteMatching(Subgraph(x, y)) NewNodeMatched(x) ← (∃y)(M ′(y, x)) OldNodeNotMatched(x) ← H(x) ∧ (∃y)(M ′(x, y)) (5) ⊲ Compute the new state of the vertices. ACTIVE(x) ← (ACTIVE(x) ∧ OldNodeNotMatched(x)) ∨NewNodeMatched(x) IDLE(x) ← IDLE(x) ∧ NewNodeMatched(x) DEAD(x) ← DEAD(x) ∨ OldNodeNotMatched(x) (6) H(x) ← NewNodeMatched(x) ∨ (∃y)(OldNodeNotMatched(y) ∧ π(x, y)) (7) π(x, y) ← π(x, y) ∨ M ′(x, y) (8) BelongsToPath(x, y) ← (BelongsToPath(x, y)∧OldNodeNotMatched(y)) ∨(∃z)(BelongsToPath(x, z) ∧ M ′(z,y)) (9) ⊲ Determine active and completed paths. Pc(x) ← Pc(x) ∨ (Pa(x) ∧ (∃y)(NewNodeMatched(y) ∧ T (y) ∧BelongsToPath(x, y))) Pa(x) ← Pa(x) ∧ DEAD(x) ∧ Pc(x) (10) ⊲ Determine the used vertices and edges. PATHS(x, y) ← (∃z)(Pc(z) ∧ BelongsToPath(z,y) ∧ π(x, y)) INCNODE(x) ← (∃y)(PATHS(x, y) ∨ PATHS(y, x)) 1/2 (11) ⊲ Stage 2: |Pa| < |V | log |V |. Compute the residual graph. χV ′ (x) ← χV (x) ∧ DEAD(x) ∧ INCNODE(x) χE′ (x, y) ← χE(x, y) ∧ χV ′ (x) ∧ χV ′ (y) ′ S (x) ← S(x) ∧ χV ′ (x) ′ T (x) ← T (x) ∧ χV ′ (x) (12) ⊲ Compute the transitive closure of (V ′, E′). REACHABLE(x, y) ← findTransitiveClosure(χE′ (x, y))

16 (13) ⊲ As long as there exists a path between S′ and T ′, construct a single path and remove the corresponding vertices. while (REACHABLE(x, y) ∧ S′(x) ∧ T ′(y)) do (14) calculateDistanceInformation(χE′(x, y)) ′ ′ ∗ (15) (SPE(x, y),l) ← findShortestPathEndpoints(χE′(x, y),S (x),T (x),a ) ′ (16) P (x, y) ← findSinglePath(χE(x, y), SPE(x, y),l) PATHS(x, y) ← PATHS(x, y) ∨ P (x, y) (17) INCNODE(x) ← (∃y)(P (x, y) ∨ P (y, x)) (18) ⊲ Compute the new residual graph. χV ′ (x) ← χV ′ (x) ∧ INCNODE(x) χE′ (x, y) ← χE′ (x, y) ∧ χV ′ (x) ∧ χV ′ (y) ′ ′ S (x) ← S (x) ∧ χV ′ (x) ′ ′ T (x) ← T (x) ∧ χV ′ (x) (19) ⊲ Compute the transitive closure of (V ′, E′). REACHABLE(x, y) ← findTransitiveClosure(χE′ (x, y)) (20) return PATHS(x, y)

17 Appendix D: Proof of Proposition 1

The results of Hopcroft and Karp [13] imply that

′ c c |M| ⌊|Mopt| − |Mopt| · log |Mopt|⌋ |P |≤ 2⌊ ⌋ +1 ≤ 2⌊ ′ ⌋ +1 c c |Mopt| − |M| |Mopt|−⌊|Mopt| − |Mopt| · log |Mopt|⌋ ′ c c |Mopt|−⌈|Mopt| · log |Mopt|⌉ |Mopt| =2⌊ ′ ⌋ +1=2⌊ ′ − 1⌋ +1. c c c c ⌈|Mopt| · log |Mopt|⌉ ⌈|Mopt| · log |Mopt|⌉

As ⌊x⌋≤ x ≤⌈x⌉ for each x ∈ R, it follows that

x x x ∀x, y ∈ R+ : ⌊ − 1⌋≤ ( − 1) ≤ − 1. ⌈y⌉ ⌈y⌉ y

Due to |Mopt| > 0, we obtain immediately

|Mopt| |P |≤ 2⌊ ′ − 1⌋ +1 c c ⌈|Mopt| · log |Mopt|⌉ ′ ′ 1−c c 1−c c ≤ 2|Mopt| / log |Mopt|− 1 < 2|Mopt| / log |Mopt|.

Obviously, |Mopt| is bounded by |V |/2. To prove the theorem, it is sufficient to show that the function xγ ′ fb,γ,γ (x)= γ′ (logb(x)) is strictly increasing for sufficiently large x ∈ R and constants b,γ,γ′, where b> 1 and 0 <γ,γ′ < 1. For the first derivative, we obtain

′ ′ γ−1 γ γ ′ γ −1 1 ′ γx (logb x) − x · γ (logb x) · x ln b ′ fb,γ,γ (x)= γ′ 2 ((logb x) ) ′ γ−1 γ −1 ′ γ−1 ′ x (logb x) (γ logb x − γ / ln b) x (γ logb x − γ / ln b) = 2γ′ = γ′+1 . (logb x) (logb x)

Thus, it follows that

′ γ−1 ′ ′ fb,γ,γ′ (x)=0 ⇔ x (γ logb x − γ / ln b)=0 ⇔ γ logb x = γ / ln b ′ ′ ′ ′ γ /γ ln b ln b γ /γ ln b γ /γ ⇔ logb x = γ /γ ln b ⇔ x = b = (e ) = e .

18 ′ γ /γ We show that fb,γ,γ′ has a local minimum at xk := e . We obtain the following second derivation:

′ γ−2 ′ γ−1 1 γ +1 ′′ [(γ − 1)x (γ logb x − γ / ln b)+ x (γ · x ln b )](logb x) ′ fb,γ,γ (x)= γ′+1 2 ((logb x) ) ′ γ−1 ′ ′ γ 1 x (γ logb x − γ / ln b)(γ + 1)(logb x) · x ln b − γ′+1 2 ((logb x) ) ′ γ +1 γ−2 ′ (logb x) x ((γ − 1)(γ logb x − γ / ln b)+ γ/ ln b) = 2γ′+2 (logb x) ′ γ γ−2 ′ ′ (logb x) x (γ + 1)(γ logb x − γ / ln b)/ ln b − 2γ′+2 (logb x) ′ (logb x)((γ − 1)(γ logb x − γ / ln b)+ γ/ ln b) = 2−γ γ′+2 x (logb x) ′ ′ (γ + 1)(γ logb x − γ / ln b)/ ln b + 2−γ γ′+2 . x (logb x) As seen above, we have

′ γ /γ ′ ′ logb xk = logb(e )= γ /(γ ln b) ⇔ γ logb xk = γ / ln b ′ ⇔ γ logb xk − γ / ln b =0.

This simplification results in

′ ′′ (logb xk)((γ − 1)(γ logb xk − γ / ln b)+ γ/ ln b) f ′ (xk)= b,γ,γ 2−γ γ′+2 xk (logb xk) (γ′ + 1)(γ log x − γ′/ ln b)/ ln b + b k 2−γ γ′+2 xk (logb xk) (log x )((γ − 1) · 0+ γ/ ln b) + (γ′ + 1) · (0)/ ln b = b k 2−γ γ′+2 xk (logb xk) ′ γ /γ (logb e ) · γ/ ln b γ = γ′/γ 2−γ γ′/γ γ′+2 = γ′/γ 2−γ ′ γ′+1 > 0. (e ) (logb(e )) (e ) (γ /(γ ln b)) ln b The last inequality holds because both the product and the quotient of two positive numbers remain positive. Since b > 1 we also have ln b > 0. Thus, ′ γ /γ xk := e is a local minimum and the function fb,γ,γ′ (x) is strictly increasing ′ for x ∈ (eγ /γ, ∞).

19