Satisfiability Algorithm for Syntactic Read-k-times Branching Programs

The satisfiability of a given branching program is to determine whether there exists a consistent path from the root to 1-sink. In a syntactic read-k-times branching program, each variable appears at most k times in any path from the root to a sink. In a preliminary version of this paper, we provide a satisfiability algorithm for syntactic read-k-times branching programs with n variables and m edges that runs in time Opoly(n,mk2)⋅2(1−4−k−1)n\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$O\left (\text {poly}(n, m^{k^{2}})\cdot 2^{(1-4^{-k-1})n}\right )$\end{document}. In this paper, we improve the bounds for k = 2. More precisely, we show that the satisfiability of syntactic read-twice branching programs can be solved in time Opoly(n,m)⋅25n/6\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$O\left (\text {poly}(n, m)\cdot 2^{5n/6}\right )$\end{document}. Our algorithm is based on the decomposition technique shown by Borodin, Razborov and Smolensky [Computational Complexity, 1993].


Introduction
Branching programs (BPs) are well studied computation models in theory and practice.A BP is a directed acyclic graph with a unique root node and two sink nodes.Each nonsink node is labeled using a variable, and the edges correspond to a variable's value of zero or one.Sink nodes are labeled either 0 or 1 depending on the output value.A BP computes a Boolean function naturally: it follows the edge corresponding to the input value from the root node to a sink node.Given a BP, its satisfiability (BP SAT) involves the determination of whether there exists a consistent path from the root to 1-sink.Recently, BP SAT has become a significant problem because of the connection between satisfiability algorithms and lower bounds.Let C be a class of a circuit.Given a circuit in C, C-SAT is the determination of whether there exists an assignment to the input variables such that the circuit outputs 1. Williams [26] showed that to obtain NEXP ⊆ C, it suffices to develop an O 2 n−ω(log n) time algorithm for C-SAT.Barrignton [3] showed that any function in NC 1 can be computed using width-5 BPs of polynomial length.By combining these results, if we would like to prove NEXP ⊆ NC 1 , it is sufficient to develop an O 2 n−ω(log n) time algorithm for width-5 BP SAT.In addition, the hardness of BP SAT implies the hardness of the Edit Distance and Longest Common Sequence problem [1].Thus, the designing of a fast algorithm for BP SAT is one of the important tasks in the field of computational complexity.
For the SAT of some restricted BPs, polynomial or moderately exponential time algorithms are known.An ordered binary decision diagram (OBDD) is a BP that has the same order of variables in all paths from the root to any sink.By checking the reachability from the root to 1-sink, the OBDD SAT can be solved in polynomial time.A k-OBDD is a natural extension of an OBDD with k layers; all layers are OBDDs with the same order of variables.Bollig, Sauerhoff, Sieling, and Wegener [6] provided a polynomial time algorithm that solves the k-OBDD SAT for any constant k.A k-indexed binary decision diagram (k-IBDD) is the same as a k-OBDD, except that an OBDD in each layer may have a different order of variables.A k-IBDD SAT is known to be NP-complete when k ≥ 2 [6].Nagao, Seto, and Teruyama [18] proposed a satisfiability algorithm for any instances of k-IBDD SAT with cn edges, and its running time is O 2 Chen, Kabanets, Kolokolova, Shaltiel, and Zuckerman [10] showed that general BP SAT with o(n 2 ) nodes can be determined in time O 2 n−ω(log n) .However, there are not so much researches on BP SAT.
In this paper, we focus on syntactic read-k-times BPs.There exist two models of read-ktimes BPs: semantic and syntactic.A read-k-times BP is syntactic if each variable appears at most k times in any path.It is semantic if each variable appears at most k times in any "computational" path.The semantic model is substantially stronger than the syntactic model.Beame, Saks, and Thathachar [5] showed that polynomial-size semantic read-twice BP can compute functions requiring exponential size on any syntactic read-k-times BP.To the best of our knowledge, non-trivial lower bounds on semantic read-twice BP are not known; however, the syntactic model is well-studied.Borodin, Razborov, and Smolensky [7] exhibited an explicit function of the lower bound of exp Ω n k 3 4 k   .Jukna [17] provided an explicit function f such that nondeterministic read-once BPs of polynomial size can compute ¬f (i.e., the negation of f ); however, to compute f , nondeterministic read-k-times BPs require a size of exp Ω √ n k 2k . Thathachar [25] showed that for any k, the computational power of read-(k + 1)-times BPs is strictly stronger than that of read-k-times BPs.Sauerhoff [21] proved the exponential lower bound for randomized read-k-times BPs with a two-sided error.
When k = 1, syntactic read-k-times BP SAT can be determined in polynomial time by solving the reachability from the root to 1-sink.However, even when k = 2, this problem is known to be NP-complete; to the best our knowledge, there is no algorithm that is faster than the brute-force search.Therefore, we present a moderately exponential time algorithm for any constant k ≥ 2. Our algorithm is based on the decomposition technique by Borodin, Razborov, and Smolensky [7].

