Faster Decision of First-Order Graph Properties
Total Page:16
File Type:pdf, Size:1020Kb
Faster decision of first-order graph properties Ryan Williams Stanford University [email protected] Abstract MC(FO) is PSPACE-complete, and therefore appears very un- likely to be solvable efficiently [Sto74, Var82]. The PSPACE- First-order logic captures a vast number of computational problems completeness of the problem stems from the fact that the sentence on graphs. We study the time complexity of deciding graph proper- φ is given as part of the input. However, model-checking is still ties definable by first-order sentences in prenex normal form with very interesting for fixed sentences with k quantifiers, where k is k k variables. The trivial algorithm for this problem runs in O(n ) a constant. By exhaustive search, it is straightforward to decide a time on n-node graphs (the big-O hides the dependence on k). first-order sentence with k quantifiers in O(nk) time; that is, for Answering a question of Miklos´ Ajtai, we give the first algo- every fixed sentence φ, we may always find some polynomial time rithms running faster than the trivial algorithm, in the general case algorithm for model-checking it. of arbitrary first-order sentences and arbitrary graphs. One algo- k rithm runs in O(nk−3+!) ≤ O(nk−0:627) time for all k ≥ 3, Is n the best possible running time we can hope for, in gen- where ! < 2:373 is the n × n matrix multiplication exponent. By eral? To our knowledge, no algorithmic progress on general first- applying fast rectangular matrix multiplication, the algorithm can order model checking for graphs has yet been reported. There has be improved further to run in nk−1+o(1) time, for all k ≥ 9. Fi- been significant prior work on important special cases. A promi- nally, we observe that the exponent of k − 1 is optimal, under the nent example of algorithmic progress on restricted structures is the popular hypothesis that CNF satisfiability with n variables and m work of Courcelle [Cou90], who famously proved that the model- clauses cannot be solved in (2−)n ·poly(m) time for some > 0. checking problem for monadic second-order logic can be solved in linear time on all graphs of bounded treewidth. Dvorak, Kral,´ and Categories and Subject Descriptors G.2.2 [Graph Theory]: Graph Thomas [DKT10] have shown that deciding first-order graph prop- algorithms erties in graphs of bounded expansion (such as planar graphs) can be done in linear time. Keywords first-order logic, graph algorithms, matrix multiplica- Two examples most relevant to this paper are the k-clique prob- tion, satisfiability lem and the k-dominating set problem. The k-clique problem asks whether a given graph on n nodes contains a clique of size k, and 1. Introduction can be expressed as the sentence: One goal of finite model theory is to achieve a fine-grained un- 2 3 ^ derstanding of the complexity of deciding first-order sentences on (9v1)(9v2) ··· (9vk) 4 E(vi; vj )5 : finite structures. In particular, the class of finite graphs is of prime i6=j importance. We focus on first order formulas φ in prenex normal form (PNF) with k quantifiers, i.e., of the form The k-dominating set problem asks whether a given graph contains φ = (Q v ) ··· (Q v ) (v ; : : : ; v ); a set S of k nodes such that all nodes not in S have a neighbor in 1 1 k k 1 k S, and can be expressed with k + 1 quantifiers as: where each Qi 2 f9; 8g, and the predicate is a boolean formula over graphs (v = v ) " # , i.e., over atoms of the form i j and the _ edge relation E(vi; vj ). The model checking problem for first-order (9v1)(9v2) ··· (9vk)(8w) ((w = vi) _ E(vi; w)) : logic on graphs is defined as follows: i Both problems are known to admit algorithms that run in o(nq) MC(FO) time, where q is the number of quantifiers in the sentence defin- Instance: A graph G and first-order sentence φ ing the problem. For k-clique, the best known algorithms run in Problem: Decide if G j= φ. O(nδk) time for a finite number of δ 2 (0:8; 1) depending on k [NP85, EG04]. For (k − 1)-dominating set, the best known algo- Permission to make digital or hard copies of all or part of this work for personal or rithms run in O(nk−"+o(1)) time for some " 2 (0; 1] depending on classroom use is granted without fee provided that copies are not made or distributed k−1+o(1) for profit or commercial advantage and that copies bear this notice and the full citation k [EG04]. In particular, the problem is solvable in n for on the first page. Copyrights for components of this work owned by others than the all k ≥ 8. author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission Giving a partial negative answer to the above question, Chen et and/or a fee. Request permissions from [email protected]. al. [CHKX06] proved that the k-clique problem cannot be solved in CSL-LICS ’14, July 14 - 18 2014, Vienna, Austria. o(k) Copyright is held by the owner/author(s). Publication rights licensed to ACM. n time assuming a reasonable conjecture in complexity theory: o(n) ACM 978-1-4503-2886-9/14/07.. $15.00. that the 3SAT problem is not solvable in 2 time. Results of http://dx.doi.org/10.1145/2603088.2603121 Frick and Grohe [FG04] show that, under the same conjecture, first- order model checking on the class of binary trees cannot be solved Theorem 1.3 Let k ≥ 9. Every k-quantifier first-order sentence on 2o(k) k−1+o(1) in 22 · p(n) time (for all polynomials p(n)).1 n-node graphs can be decided in n time. 1.1 Our Results This algorithm also matches the known running times for solv- ing (k − 1)-dominating set [EG04] for large k. We find that the k-clique problem and k-dominating set problem, both of central importance to parameterized complexity [DF99, Remark 1 In fact, there is no special dependency on graph struc- FG06], are also central to understanding the time complexity of tures in our algorithms, other than the fact that a graph is a binary first-order logic on graphs in general. relation over a vertex set. All our algorithms can be modified to work for first-order prenex sentences over any vocabulary that is k-Clique and Existential FOL on Graphs An existential first defined with a finite set of unary and binary relations. order sentence contains only existentially quantified variables. For instance, the k-clique problem is existential. Our first theorem is that k-clique is the “hardest” existential first-order sentence: the The k−1 exponent of Theorem 1.3 may look like an incremental time complexity of k-clique determines an upper bound on the time advance, which may soon be improved further. However, prior complexity of all other existential queries. This is intriguing, as the work of Patras¸cuˇ and the author shows that a great advance in predicate in the k-clique sentence is quite simple, yet checking it is theoretical SAT solving would result if this k − 1 exponent could sufficient for all sentences with k quantifiers. be improved. Theorem 1.1 Let T (n; k) be the time complexity of deciding Theorem 1.4 (Patras¸cu-Williamsˇ [PW10]) For every " > 0 and whether a given n-node graph contains a k-clique. Then every k ≥ 3, if the (k − 1)-dominating set problem can be solved in k−1−" existential first-order sentence with k quantified variables can be O(n ) time, then there is a δ > 0 such that satisfiability 2 decided on n-node graphs in 2O(k )T (n; k) time. of general CNF formulas with n variables and m clauses can be solved in (2 − δ)n · mO(1) time. That is, faster algorithms for k-clique imply faster algorithms for every existential first-order sentence. The following are imme- It follows that any algorithmic improvement over Theorem 1.3 diate corollaries: would resolve a major open question about SAT solving: Corollary 1.1 The k-clique problem is in O(f(k)T (n; k)) time for Corollary 1.4 Let k ≥ 4. If the model-checking problem for some function f : N ! N iff the model checking problem for k-quantifier first-order sentences over graphs can be solved in existential first-order logic on graphs is in O(g(k)T (n; k)) time O(nk−1−") time for some " > 0, then the Strong Exponential for some g : N ! N on k quantifier sentences. Time Hypothesis (SETH) is false. Corollary 1.2 There is a universal δ < 1 such that every exis- More discussion on these issues can be found in Section V of tential first-order sentence with k quantifiers can be decided on the paper. 2 n-node graphs in 2O(k )nδk time. k-Dominating Set and FOL on Graphs The k-dominating set 2. Preliminaries problem plays a similar, but not analogous, role in the general We assume some basic familiarity with algorithms and complexity case of arbitrary sentences. Although the (k − 1)-dominating set theory. problem has (k − 1) existential quantifiers and one universal, we present algorithms for model-checking sentences with k quantifiers Let us outline some notation particularly important for this pa- that match the known time complexity of the (k − 1)-dominating per.