Our Techniques
Our satisfiability algorithm consists of two steps as follows: [Step 1: Decomposition] Given a syntactic read-k-times BP B of m edges, we obtain the representation of a function computed by B as a disjunction of at most m 2k 2 decomposed functions by using the decomposition algorithm proposed by Borodin, Razborov, and Smolensky [7].It is sufficient to check the satisfiability of each decomposed function in the running time of Theorem 1, because if one of these functions is satisfiable then the input B is also satisfiable.Moreover, the property of the decomposition algorithm states that each decomposed function is a conjunction of at most 2k 2 functions on small variable sets.Let us represent a conjunction of functions as a set of functions F = {f 1 , f 2 , . . ., f }, where ≤ 2k 2 .[Step 2: Satisfiability Checking] To check the satisfiability of F, we find an assignment that all functions f i are satisfied at the same time.Let (F 1 , F 2 ) be a partition of F. In addition, let X 1 and X 2 be sets of input variables appearing in only F 1 and F 2 respectively and X 3 be a set of input variables appearing in both F 1 and F 2 .If X 3 is an empty set, we can check the satisfiability of F 1 and F 2 independently in time O(2 |X1| + 2 |X2| ) by exhaustive search on each set X 1 and X 2 .If both F 1 and F 2 are satisfiable, we know that F is also satisfiable.Our algorithm assigns 0/1 value to the variables in X 3 and then performs the exhaustive search on each set X 1 and X 2 .Assuming that ).Further, using probabilistic method, we show that the existence of a partition (F 1 , F 2 ) of F such that the value min{|X 1 |, |X 2 |} is adequately large to imply the running time in Theorem 1.Thus, we can save the running time of our satisfiability algorithm.

Related Work
A circuit satisfiability problem is, given a Boolean circuit, to find an assignment to the inputs of the circuit such that the circuit outputs 1.Recently, this problem has been studied extensively, and excellent algorithms that can outperform a brute-force search have been known for some restricted circuit classes such as conjunctive normal forms [2,8,12,13,14,19,22], AC 0 [4, 9, 15], ACC 0 [27], depth-2 threshold circuits [16], De Morgan formulas [11,20,24], and formulas over the full binary basis [23].

Paper Organization
The remainder of this paper is organized as follows.In Section 2, we provide the notation and definitions.In Section 3, we provide two algorithms.One is a decomposition algorithm based on the technique in [7].The other is a satisfiability algorithm for a specific class of Boolean functions.In Section 4, we propose our satisfiability algorithm for syntactic read-k-times BPs.

Preliminaries
A set of integers {1, 2, . . ., n} is denoted by [n].For a set S, |S| denotes the cardinality of S. Let X = {x 1 , . . ., x n } be a set of Boolean variables, and for x ∈ X, x denotes the negation of x.A branching program (BP), denoted by B = (V, E), is a rooted directed acyclic multigraph.
A BP has a unique root node r and two sink nodes (0-sink and 1-sink); 0-sink and 1-sink are nodes labeled by 0 and 1, respectively.Each node except for the sink nodes is labeled from X.Each edge e ∈ E has a label 0 (0-edge) or 1 (1-edge).We call node v an x i -node when v's label is x i .A BP B is deterministic if any nodes except the two sink nodes in B have exactly two outgoing edges: one is a 0-edge, and the other is a 1-edge.Otherwise, B is nondeterministic.For an edge e = (u, v) ∈ E, u is a parent of v and the head of e.The in-degree of v is defined as the number of parents of v.For a BP B on X, each input α = (α 1 , . . ., α n ) ∈ {0, 1} n activates all α i -edges leaving the x i -nodes in B, where 1 ≤ i ≤ n.A computation path is a path from r to a 0-sink or from r to a 1-sink using only activated edges.A BP B outputs 0 if there is no computation path from the root r to a 1-sink; otherwise, B outputs 1.Let f : {0, 1} n → {0, 1} be a Boolean function.A BP B represents f if f (α) is equal to the output of B for any assignment α ∈ {0, 1} n .Two BPs B 1 and B 2 are equivalent if B 1 and B 2 represent the same function.The size of B, denoted by |B|, is defined as the number of edges in B. A BP is syntactic read-k-times if each variable appears at most k times in each path.Figure 1 is an example of syntactic read-twice BPs (k = 2).A BP is semantic read-k-times if each variable appears at most k times in each computation path.In this paper, we use only the syntactic model and for simplicity we call it read-k-times BP.
For a BP B and two nodes v, w, a subbranching program B, v, w is a BP that contains v as the root node, w as the sink node, and every nodes and edges in all v-w paths in B. Given a BP B and nodes v, w ∈ V , B, v, w is constructed as follows: 1.Let V be the subset of V such that u ∈ V is reachable from v and to w. 2. Output the subgraph of B induced by V .Note that, for any pair of nodes v and w, we can construct B, v, w in O(|B|).
Lemma 2 (Theorem 1 in [7]).Let B be a (nondeterministic) syntactic read-k-times BP with n variables and size m and represent a Boolean function f : {0, 1} n → {0, 1}, and let a be a positive integer.There is an algorithm that constructs kam ka BPs {B i,j } from B, where i ∈ [m ka ] and j ∈ [ka], such that the following properties hold: 1.Let f i,j be the Boolean function represented by B i,j .Then, 2. Let X i,j be the set of variables that appear in B i,j .For each i and j, |X i,j | is at most n/a .For each i, each variable x belongs to at most k sets of {X i,j } j=1,...,ka .

Lemma 3. Given a (nondeterministic) syntactic read-k-times BP B with n variables and size m, the running time of algorithm in Lemma 2 is at most O(kam ka+1 ).
Proof.Let us observe the construction given in the proof of Theorem 1 in [7].Let B be a nondeterministic and syntactic read-k-times BP with n variables and size m.For each pair of nodes (v, w) ∈ V 2 , X(v, w) denotes the set of all variables that appear in the labels on all possible paths from v to w except for the label of w.
Note that any path from r to the 1-sink contains a unique trace.Let T be the set of all traces.For each trace T = (e 1 = (w 1 , v 2 ), . . ., e = (w , v +1 )) ∈ T and 1 ≤ j ≤ , let B T,j be a BP constructed as follows: 1. Prepare the subbranching program B, v j , w j , 0-sink, and 1-sink.2. Create an edge from w j to the 1-sink with the same label of (w j , v j+1 ).

3.
If some node v does not have a 0-edge (resp.1-edge) as an outgoing edge, create a 0-edge (resp.1-edge) from v to the 0-sink.Intuitively, B T,j contains all paths from v j to v j+1 through w j .Note that the index i of the statement corresponds to each trace T .Let g T,j be the function represented by B T,j .Then, we have f = T ∈T +1 j=1 g T,j .Each function g T,j depends on at most n/a variables by property (a).Because B is a syntactic read-k-times BP, for each trace T and each variable x, at most k functions g T,j depend on x.By property (b), we have where w +1 is the 1-sink.Since each variable belongs to at most k subbranching programs, the left-hand side can be bounded above by kn.Then, ≤ ka holds.Moreover, = ka holds only if |X(v +1 , w +1 )| = 0, in which case g T, +1 is a constant function.If this constant is 0, then +1 j=1 g T,j is equal to 0 and we can drop whole terms.If it is 1, we can drop g T, +1 .Therefore, each conjunction part consists of at most ka terms.The number of traces |T | is at most m ka because ≤ ka holds.
The rest of the proof is to analyze the running time of the above construction.First, we find X(v, w) by dynamic programming in O(m) time for each pair of nodes v, w ∈ I S A A C 2 0 1 7 58:6 Satisfiability Algorithm for Syntactic Read-k-times Branching Programs V .Then, the running time for enumerating all X(v, w) is at most O(m 3 ).Using the database of X(v, w), we enumerate all traces by a DFS-like search.The running time for enumerating all traces is at most O(mka • |T |).For each trace T ∈ T , we construct at most ka branching programs B t,j in O(mka) time.Then, the total running time is at most Next, we prove the following lemma for the satisfiability algorithm for a specific class of Boolean functions.Lemma 4. Let a and k be positive integers with a ≤ n.Suppose that we are given a set of ka functions f i that satisfy the following properties: 1.Each f i depends on only at most n/a variables X i ⊂ X, i.e., |X i | ≤ n/a .2. Each variable x belongs to at most k sets X i .

Each function f i can be computed in a time of at most t and a space of at most s.
Then, there exists a deterministic algorithm for counting the satisfiable assignments of the function )n and space O(s + kan).
Proof.Suppose that n is even.(In the case when n is odd, we also obtain the same result in a similar way.)We can also assume that each variable x belongs to at least one set X i .If all sets X i do not contain a variable x, then i |X i | ≤ k(n − 1).This implies that there exists a set X i such that |X i | ≤ (n − 1)/a < n/a .Then, we can put the variable x into the set X i while preserving the properties.
Let F be the family of all subsets of [ka].The size of F, i.e., |F| is 2 ka .For F ∈ F, F is defined as [ka] \ F .We define the set of variables V F := i∈F X i \ i∈ F X i .The set V F contains all variables that belong to only i∈F X i .By definition, for any F ∈ F, V F and V F are disjoint.
Find the set F ∈ F that maximizes min{|V F |, |V F |} in |F| • O(kan) = O(2 ka kan) time by an exhaustive search for F. Let Y := {x 1 , . . ., x n } \ (V F ∪ V F ). Apply some partial assignment α whose support is Y .Then, all f i | α for i ∈ F (resp.i ∈ F ) depend on only the variables in V F (resp.V F ). Let A F be a set of partial assignments α F such that S(α F ) = V F , and f i | α (α F ) = 1 holds for all i ∈ F .Similarly, let A F be a set of partial assignments α F such that S(α F ) = V F , and f i | α (α F ) = 1 holds for all i ∈ F .By an exhaustive search for all partial assignments whose support is V F (resp.V F ), we count the number of elements of A F (resp.
Then, the number of assignments that satisfy f and contain a partial assignment α is We can count the satisfiable assignments of f by the above operations for all partial assignments α where S(α) = Y .For each i, the number of times for computing the function It follows that the running time of our algorithm is Let S be the set of variables {x 1 , . . ., x n/2 } and L be the set of variables {x (n/2)+1 , . . ., x n }.Now, we define good/bad pairs of variables.This notation is used in the proof of Theorem 6 in [7].A pair (x, x ) ∈ S × L is good iff there is no i ∈ [ka] such that x ∈ X i and x ∈ X i and bad otherwise.For each i, the number of bad pairs for X By summing the number of bad pairs for all X i , the total number of bad pairs is at most Then, using n a < n a + 1 and a ≤ n, the number of good pairs is at least Let us consider that the set F ∈ F is chosen uniformly at random.For each good pair holds.This implies that there exists a set F such that For such a set We used the fact that holds and n and k are nonnegative integers, we have The last inequality is by the fact that for any k ≥ 1, 6k 4 k+1 < 1 2 holds.We need the computational space O(kan) for finding the set F ∈ F that maximizes min{|V F |, |V F |}, and O(s) for computing functions f i .

4
Satisfiability Algorithms for Syntactic Read-k-times BPs

Satisfiability Algorithm
In this section, we detail our satisfiability algorithm for syntactic read-k-times BPs and analyze its running time.We describe the outline of our algorithm.Our algorithm consists of two steps.First, applying the decomposition algorithm in Lemma 2 with a = 2k, we decompose the input syntactic read-k-times BP B into a disjunction of at most m 2k 2 BPs.Then, B is satisfiable iff at least one of these decomposed BPs is satisfiable.In addition, each decomposed BP consists of a conjunction of at most 2k 2 BPs.
Second, we determine the satisfiability of each decomposed BP by checking whether there exists an assignment that satisfies all BPs.Let a decomposed BP be a conjunction of BPs I S A A C 2 0 1 7 {B 1 , . . ., B }, where ≤ 2k 2 .Applying Lemma 4 with a = 2k, we count the number of satisfiable assignments that satisfy all BPs.
Repeating the above operations for all decomposed BPs, we can determine the satisfiability of the input B.
Theorem 5 (Restatement of Theorem 1).There exists a deterministic and polynomial space algorithm for a nondeterministic and syntactic read-k-times BP SAT with n variables and m edges that runs in time O poly(n, Proof.Our algorithm consists of the following two steps: (1) decomposition and (2) satisfiability checking.

[Step 1: Decomposition]
Setting a = 2k in Lemma 2, construct the set of BPs {B i,j } from the input B. Let f and f i,j be Boolean functions represented by B and B i,j , respectively.Let X i,j be the set of variables that appear in B i,j .Then, the following properties hold: For each i and j, |X i,j | is at most n 2k .For each i, each variable x belongs to at most k sets of {X i,j } j=1,...,2k 2 .The computational time required in Step 1 is at most O 2k 2 m 2k 2 +1 .

[Step 2: Satisfiability Checking]
In order to check the satisfiability of B, we check whether there exists an assignment that satisfies all branching programs B i,1 , . . ., B i,2k 2 for each i ∈ [m 2k 2 ].Let us consider a fixed i.We denote B i,j , f i,j , and X i,j simply by B j , f j , and X j , respectively.Note that each function f j can be computed in O(m) time and O(m) space by simulating the computation of B j .
Our goal in this step is to determine whether there is an assignment that satisfies all f j for j ∈ [2k 2 ].By applying Lemma 4 and setting a = 2k, t = O(m), and s = O(m), we count the satisfiable assignments that satisfy all f j in a time of at most Therefore, the running time of Step 2 is at most Combining the analyses of Step 1 and Step 2, the running time of our algorithm is at most Note that if a given B is a deterministic and syntactic read-k-times BP, then any satisfiable assignment of B satisfies only one conjunction part of the decomposed BPs.Then, the number of satisfiable assignments of B is equal to the sum of the results of Step 2.

Figure 1
Figure 1 Syntactic read-twice branching program.

1
Amir Abboud, Thomas Dueholm Hansen, Virginia Vassilevska Williams, and Ryan Williams.Simulating branching programs with edit distance and friends: or: a polylog shaved is a lower bound made.In Proceedings of the 48th Annual ACM SIGACT Symposium on Theory of Computing, STOC, pages 375-388, 2016.