2014 Book ComputerScience-TheoryAndAppli PDF
2014 Book ComputerScience-TheoryAndAppli PDF
2014 Book ComputerScience-TheoryAndAppli PDF
Hirsch
Sergei O. Kuznetsov
Jean-Éric Pin
Nikolay K. Vereshchagin (Eds.)
LNCS 8476
Computer Science -
Theory and Applications
9th International Computer Science Symposium
in Russia, CSR 2014
Moscow, Russia, June 7–11, 2014
Proceedings
123
Lecture Notes in Computer Science 8476
Commenced Publication in 1973
Founding and Former Series Editors:
Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen
Editorial Board
David Hutchison
Lancaster University, UK
Takeo Kanade
Carnegie Mellon University, Pittsburgh, PA, USA
Josef Kittler
University of Surrey, Guildford, UK
Jon M. Kleinberg
Cornell University, Ithaca, NY, USA
Alfred Kobsa
University of California, Irvine, CA, USA
Friedemann Mattern
ETH Zurich, Switzerland
John C. Mitchell
Stanford University, CA, USA
Moni Naor
Weizmann Institute of Science, Rehovot, Israel
Oscar Nierstrasz
University of Bern, Switzerland
C. Pandu Rangan
Indian Institute of Technology, Madras, India
Bernhard Steffen
TU Dortmund University, Germany
Demetri Terzopoulos
University of California, Los Angeles, CA, USA
Doug Tygar
University of California, Berkeley, CA, USA
Gerhard Weikum
Max Planck Institute for Informatics, Saarbruecken, Germany
Edward A. Hirsch Sergei O. Kuznetsov
Jean-Éric Pin Nikolay K. Vereshchagin (Eds.)
Computer Science -
Theory andApplications
9th International Computer Science Symposium
in Russia, CSR 2014
Moscow, Russia, June 7-11, 2014
Proceedings
13
Volume Editors
Edward A. Hirsch
Steklov Institute of Mathematics at St. Petersburg
Russian Academy of Sciences, St. Petersburg, Russia
E-mail: hirsch@pdmi.ras.ru
Sergei O. Kuznetsov
National Research University - Higher School of Economics, Moscow, Russia
E-mail: skuznetsov@hse.ru
Jean-Éric Pin
CNRS and University Paris Diderot, Paris, France
E-mail: jean-eric.pin@liafa.univ-paris-diderot.fr
Nikolay K. Vereshchagin
Moscow State University, Russia
E-mail: ver@mech.math.msu.su
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of
the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology
now known or hereafter developed. Exempted from this legal reservation are brief excerpts in connection
with reviews or scholarly analysis or material supplied specifically for the purpose of being entered and
executed on a computer system, for exclusive use by the purchaser of the work. Duplication of this publication
or parts thereof is permitted only under the provisions of the Copyright Law of the Publisher’s location,
in ist current version, and permission for use must always be obtained from Springer. Permissions for use
may be obtained through RightsLink at the Copyright Clearance Center. Violations are liable to prosecution
under the respective Copyright Law.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Typesetting: Camera-ready by author, data conversion by Scientific Publishing Services, Chennai, India
Printed on acid-free paper
Springer is part of Springer Science+Business Media (www.springer.com)
Preface
The 9th International Computer Science Symposium in Russia (CSR 2014) was
held during June 7–11, 2014, in Moscow, hosted by the Moscow Center for Con-
tinuous Mathematical Education. It was the ninth event in the series of regular
international meetings following CSR 2006 in St. Petersburg, CSR 2007 in Eka-
terinburg, CSR 2008 in Moscow, CSR 2009 in Novosibirsk, CSR 2010 in Kazan,
CSR 2011 in St. Petersburg, CSR 2012 in Nizhny Novgorod, and CSR 2013 in
Ekaterinburg.
The opening lecture was given by Shafi Goldwasser and six other invited
plenary lectures were given by Mark Braverman, Volker Diekert, Martin Grohe,
Benjamin Rossman, Alexei Semenov, and Igor Walukiewicz.
This volume contains the accepted papers and abstracts of the invited talks.
The scope of the proposed topics for the symposium is quite broad and covers
a wide range of areas in theoretical computer science and its applications. We
received 76 papers in total, and out of these the Program Committee selected 27
papers for presentation at the symposium and for publication in the proceedings.
As usual, Yandex provided the Best Paper Awards. The recipients of these
awards were selected by the Program Committee, but due to potential conflicts
of interest, the procedure of selecting award winners did not involve the PC chair
and was chaired by Edward A. Hirsch. The winners are:
– Best Paper Award: Akinori Kawachi, Benjamin Rossman and Osamu Watan-
abe, “The Query Complexity of Witness Finding”
– Konrad Schwerdtfeger, The Connectivity of Boolean Satisfiability: Dichotomies
for Formulas and Circuits.
The reviewing process was organized using the EasyChair conference system
created by Andrei Voronkov. We would like to acknowledge that this system
helped greatly to improve the efficiency of the committee work.
The following satellite events were co-located with CSR 2014:
– Workshop on Current Trends in Cryptology (CTCrypt)
– Extremal Graph Theory
– New Directions in Cryptography
– Program Semantics, Specification and Verification (PSSV 2014)
We are grateful to our sponsors:
– Russian Foundation for Basic Research
– Higher School of Economics (HSE)
– Yandex
– Talksum
– IPONWEB
– CMA Small Systems AB
– Dynasty Foundation
VI Preface
Program Committee
Eric Allender Rutgers, USA
Andris Ambainis University of Latvia, Latvia
Christel Baier TU Dresden, Germany
Petra Berenbrink Simon Fraser University, Canada
Mikolaj Bojanczyk University of Warsaw, Poland
Andrei A. Bulatov Simon Fraser University, Canada
Victor Dalmau Pompeu Fabra University, Spain
Manfred Droste University of Leipzig, Germany
Zoltan Esik University of Szeged, Hungary
Fedor Fomin University of Bergen, Norway
Edward A. Hirsch Steklov Institute of Mathematics at
St. Petersburg, Russia
Gregory Kucherov CNRS and University of Marne-la-Vallée,
France
Michal Kunc Masaryk University, Czech Republic
Leonid Libkin University of Edinburgh, UK
Konstantin Makarychev Microsoft Research, Redmond, USA
Kurt Mehlhorn Max Planck Institute, Germany
Georg Moser University of Innsbruck, Austria
Alexander Okhotin University of Turku, Finland
Giovanni Pighizzini University of Milan, Italy
Jean-Éric Pin LIAFA, CNRS and University of Paris-Diderot,
France
VIII Organization
Symposium Co-chairs
Nikolai K. Vereshchagin MCCME and Moscow State University, Russia
Edward A. Hirsch Steklov Institute of Mathematics at
St. Petersburg, Russia
Sergei O. Kuznetsov School of Applied Mathematics and
Information Science, Higher School of
Economics, Russia
Organizing Committee
Alexander Kulikov Steklov Institute of Mathematics at
St. Petersburg, Russia
Daniil Musatov Moscow Institute of Physics and Technology,
Russia
Vladimir Podolskii Steklov Institute of Mathematics, Moscow,
Russia
Alexander Smal Steklov Institute of Mathematics at
St. Petersburg, Russia
Tatiana Starikovskaya School of Applied Mathematics and
Information Science, Higher School
of Economics, Russia
Steering Committee
Anna Frid Sobolev Institute of Mathematics, Russia
Edward A. Hirsch Steklov Institute of Mathematics at
St. Petersburg, Russian Academy
of Sciences, Russia
Juhani Karhumäki University of Turku, Finland
Ernst W. Mayr Technical University of Munich, Germany
Alexander Razborov University of Chicago, USA, and Steklov
Mathematical Institute, Russia
Mikhail Volkov Ural Federal University, Russia
Organization IX
External Reviewers
Mark Braverman
*
Supported by Humboldt Research Fellowship for Postdoctoral Researchers.
1
A full version of the present paper with detailed proofs can be found on arXiv.
Algorithmic Meta Theorems
for Sparse Graph Classes
Martin Grohe
Introduction
A word equation is a simple object. It consists of a pair (U, V ) of words over
constants and variables and a solution is a substitution of the variables by words
in constants such that U and V are identical words. The study of word equa-
tions has a long tradition. Let WordEquation be the problem to decide whether
a given word equation has a solution. It is fairly easy to see that WordEquation
reduces to Hilbert’s 10th Problem (in Hilbert’s famous list presented in 1900 for
his address at the International Congress of Mathematicians). Hence in the mid
1960s the Russian school of mathematics outlined the roadmap to prove unde-
cidability of Hilbert 10 via undecidability of WordEquation. The program failed
in the sense that Matiyasevich proved Hilbert’s 10th Problem to be undecidable
in 1970, but by a completely different method, which employed number theory.
The missing piece in the proof of the undecidability of Hilbert’s 10th Problem
Supported by Humboldt Research Fellowship for Postdoctoral Researchers.
1
A full version of the present paper with detailed proofs can be found on arXiv.
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 1–15, 2014.
c Springer International Publishing Switzerland 2014
2 V. Diekert, A. Jeż, and W. Plandowski
was based on methods due to Robinson, Davis, and Putnam [20]. On the other
hand, in 1977 Makanin showed in a seminal paper [17] that WordEquation is
decidable! The program went a different way, but its outcome were two major
achievements in mathematics. Makanin’s algorithm became famous since it set-
tled a long standing problem and also because his algorithm had an extremely
complex termination proof. In fact, his paper showed that the existential the-
ory of equations in free monoids is decidable. This is close to the borderline
of decidability as already the ∀∃3 positive theory of free monoids is undecid-
able [7]. Furthermore Makanin extended his results to free groups and showed
that the existential and positive theories in free groups are decidable [18, 19].
Later Razborov was able in [26] (partly shown also in [27]) to describe the set
of all solutions for systems of equations in free groups (see also [14] for a de-
scription of Razborov’s work). This line of decidability results culminated in the
proof of Tarski’s conjectures by Kharlampovich and Myasnikov in a series of
papers ending in [15]. In particular, they showed that the theory of free groups
is decidable. In order to prove this fundamental result the description of all so-
lutions of an equation in a free group is crucial. Another branch of research was
to extend Makanin’s result to more general algebraic structures including free
partially commutative monoids [21, 5], free partially commutative monoids with
involution, graph groups (also known as right-angled Artin groups) [6], graph
products [4], and hyperbolic groups [28, 2]. In all these cases the existential the-
ory of equations is decidable. Proofs used the notion of equation with rational
constraints, which was first developed in the habilitation of Schulz, see [29]. A
concept which is also used throughout in the present paper.
In parallel to these developments there were drastic improvements in the com-
plexity of deciding word equations. It is fairly easy to see that the problem is
NP-hard. Thus, NP is a lower bound. First estimations for the time complexity
on Makanin’s algorithm for free monoids led to a tower of several exponentials,
but it was lowered over time to EXPSPACE in [9]. On the the other hand it
was shown in [16] that Makanin’s scheme for solving equations in free groups is
not primitive recursive. (Already in the mid 1990 this statement was somehow
puzzling and counter-intuitive, as it suggested a strange crossing of complexi-
ties: The existential theory in free monoids seemed to be easier than the one
in free groups, whereas it was already known at that time that the positive
theory in free monoids is undecidable, but decidable in free groups.) The next
important step was done by Plandowski and Rytter, whose approach [25] was
the first essentially different than Makanin’s original solution. They showed that
Lempel-Ziv encodings of minimal solution of word equations leads to an expo-
nential compression (if the solution itself is at least exponential in the length
of the equation). Moreover the compression turned out be extremely simple.
As a consequence they formulated the still valid conjecture that WordEquation
is NP-complete. Following the idea to keep the equation and possible solution
in compressed form and employing a novel type of factorisations Plandowski
showed that WordEquation is in PSPACE, i.e., it can be solved in polynomial
space and exponential time [22]. His method was quite different from Makanin’s
Solutions of Equations 3
1 Preliminaries
Word Equations. Let A and Ω be two finite disjoint sets, called the alphabet
of constants and the alphabet of variables (or unknowns), respectively. For the
purpose of this paper A and Ω are endowed with an involution, which is is
a mapping such that x = x for all elements. In particular, an involution
is a bijection. Since, the identity mapping is an involution, there is no harm
in thinking that all sets come with an involution. If M is a monoid, then we
additionally require xy = y x for all x, y ∈ M . This applies in particular to a free
monoid Σ ∗ over a set with involution: For a word w = a1 · · · am we thus have
w = am · · · a1 . If a = a for all a ∈ Σ then w simply means to read the word
from right-to-left.
A word equation is a pair (U, V ) of words over A ∪ Ω, usually denoted by
U = V . A solution σ of a word equation U = V is a substitution σ of unknowns
in Ω by words over constants, such that the replacement of unknowns by the
substituted words in U and in V give the same word. Moreover, as we work with
4 V. Diekert, A. Jeż, and W. Plandowski
involutions we additionally demand that the solution satisfies σ(X) = σ(X) for
all X ∈ Ω.
Example 1. Let Ω = X, Y, X, Y and A = {a, b} with b = a. Then XabY =
Y baX behaves as a word equation without involution One of its solutions is
the substitution σ(X) = bab, σ(Y ) = babab. Under this substitution we have
σ(X)abσ(Y ) = bababbabab = σ(Y )baσ(X). It can be proved that the solution
set of the equation XabY = Y baX is closely related to Sturmian words [12].
Input Size. The input size for the reduction is given by the sum over the lengths
of the equations and inequalities plus the size of Γ plus the sum of the number
of states of the NFAs in the lists for the constraints. The measure is accurate
enough with respect to polynomial time and or space. For example note that if
an NFA has n states then the number of transitions is bounded by 2n |Γ |. Note
also that |Γ | can be much larger than the sum over the lengths of the equations
and inequalities plus the sum of the number of states of the NFAs in the lists
for the constraints. Recall that we encode X = 1 by a rational constraint, which
introduces an NFA with 2 |Γ | + 1 states. Since |Γ | is part of the input, this does
not cause any problem.
σ(U ) = σ(V ) ,
σ(X) = σ(X) for all X ∈ Ω,
ρσ(X) = ρ(X) for all X ∈ Ω.
In the following, we denote the size of the instance by n, i.e., by the same letter
as the size of the matrix. This is not a problem, as we can always increase the
size of the matrix.
Equations during the Algorithm. During the procedure we will create var-
ious other equations and introduce new constants. Still, the original alphabet A
never changes and new constants shall represent words in A∗ . As a consequence,
we will work with equations over B ∪ Ω, where B is the smallest alphabet con-
taining A and all constants in U V U V . In this setting a solution σ assigns words
from B to variables. To track the meaning of constants from B \ A we addition-
ally require that a solution has a morphism h : B → A∗ , which is constant on
A. Then given an equation U = V the h(σ(U )) corresponds to a solution of the
original equation. Note that |B| ≤ |A| + 2 |U V | and we therefore we can ignore
|B| for the complexity.
A weight of a solution (σ, h) of an an equation (U, V ) is
w(σ, h) = |U | + |V | + 2n |h(σ(X))| .
X∈Ω
Solutions of Equations 7
Note that we implicitly assume here that if X does not occur in the equation
then σ(X) = . Each next equation in the sequence will have a smaller weight,
which ensures that we do not cycle.
Two solutions (σ1 , h) and (σ2 , h) of (U, V ) that satisfy h(σ1 (X)) = h(σ2 (X))
for each variable X represent the same solution of the original equation and so
in some sense are equivalent. We formalise this notion in the following way: for
an equation U = V the solution (σ1 , h) is a simpler equivalent of the solution
(σ2 , h), written as (σ1 , h)
(σ2 , h) if for each variable X the σ1 (X) is obtained
from σ2 (X) by replacing some letters b ∈ B by h(b). It follows straight from the
definition that if (σ1 , h)
(σ2 , h) then σ1 and σ2 have the same weight.
Note that h is a technical tool used in the analysis, it is not stored, nor
transformed by the algorithm, nor it is used in the graph representation of all
solutions.
3 Compression Step
In this section we describe procedures that show the claim of Lemma 1. In
essence, given a word equation (U, V ) with a solution σ we want to compress the
word σ(U ) directly on the equation, i.e., without the knowledge of the actual
solution. These compression steps replace the ab-blocks, as defined later in this
section. To do this, we sometimes need to modify the equation (U, V ).
The crucial observation is that a properly chosen sequence of such compression
guarantees that the obtained equation is strictly proper (assuming (U, V ) was),
see Lemma 7.
– for every equation U = V that can be obtained from U = V and any its
solution (σ , h ) and for every operator ϕ ∈ Φ there is h such that (ϕ[σ ], h)
is a solution of U = V and h(σ(U )) = h (σ (U )).
Note that both U = V and Φ depend on the nondeterministic choices, so it
might be that for different choices we can transform U = V to U = V (with
Φ ) and to U = V (with a family Φ ).
We also say that the equation U = V with its solution (σ, h) are transformed
into U = V with (σ , h ) and that Φ is the corresponding family of inverse
operators. In many cases, Φ consists of a single operator ϕ, in such case we call
it the corresponding inverse operator, furthermore, in some cases ϕ does not
depend on U = V , nor on the nondeterministic choices.
ab-blocks. In an earlier paper using the recompression technique [13] there were
two types of compression steps: compression of pairs ab, where a = b were two
different constants, and compression of maximal factor a (i.e., ones that cannot
be extended to the right, nor left). In both cases, such factors were replaced with
a single fresh constant, say c. The advantage of such compression steps was that
the replaced factors were non-overlapping, in the sense that when we fixed a pair
or block to be compressed, each constant in a word w belongs to at most one
replaced factor.
We would like to use similar compression rules also for the case of monoids
with involution, however, one needs to take into the account that when some
string w is replaced with a a constant c, then also w should be replaced with c.
The situation gets complicated, when some of letters in w are fixed point for the
involution, i.e., a = a. In the worst case, when a = a and b = b the occurrences
of ab and ab = ba are overlapping, so the previous approach no longer directly
applies. (If we start with an equation over a free group then, in the involution
has no fixed points in A, but fixed points are produced during the algorithm.
They cannot be avoided in our approach, see below.)
Still, the problem can be resolved by replacing factors from a more general
class (for a fixed pair of constants ab).
Definition 2. Depending on a and b, ab-blocks are
1. If a = b then there are two types of ab-blocks: ai for i ≥ 2 and ai for i ≥ 2.
2. If a = b, a = a and b = b then ab and ba are the two types of ab-blocks.
3. If a = b, a = a and b = b then ab, ab = ba and bab are the three types of
ab-blocks.
4. If a = b, a = a and b = b then ab, ab = ba and aba are the three types of
ab-blocks.
5. If a = b, a = a and b = b then (ba)i for i ≥ 1, a(ba)i for i ≥ 1, (ba)i b for
i ≥ 1 and (ab)i for i ≥ 1 are the four types of ab-blocks.
An occurrence of ab-block in a word is an ab-factor, it is maximal, if it is not
contained in any other ab-factor.
For a fixed ab block s the s-reduction of the word w is the word w in which all
maximal factors s (s) are replaced by a new constant cs (cs , respectively). The
inverse function is s-expansion.
10 V. Diekert, A. Jeż, and W. Plandowski
either wholly from U (V , respectively) or from σ(X) or σ(X). The former are
replaced by our procedure and the latter are replaced implicitly, by changing the
solution. Thus it can be shown that the solutions of the new and old equation
are in one-to-one correspondence.
Reduction for Crossing ab. Since we already know how to compress a non-
crossing ab, a natural way to deal with a crossing ab is to “uncross” it and
then compress using CompNCr. To this end we pop from the variables the whole
parts of maximal ab-blocks which cause this block to be crossing. Afterwards
all maximal ab-blocks are noncrossing and so they can be compressed using
CompNCr(U, V, ab)
As an example consider an equation aaXaXaX = aXaY aY aY . (For sim-
plicity without constraints.) It is easy to see that all solutions are of the form
12 V. Diekert, A. Jeż, and W. Plandowski
X ∈ aX and Y = aY , for an arbitrary k. After the popping this equation is
turned into a3X +4 = aX +3Y , for which aa is noncrossing. Thus solution of
the original equation corresponds to the solution of the Diophantine equation:
3X + 4 = X + 3Y + 4. This points out another idea of the popping: when
we pop the whole part of block that is crossing, we do not immediately guess
its length, instead we treat the length as a parameter, identify ab-blocks of the
same length and only afterwards verify, whether our guesses were correct. The
verification is formalised as a linear system of Diophantine equations. Each of its
solutions correspond to one “real” lengths of ab-blocks popped from variables.
Note that we still need to calculate the transition of the popped ab-block,
which depends on the actual length (i.e., on particular solution X or rX ). How-
ever, this ab block is long because of repeated ab (or ba). Now, when we look at
ρ(ab), ρ(ab)2 , . . . then starting from some (at most exponential) value it becomes
periodic, the period is also at most exponential. More precisely, if P ∈ M2n is
a matrix, then we can compute in PSPACE an idempotent power P p = P 2p
2
with p ≤ 2n . Thus, if is a parameter we can guess (and fix) the remainder
r ≡ mod p with 0 ≤ r < p. We can guess if r < and in this case we substitute
the parameter by c · p + r and we view c as the new integer parameter with
the constraint c ≥ 1. This can be written as an Diophantine equation and added
to the constructed linear Diophantine system which has polynomial size if coef-
ficients are written in binary. We can check solvability (and compute a minimal
solution) in NP, see e.g., [11]. (For or a more accurate estimation of constants
see [3]).
Let D be the system created by CompCr. In this case there is no single op-
erator, rather a family ΦD , and its elements ϕD,{X ,rX }X∈Ω are defined using
a solution {X , rX }X∈Ω of D. Given an arithmetic expression with integer pa-
rameters {xX , yX }X∈Ω , by ei [{X , rX }X∈Ω ] we denote its evaluation on values
xX = X and yX = rX . In order to obtain ϕD,{X ,rX }X∈Ω [σ](X) we first replace
each letter cei with appropriate type of ab-block of length ei [{X , rX }X∈Ω ]. Af-
terwards, we prepend ab block of length X and append ab-block of length rX
(in both cases we need to take into the account the types). Concerning h , we
extend h to new letters by setting h (cei ) = h(ei [{X , rX }X∈Ω ]).
Lemma 6. Let (U, V ) have a solution σ. Let S be the set of all ab-blocks in U , V
or crossing in σ. CompCr(U, V, ab) transforms (U, V ) with (σ, h) into an equation
(U , V ) with (σ , h ). If at least one ab-factor was replaced then w(σ ) < w(σ ).
Furthermore, the family ΦD is the corresponding family of operators.
Lemma 7. Suppose that (U, V ) is a strictly proper equation. Then during Trans-
formEq the (U, V ) is a proper equation and after it it is strictly proper.
Solutions of Equations 13
Proof. Consider, how many letters are popped into the equation during Trans-
formEq. For a fixed ab, CompCr may introduce long ab-blocks at sides of each
variable, but then they are immediately replaced with one letter, so we can count
them as one letter (and in the meantime each such popped prefix and suffix is
represented by at most four constants). Thus, 2n letters are popped in this way.
There are at most 4n crossing pairs, see Lemma 4, so in total 8n2 letters are
introduced to the equation.
Consider a constant initially present in the equation, say a, which is not
followed by a variable and is not the last letter in U or V . When equation has
size m, there are at least m − 2n − 2 such letters. Thus this a is followed by
a letter, say b, and so ab is in P and we tried to compress the maximal ab-factor
containing this ab. The only reason, why we failed is that one of a, b was already
compressed, as part of a different factor. Thus, if a (not initially followed by a
variable, nor the last letter in U and V ) was not compressed during TransformEq,
then the two following constants were. The left of those constants was present
initially at the equation, so at least (m−2n−2)/3 initial constants were removed
from the equation. Hence the result.
14 V. Diekert, A. Jeż, and W. Plandowski
Algorithm 3. TransformEq(U, V )
1: P ← list of explicit ab’s in U , V .
2: P ← crossing ab’s Done by guessing first and last letters of each σ(X),
|P | ≤ 4n
3: P ← P \ P
4: for ab ∈ P do
5: CompNCr(U, V, ab)
6: for ab ∈ P do
7: CompCr(U, V, ab)
8: return (U, V )
References
[1] Benois, M.: Parties rationelles du groupe libre. C. R. Acad. Sci. Paris, Sér. A 269,
1188–1190 (1969)
[2] Dahmani, F., Guirardel, V.: Foliations for solving equations in groups: free, vir-
tually free and hyperbolic groups. J. of Topology 3, 343–404 (2010)
[3] Diekert, V., Gutiérrez, C., Hagenah, C.: The existential theory of equations with
rational constraints in free groups is PSPACE-complete. Inf. and Comput. 202,
105–140 (2005); Conference version in Ferreira, A., Reichel, H. (eds.) STACS 2001.
LNCS, vol. 2010, pp. 170–182. Springer, Heidelberg (2001)
[4] Diekert, V., Lohrey, M.: Word equations over graph products. IJAC 18(3), 493–533
(2008)
[5] Diekert, V., Matiyasevich, Y., Muscholl, A.: Solving word equations modulo partial
commutations. TCS 224, 215–235 (1999); Special issue of LFCS 1997
[6] Diekert, V., Muscholl, A.: Solvability of equations in free partially commuta-
tive groups is decidable. International Journal of Algebra and Computation 16,
1047–1070 (2006); Journal version of Orejas, F., Spirakis, P.G., van Leeuwen, J.
(eds.) ICALP 2001. LNCS, vol. 2076, pp. 543–554. Springer, Heidelberg (2001)
[7] Durnev, V.G.: Undecidability of the positive ∀∃3 -theory of a free semi-group.
Sibirsky Matematicheskie Jurnal 36(5), 1067–1080 (1995) (in Russian); English
translation: Sib. Math. J. 36(5), 917–929 (1995)
[8] Eilenberg, S.: Automata, Languages, and Machines, vol. A. Academic Press, New
York (1974)
[9] Gutiérrez, C.: Satisfiability of word equations with constants is in exponential
space. In: Proc. 39th FOCS 1998, pp. 112–119. IEEE Computer Society Press,
Los Alamitos (1998)
Solutions of Equations 15
[10] Gutiérrez, C.: Satisfiability of equations in free groups is in PSPACE. In: Proc.
32nd STOC 2000, pp. 21–27. ACM Press (2000)
[11] Hopcroft, J.E., Ulman, J.D.: Introduction to Automata Theory, Languages and
Computation. Addison-Wesley (1979)
[12] Ilie, L., Plandowski, W.: Two-variable word equations. Theoretical Informatics
and Applications 34, 467–501 (2000)
[13] Jeż, A.: Recompression: a simple and powerful technique for word equations.
In: Portier, N., Wilke, T. (eds.) STACS. LIPIcs, vol. 20, pp. 233–244. Schloss
Dagstuhl-Leibniz-Zentrum fuer Informatik, Dagstuhl (2013)
[14] Kharlampovich, O., Myasnikov, A.: Irreducible affine varieties over a free group.
II: Systems in triangular quasi-quadratic form and description of residually free
groups. J. of Algebra 200(2), 517–570 (1998)
[15] Kharlampovich, O., Myasnikov, A.: Elementary theory of free non-abelian groups.
J. of Algebra 302, 451–552 (2006)
[16] Kościelski, A., Pacholski, L.: Complexity of Makanin’s algorithm. J. Association
for Computing Machinery 43(4), 670–684 (1996)
[17] Makanin, G.S.: The problem of solvability of equations in a free semigroup. Math.
Sbornik 103, 147–236 (1977) English transl. in Math. USSR Sbornik 32 (1977)
[18] Makanin, G.S.: Equations in a free group. Izv. Akad. Nauk SSR, Ser. Math. 46,
1199–1273 (1983) English transl. in Math. USSR Izv. 21 (1983)
[19] Makanin, G.S.: Decidability of the universal and positive theories of a free group.
Izv. Akad. Nauk SSSR, Ser. Mat. 48, 735–749 (1984) (in Russian); English trans-
lation in: Math. USSR Izvestija 25, 75–88 (1985)
[20] Matiyasevich, Y.: Hilbert’s Tenth Problem. MIT Press, Cambridge (1993)
[21] Matiyasevich, Y.: Some decision problems for traces. In: Adian, S., Nerode, A.
(eds.) LFCS 1997. LNCS, vol. 1234, pp. 248–257. Springer, Heidelberg (1997)
[22] Plandowski, W.: Satisfiability of word equations with constants is in PSPACE. J.
Association for Computing Machinery 51, 483–496 (2004)
[23] Plandowski, W.: An efficient algorithm for solving word equations. In: Proc. 38th
STOC 2006, pp. 467–476. ACM Press (2006)
[24] Plandowski, W.: (unpublished, 2014)
[25] Plandowski, W., Rytter, W.: Application of Lempel-Ziv encodings to the solution
of word equations. In: Larsen, K.G., Skyum, S., Winskel, G. (eds.) ICALP 1998.
LNCS, vol. 1443, pp. 731–742. Springer, Heidelberg (1998)
[26] Razborov, A.A.: On Systems of Equations in Free Groups. PhD thesis, Steklov
Institute of Mathematics (1987) (in Russian)
[27] Razborov, A.A.: On systems of equations in free groups. In: Combinatorial and
Geometric Group Theory, pp. 269–283. Cambridge University Press (1994)
[28] Rips, E., Sela, Z.: Canonical representatives and equations in hyperbolic groups.
Inventiones Mathematicae 120, 489–512 (1995)
[29] Schulz, K.U.: Makanin’s algorithm for word equations — Two improvements and a
generalization. In: Schulz, K.U. (ed.) IWWERT 1990. LNCS, vol. 572, pp. 85–150.
Springer, Heidelberg (1992)
Algorithmic Meta Theorems
for Sparse Graph Classes
Martin Grohe
Introduction
It is often the case that a wide range of algorithmic problems can be solved by
essentially the same technique. Think of dynamic programming algorithms on
graphs of bounded tree width or planar graph algorithms based on layerwise
(or outerplanar) decompositions. In such situations, it is natural to try to find
general conditions under which an algorithmic problem can be solved by these
techniques—this leads to algorithmic meta theorems. However, it is not always
easy to describe such conditions in a way that is both mathematically precise
and sufficiently general to be widely applicable. Logic gives us convenient ways
of doing this. An early example of an algorithmic meta theorem based on logic
is Papadimitriou and Yannakakis’s [40] result that all optimisation problems in
the class MAXSNP, which is defined in terms of a fragment of existential second-
order logic, admit constant-ratio polynomial time approximation algorithms.
Besides logic, most algorithmic meta theorems have structural graph theory
as a second important ingredient in that they refer to algorithmic problems re-
stricted to specific graph classes. The archetypal example of such a meta theorem
is Courcelle’s Theorem [3], stating that all properties of graphs of bounded tree
width that are definable in monadic second-order logic are decidable in linear
time.
The main motivation for algorithmic meta theorems is to understand the core
and the scope of certain algorithmic techniques by abstracting from problem-
specific details. Sometimes meta theorems are also crucial for obtaining new
algorithmic results. Two recent examples are
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 16–22, 2014.
c Springer International Publishing Switzerland 2014
Algorithmic Meta Theorems for Sparse Graph Classes 17
SET are definable in FO, we mean that for each k there is an FO-sentence φk stating
that a graph has a dominating set of size at most k. Thus we define (the decision
version of) the DOMINATING SET problem by a family of FO-sentences, and if
we prove that FO-definable properties can be decided in linear time on a certain
class of graphs, this implies that DOMINATING SET parameterized by the size of
the solution is fixed-parameter tractable on this class of graphs. By comparison, we
can define 3-COLOURABILITY by a single MSO-sentence, and if we prove that
MSO-definable properties can be decided in linear time on a certain class of graphs,
this implies that 3-COLOURABILITY can be decided in linear time on this class
of graphs.
After this digression, let us turn to the results. The first notable meta theorem
for deciding FO-definable properties, due to Seese [41], says that FO-definable
properties of bounded-degree graphs can be decided in linear time. Frick and
Grohe [21] gave linear-time algorithms for deciding FO-definable properties of
planar graphs and all apex-minor-free graph classes and O(n1+ ) algorithms for
graph classes of bounded local tree width. Flum and Grohe [18] proved that de-
ciding FO-definable properties is fixed-parameter tractable on graph classes with
excluded minors, and Dawar, Grohe, and Kreutzer [8] extended this to classes
of graphs locally excluding a minor. Dvořák, Král, and Thomas [13] proved that
FO-definable properties can be decided in linear time on graph classes of bounded
expansion and in time O(n1+ ) on classes of locally bounded expansion. Finally,
Grohe, Kreutzer, and Siebertz [30] proved that FO-definable properties can be
decided in linear time on nowhere dense graph classes. Figure 1 shows the con-
tainment relation between all these and other sparse graph classes. Nowhere
dense classes were introduced by Nešetřil and Ossona de Mendez [38,39] (also
see [29]) as a formalisation of classes of “sparse” graphs. They include most fa-
miliar examples of sparse graph classes like graphs of bounded degree and planar
graphs. Notably, classes of bounded average degree or bounded degeneracy are
not necessarily nowhere dense.
The meta theorem for FO-definable properties of nowhere dense classes is op-
timal if we restrict our attention to graph classes closed under taking subgraphs:
if C is a class of graphs closed under taking subgraphs that is somewhere dense
(that is, not nowhere dense), then deciding FO-properties of graphs in C is as
hard as deciding FO-properties of arbitrary graphs, with respect to a suitable
form of reduction [13,33]. Thus under the widely believed complexity-theoretic
assumption FPT = AW[∗], which is implied by more familiar assumptions like the
exponential time hypothesis or FPT = W[1], deciding FO-definable properties of
graphs from C is not fixed-parameter tractable.
There are a few meta theorems for FO-definable properties of graph classes
that are somewhere dense (and hence not closed under taking subgraphs). Ga-
nian et al. [24] give quasilinear-time algorithms for certain classes of interval
graphs. By combining the techniques of [5] and [21], it can easily be shown
that deciding FO-definable properties is fixed-parameter tractable on graphs of
bounded local rank width (see [26]). It is also easy to prove fixed-parameter
tractability for classes of unbounded, but slowly growing degree [11,25].
Algorithmic Meta Theorems for Sparse Graph Classes 19
bounded degeneracy
somewhere dense
nowhere dense
nowhere dense
bounded expansion
locally excluded minor
excluded topological subgraph
bounded local
excluded minor
tree width
bounded genus bounded degree
bounded tree width
planar
trees
Many of the meta theorems above have variants for counting and enumeration
problems, where we are given a formula φ(x1 , . . . , xk ) with free variables and
want to compute the number of tuples satisfying the formula in a given graph
or compute a list of all such tuples, and also for optimisation problems. (See, for
example, [1,2,4,6,7,9,12,11,17,20,31,32].)
Uniformity
In this paper, we stated all meta theorems in the form: for every property defin-
able in a logic L on a class C of graphs there is an O(nc ) algorithm. Here n is the
number of vertices of the input graph, and the exponent c is a small constant,
most often 1 or (1 + ). However, all these theorems hold in a uniform version of
the form: there is an algorithm that, given an L-sentence φ and a graph G ∈ C,
decides whether φ holds in G in time f (k) · nc , where k is the length of the sen-
tence φ and f is some computable function (the exponent c remains the same).
For families of classes constrained by an integer parameter , such as the classes
of all graphs of tree width at most or the classes of all graphs that exclude an
20 M. Grohe
References
1. Arnborg, S., Lagergren, J., Seese, D.: Easy problems for tree-decomposable graphs.
Journal of Algorithms 12, 308–340 (1991)
2. Bagan, G.: MSO queries on tree decomposable structures are computable with
linear delay. In: Ésik, Z. (ed.) CSL 2006. LNCS, vol. 4207, pp. 167–181. Springer,
Heidelberg (2006)
3. Courcelle, B.: Graph rewriting: An algebraic and logic approach. In: van Leeuwen,
J. (ed.) Handbook of Theoretical Computer Science, vol. B, pp. 194–242. Elsevier
Science Publishers (1990)
4. Courcelle, B.: Linear delay enumeration and monadic second-order logic. Discrete
Applied Mathematics 157(12), 2675–2700 (2009)
5. Courcelle, B., Makowsky, J., Rotics, U.: Linear time solvable optimization problems
on graphs of bounded clique width. Theory of Computing Systems 33(2), 125–150
(2000)
6. Courcelle, B., Makowsky, J., Rotics, U.: On the fixed-parameter complexity of
graph enumeration problems definable in monadic second-order logic. Discrete Ap-
plied Mathematics 108(1-2), 23–52 (2001)
7. Courcelle, B., Mosbah, M.: Monadic second-order evaluations on tree-
decomposable graphs. Theoretical Computer Science 109, 49–82 (1993)
8. Dawar, A., Grohe, M., Kreutzer, S.: Locally excluding a minor. In: Proceedings of
the 22nd IEEE Symposium on Logic in Computer Science, pp. 270–279 (2007)
9. Dawar, A., Grohe, M., Kreutzer, S., Schweikardt, N.: Approximation schemes for
first-order definable optimisation problems. In: Proceedings of the 21st IEEE Sym-
posium on Logic in Computer Science, pp. 411–420 (2006)
10. Downey, R., Fellows, M.: Fundamentals of Parameterized Complexity. Springer
(2013)
11. Durand, A., Schweikardt, N., Segoufin, L.: Enumerating first-order queries over
databases of low degree. In: Proceedings of the 33rd ACM Symposium on Principles
of Database Systems (2014)
12. Durand, A., Grandjean, E.: First-order queries on structures of bounded degree
are computable with constant delay. ACM Transactions on Computational Logic
8(4) (2007)
13. Dvořák, Z., Král, D., Thomas, R.: Deciding first-order properties for sparse graphs.
In: Proceedings of the 51st Annual IEEE Symposium on Foundations of Computer
Science, pp. 133–142 (2010)
Algorithmic Meta Theorems for Sparse Graph Classes 21
14. Elberfeld, M., Jakoby, A., Tantau, T.: Logspace versions of the theorems of bod-
laender and courcelle. In: Proceedings of the 51st Annual IEEE Symposium on
Foundations of Computer Science, pp. 143–152 (2010)
15. Elberfeld, M., Jakoby, A., Tantau, T.: Algorithmic meta theorems for circuit classes
of constant and logarithmic depth. In: Dürr, C., Wilke, T. (eds.) Proceedings
of the 29th International Symposium on Theoretical Aspects of Computer Sci-
ence. LIPIcs, vol. 14, pp. 66–77. Schloss Dagstuhl, Leibniz-Zentrum fuer Informatik
(2012)
16. Elberfeld, M., Kawarabayashi, K.I.: Embedding and canonizing graphs of bounded
genus in logspace. In: Proceedings of the 46th ACM Symposium on Theory of
Computing (2014)
17. Flum, J., Frick, M., Grohe, M.: Query evaluation via tree-decompositions. Journal
of the ACM 49(6), 716–752 (2002)
18. Flum, J., Grohe, M.: Fixed-parameter tractability, definability, and model checking.
SIAM Journal on Computing 31(1), 113–145 (2001)
19. Flum, J., Grohe, M.: Parameterized Complexity Theory. Springer (2006)
20. Frick, M.: Generalized model-checking over locally tree-decomposable classes. The-
ory of Computing Systems 37(1), 157–191 (2004)
21. Frick, M., Grohe, M.: Deciding first-order properties of locally tree-decomposable
structures. Journal of the ACM 48, 1184–1206 (2001)
22. Frick, M., Grohe, M.: The complexity of first-order and monadic second-order logic
revisited. Annals of Pure and Applied Logic 130, 3–31 (2004)
23. Ganian, R., Hliněný, P., Langer, A., Obdrlek, J., Rossmanith, P., Sikdar, S.: Lower
bounds on the complexity of MSO1 model-checking. In: Dürr, C., Wilke, T. (eds.)
Proceedings of the 29th International Symposium on Theoretical Aspects of Com-
puter Science. LIPIcs, vol. 14, pp. 326–337. Schloss Dagstuhl, Leibniz-Zentrum fuer
Informatik (2012)
24. Ganian, R., Hliněný, P., Král’, D., Obdržálek, J., Schwartz, J., Teska, J.: FO model
checking of interval graphs. In: Fomin, F.V., Freivalds, R., Kwiatkowska, M., Peleg,
D. (eds.) ICALP 2013, Part II. LNCS, vol. 7966, pp. 250–262. Springer, Heidelberg
(2013)
25. Grohe, M.: Generalized model-checking problems for first-order logic. In: Ferreira,
A., Reichel, H. (eds.) STACS 2001. LNCS, vol. 2010, pp. 12–26. Springer, Heidel-
berg (2001)
26. Grohe, M.: Logic, graphs, and algorithms. In: Flum, J., Grädel, E., Wilke, T. (eds.)
Logic and Automata – History and Perspectives. Texts in Logic and Games, vol. 2,
pp. 357–422. Amsterdam University Press (2007)
27. Grohe, M., Kawarabayashi, K., Reed, B.: A simple algorithm for the graph minor
decomposition – logic meets structural graph theory. In: Proceedings of the 24th
Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 414–431 (2013)
28. Grohe, M., Kreutzer, S.: Methods for algorithmic meta theorems. In: Grohe, M.,
Makowsky, J. (eds.) Model Theoretic Methods in Finite Combinatorics. Contem-
porary Mathematics, vol. 558, pp. 181–206. American Mathematical Society (2011)
29. Grohe, M., Kreutzer, S., Siebertz, S.: Characterisations of nowhere denese graphs.
In: Seth, A., Vishnoi, N. (eds.) Proceedings of the 32nd IARCS Annual Conference
on Foundations of Software Technology and Theoretical Computer Science. LIPIcs,
vol. 24, pp. 21–40. Schloss Dagstuhl, Leibniz-Zentrum fuer Informatik (2013)
30. Grohe, M., Kreutzer, S., Siebertz, S.: Deciding first-order properties of nowhere
dense graphs. In: Proceedings of the 46th ACM Symposium on Theory of Com-
puting (2014)
22 M. Grohe
31. Kazana, W., Segoufin, L.: First-order query evaluation on structures of bounded
degree. Logical Methods in Computer Science 7(2) (2011)
32. Kazana, W., Segoufin, L.: Enumeration of first-order queries on classes of struc-
tures with bounded expansion. In: Proceedings of the 32nd ACM Symposium on
Principles of Database Systems, pp. 297–308 (2013)
33. Kreutzer, S.: Algorithmic meta-theorems. In: Esparza, J., Michaux, C., Steinhorn,
C. (eds.) Finite and Algorithmic Model Theory. London Mathematical Society
Lecture Note Series, ch. 5, pp. 177–270. Cambridge University Press (2011)
34. Kreutzer, S., Tazari, S.: Lower bounds for the complexity of monadic second-order
logic. In: Proceedings of the 25th IEEE Symposium on Logic in Computer Science,
pp. 189–198 (2010)
35. Kreutzer, S., Tazari, S.: On brambles, grid-like minors, and parameterized in-
tractability of monadic second-order logic. In: Proceedings of the 21st Annual
ACM-SIAM Symposium on Discrete Algorithms, pp. 354–364 (2010)
36. Kreutzer, S.: On the parameterised intractability of monadic second-order logic.
In: Grädel, E., Kahle, R. (eds.) CSL 2009. LNCS, vol. 5771, pp. 348–363. Springer,
Heidelberg (2009)
37. Langer, A., Reidl, F., Rossmanith, P., Sikdar, S.: Evaluation of an mso-solver.
In: Proceedings of the 14th Meeting on Algorithm Engineering & Experiments,
pp. 55–63 (2012)
38. Nešetřil, J., Ossona de Mendez, P.: On nowhere dense graphs. European Journal
of Combinatorics 32(4), 600–617 (2011)
39. Nešetřil, J., Ossona de Mendez, P.: Sparsity. Springer (2012)
40. Papadimitriou, C., Yannakakis, M.: Optimization, approximation, and complexity
classes. Journal of Computer and System Sciences 43, 425–440 (1991)
41. Seese, D.: Linear time computable problems and first-order descriptions. Mathe-
matical Structures in Computer Science 6, 505–526 (1996)
The Lattice of Definability.
Origins, Recent Developments,
and Further Directions
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 23–38, 2014.
c Springer International Publishing Switzerland 2014
24 A. Semenov, S. Soprunov, and V. Uspensky
In our short historical survey we use materials from [BuDa, Smi, Hod].
We try to trace back original sources and motivations. In some important cases
understanding of problems and meaning of notions were changed considerably
The Lattice of Definability 25
over time. It is important to consider original ideas along with their maturity 30
years and even much later. As we will see the scene of events was pretty much
international.
Theorem 1. [Sem] There are definability spaces of any finite or countable width.
These “four types of order” will play special role in the further developments
discussed in the present paper.
The Lattice of Definability 27
Indirectly the notion of truth and even more indirectly definability were present
from beginning of 1900 -s and even earlier. For example he word “satisfy” in this
context may be due to Huntington (for example in [Hun2]). We mentioned works
of Löwenheim and Skolem.
But only the formal (“usual” inductive) definition of truth by Tarski gives the
modern (model-theoretic) understanding of semantics of a formula as a relation
over a domain [Tar].
Complications in understanding today of Tarski and Lindenbaum meaning of
Padoa’s method (relevant for our considerations) are discussed in [Hod1].
– Q; < – 0.
– Dense order [0, 1] – 0 (if we include these elements into signature).
28 A. Semenov, S. Soprunov, and V. Uspensky
– Z; +1 – 1.
– Presburger arithmetic – 1. Linear forms, congruences module m
can be introduced via existential quantifiers. Extensions of + with
rapidly growing functions [Sem1].
– Tarski algebra – 1. Again, polynomials can be explained with exis-
tential quantifiers only.
– Skolem arithmetic – 1.
– Multiple successor arithmetic (automata proofs) – 1.
– Arithmetic of + and × – infinity.
A priory the length of the hierarchy for the space S can depend of the choice
of (finite) F .
Problem 1. Can the hierarchy length be really different for different choices of
F?
Definition 2. The depth of a definability space is the minimal (over all finite
sets of generators) length of the quantifier hierarchy for it.
In [Sem] a problem on existing of other options was formulated. The answer was
obtained in 2010:
2.6 Decidability
Decidability in the sense of existing an algorithm to decide is a statement (closed
formula) true or false was a key question of study. For example, Tarski result on
the field of reals implies the decidability of Geometry. The decidability results
for multiple successor arithmetic led Elgot and Rabin to the following problem
Problem 4. [ElRa] Does there exist a structure with maximally decidable theory?
can be expanded by some constant in such a way that the resulting structure
still has a decidable theory. They answer this question negatively by proving
that there exists a structure M with a decidable theory (even monadic theory)
and such that any expansion of M by a constant has an undecidable theory.
In [BeCe1] they indicate a sufficient condition for a space with decidable
theory no to be maximal.
In our context it is natural to consider also decidability of elements of a
definability space. Of course we need a “constructivisation” of the domain D.
For example, we can take natural numbers as it.
Definition 3. We call a space decidable if all its elements are decidable. We call
a finitely generated space uniformly decidable if there is an algorithm providing
a decision procedure for any formula (using the generators) and any vector of
its arguments.
Problem 5. [Sem], 2003. Are there spaces of arbitrary finite or infinite depth
with decidable theory?
Problem 6. Are there decidable and uniformly decidable spaces of arbitrary finite
or infinite depth?
“At this time it might have seemed that most of the basic problems of el-
ementary axiom systems were solved. A more careful observer however,
upon reading the papers of Tarski [Tar2, Tar3], might have wondered
about the existence of general theorems which would explain elemen-
tary definability as the above theorems explain the basic properties of
elementary logical consequence.
One such theorem, the completeness, in the sense of definability, of
elementary logic was proved by Beth in 1953 [Bet]. In 1959 Svenonius
[Sve] published a further result on elementary definability. Just as with
the earlier results of Beth and Craig, logicians seem slow in recognizing
Svenonius’ theorem as a basic tool in the theory of definability, perhaps
because it is not generally known to be available.”
30 A. Semenov, S. Soprunov, and V. Uspensky
The idea here is to use an additional structure to the original one and consider
its elementary extensions. The additional structure narrows the class of exten-
sions and makes the extensions more comprehensible, so we can find the needed
automorphism.
In fact, we can use one universe only in a modification of the theorem as was
shown in [SeSo1].
By F we denote the set of everywhere defined functions f : N → D. If R is
n-ary relation on D and ϕ is a mapping F → F then we say that ϕ almost
preserves R if {i | R(f1 (i), . . . , fn (i)) ≡ R(ϕ(f1 )(i), . . . , ϕ(fn )(i))} is finite for
any f1 , . . . , fn in Dom(ϕ).
The remarkable feature of this form of Svenonius Theorem is that the condition
(2) is purely combinatorial, not appealing to any logical language.
Numerous results were devoted to the study of specific definability spaces. For
example, Inan Korec in [Kor] surveyed different natural generation sets for the
definability space generated by addition and multiplication of integers.
Cobham — Semenov’s theorem [Sem2] states that nontrivial intersection of
spaces generated by automata working in different bases should be exactly the
space generated by +. (This will be considered later in the context of self-
definability of Muchnik.)
The Lattice of Definability 31
S(x, y, z) ≡ (z=(x+y)/2) (or, the same, the structure Q; f (x, y, z) where
f (x, y, z) = x−y+z) admits no definable reduct. Though Svenonious theorem
is not used explicitly in the proof, the approach is rather similar. They note that
the structure Q<ω ; + is the saturated elementary extension of the Q; +, so
it’s enough to consider permutations of the structure Q<ω ; + only. Now the
fact that Aut(Q<ω ; f ) is maximal closed nontrivial subgroup (proved in the
same paper) is used.
The structure Z; +1 — integer numbers with the successor relation is not
ω-categorical, and has depth 1. For any natural number n we define spaces by
their generators
“x1 −x2 = n” — An ,
“x1 −x2 = x3 −x4 = n ∨ x1 −x2 = x3 −x4 = −n” — Bn , and
“|x1 −x2 | = n” — Cn .
Problem 10. Describe the lattice of subspaces for natural numbers with multiple
successors.
We leave out the researches on the reducts of the field of real [MaPe, Pet] and
complex [MaPi] numbers.
References
[Add] Addison Jr., J.W.: The undefinability of the definable. Notices Amer. Math.
Soc. 12, 347 (1965)
[AhZi] Ahlbrandt, G., Ziegler, M.: Invariant subgroups of V V . J. Algebra 151(1),
26–38 (1992)
[BeCe] Bès, A., Cégielski, P.: Weakly maximal decidable structures. RAIRO - The-
oretical Informatics and Applications 42(1), 137–145 (2008)
[BeCe1] Bès, A., Cégielski, P.: Nonmaximal decidable structures. Journal of Mathe-
matical Sciences 158(5), 615–622 (2009)
[Bet] Beth, E.W.: On Padoa’s method in the theory of definition. Indag. Math. 15,
330–339 (1953)
[BoMa] Bodirsky, M., Macpherson, D.: Reducts of structures and maximal-closed
permutation groups. arXiv:1310.6393. (2013)
[Boo] Boole, G.: The mathematical analysis of logic. Philosophical Library (1847)
[BoPiPo] Bodirsky, M., Pinsker, M., Pongrácz, A.: The 42 reducts of the random or-
dered graph. arXiv:1309.2165 (2013)
[BoPiTs] Bodirsky, M., Pinsker, M., Tsankov, T.: Decidability of definability. In:
26th Annual IEEE Symposium on Logic in Computer Science (LICS). IEEE
(2011)
[BuDa] Buchi, J.R., Danhof, K.J.: Definibility in normal theories. Israel Journal of
Mathematics 14(3), 248–256 (1973)
[Cam] Cameron, P.J.: Aspects of infinite permutation groups. London Mathematical
Society Lecture Note Series 339, 1 (2007)
[Cam1] Cameron, P.J.: Transitivity of permutation groups on unordered sets. Math-
ematische Zeitschrift 148(2), 127–139 (1976)
[ElRa] Elgot, C.C., Rabin, M.O.: Decidability and Undecidability of Extensions of
Second (First) Order Theory of (Generalized) Successor. J. Symb. Log. 31(2),
169–181 (1966)
[Fra] Frasnay, C.: Quelques problèmes combinatoires concernant les ordres totaux
et les relations monomorphes. Annales de l’ institut Fourier 15(2). Institut
Fourier (1965)
36 A. Semenov, S. Soprunov, and V. Uspensky
[SeSo] Semenov, A., Soprunov, S.: Finite quantifier hierarchies in relational alge-
bras. Proceedings of the Steklov Institute of Mathematics 274(1), 267–272
(2011)
[SeSo1] Semenov, A.L., Soprunov, S.F.: Remark on Svenonius theorem.
arXiv:1301.2412 (2013)
[SeSo2] Semenov, A.L., Soprunov, S.F.: Lattice of relational algebras definable in
integers with successor. arXiv:1201.4439 (2012)
[Sko] Skolem, T.: Logisch-kombinatorische Untersuchungen über die Erfullbarkeit
oder Beweisbarkeit mathematischer Sdtze nebst einem Theorem über dichte
Mengen. Videnskapsselskapets skrifter. I. Matematisk-naturvidenskabelig
klasse 4 (1920)
[Sko1] Skolem, T.: Über gewisse Satzfunktionen in der Arithmetik. Skrifter utgit av
Videnskapsselskapet i Kristiania, I. klasse 7 (1930)
[Smi] Smith, J.T.: Definitions and Nondefinability in Geometry. The American
Mathematical Monthly 117(6), 475–489 (2010)
[Sop] Soprunov, S.: Decidable expansions of structures. Vopr. Kibern. 134, 175–179
(1988) (in Russian)
[Sve] Svenonius, L.: A theorem on permutations in models. Theoria 25(3), 173–178
(1959)
[Tan] Tanaka, H.: Some results in the effective descriptive set theory. Publications
of the Research Institute for Mathematical Sciences 3(1), 11–52 (1967)
[Tar] Tarski, A.: The Concept of Truth in Formalized Languages. In: Alfred Tarski:
Logic, Semantics, Metamathematics. Trans. J. H. Woodger, second edition
ed. and introduced by John Corcoran, Hackett, Indianapolis, 152–278 (1983)
[Tar1] Tarski, A.: A Decision Method for Elementary Algebra and Geometry Re-
port R-109 (second revised edn.). The Rand Corporation, Santa Monica, CA
(1951)
[Tar2] Tarski, A.: Der Wahrheitsbegriff in den formalisierten Sprachen. Studia
Philosophica 1 (1935); reprinted in Tarski 2, 51–198 (1986)
[Tar3] Tarski, A.: Einige methodologifche Unterfuchungen über die Definierbarkeit
der Begriffe. Erkenntnis 5(1), 80–100 (1935)
[Tar4] Tarski, A.: What are logical notions? History and Philosophy of Logic 7(2),
143–154 (1986)
[Tho] Thomas, S.: Reducts of random hypergraphs. Annals of Pure and Applied
Logic 80(2), 165–193 (1996)
[Tho1] Thomas, S.: Reducts of the random graph. Journal of Symbolic Logic 56(1),
176–181 (1991)
[Win] Winkler, P.: Random structures and zero-one laws. Finite and infinite com-
binatorics in sets and logic, pp. 399–420. Springer, Netherlands (1993)
Counting Popular Matchings
in House Allocation Problems
1 Introduction
A popular matching problem instance I comprises a set A of agents and a set H
of houses. Each agent a in A ranks (numbers) a subset of houses in H (lower
rank specify higher preference). The ordered list of houses ranked by a ∈ A is
called a’s preference list. For an agent a, let Ea be the set of pairs (a, h) such that
the house h appears on a’s preference list. Define E = ∪a∈A Ea . The problem
instance I is then represented by a bipartite graph G = (A ∪ H, E). A matching
M of I is a matching of the bipartite graph G. We use M (a) to denote the house
assigned to agent a in M and M (h) to denote the agent that is assigned house h
in M . An agent prefers a matching M to a matching M if (i) a is matched in M
and unmatched in M , or (ii) a is matched in both M and M but a prefers the
house M (a) to M (a). Let φ(M, M ) denote the number of agents that prefer M
to M . We say M is more popular than M if φ(M, M ) > φ(M , M ), and denote
it by M M . A matching M is called popular if there exists no matching M
such that M M .
The popular matching problem was introduced in [5] as a variation of the
stable marriage problem [4]. The idea of popular matching has been studied
extensively in various settings in recent times [1,14,12,10,8,11,13], mostly in the
context where only one side has preference of the other side but the other side
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 39–51, 2014.
c Springer International Publishing Switzerland 2014
40 R. Acharyya, S. Chakraborty, and N. Jha
has no preference at all. We will also focus on this setting. Much of the earlier
work focuses on finding efficient algorithms to output a popular matching, if one
exists.
The problem of counting the number of “solutions” to a combinatorial ques-
tion falls into the complexity class #P. An area of interest that has recently gath-
ered a certain amount of attention is the problem of counting stable matchings
in graphs. The Gale-Shapely algorithm [4] gives a simple and efficient algorithm
to output a stable matching, but counting them was proved to be #P-hard in
[6]. Bhatnagar, Greenberg and Randall [2] showed that the random walks on the
stable marriage lattice are slowly mixing, even in very restricted versions of the
problem. [3] gives further evidence towards the conjecture that there may not
exist an FPRAS at all for this problem.
Our motivation for this study is largely due to the similarity of structures
between stable matchings and popular matchings (although no direct relation-
ship is known). The interest is further fueled by the existence of a linear time
algorithm to exactly count the number of popular matchings in the standard set-
ting [12]. We look at generalizations of the standard version - preferences with
ties and houses with capacities. In the case where preferences could have ties, it
is already known that the counting version is #P-hard [13]. We give an FPRAS
for this problem. In the case where houses have capacities, we prove that the
counting version is #P-hard. While the FPRAS for the case of ties is achieved
via a reduction to a well known algorithm, the #P-hardness for the capacitated
case is involving, making it the more interesting setting of the problem.
We now formally describe the different variants of the popular matching prob-
lem (borrowing the notation from [14]) and also describe our results alongside.
A H
..
Ul . Ur
..
Ol .
Er
..
. Or
El
For each agent a, define s(a) to be a’s most preferred house(s) in Er . Note that
s(a) always exists after the inclusion of last-resort houses l(a). The following is
proved in [1].
Counting Popular Matchings in House Allocation Problems 43
We now give an FPRAS for counting the number of popular matchings in the
case of ties. As before, let G = (A ∪ H, E) be our HAT instance. We assume
that that G admits at least one popular matching (this can be tested using
the characterization). We reduce our problem to the problem of counting perfect
matchings in a bipartite graph. We start with the first-choice graph G1 of G, and
perform a Gallai-Edmonds decomposition of G1 using any maximum matching
of G1 . In order to get a perfect matching instance, we extend the structure
obtained from Gallai-Edmonds decomposition described in Figure 1. Let F be
the set of f -houses and S be the set of s-houses. We make use of the following
observations in the decomposition.
— Every agent in Ul and Ol gets one of their first-choice houses in every popular
matching.
— Er can be further partitioned into the following sets:
– Erf := {h ∈ F ∩ S, h ∈ Er },
– Ers := {h ∈ F ∩ S, h ∈ Er },
f /s
– Er := {h ∈ F ∩ S, h ∈ Er }, and
– Er := {h ∈
/ F ∪ S, h ∈ Er }.
f /s
— Ol can only match with houses in Erf ∪ Er in every popular matching.
These observations are described in Figure 2(a).
Next, we observe that every agent in El that is already not matched to a house
f /s
in Or , must match to a house in Ers ∪ Er . We facilitate this by adding all edges
(a, s(a)) for each agent in El . Finally, we add a set of dummy agent vertices D on
the left side to balance the bipartition. The size of D is |A| − (|H| − |Er |). This
difference is non-negative as long as the preference-lists of agents are complete.
f /s
We make the bipartition (D, Erf ∪Er ∪Ers ) a complete bipartite graph by adding
the appropriate edges. This allows us to move from one popular matching to
another by switching between first and second-choices and, among second choices
of agents. Finally, we remove set Er from the right side. The new structure is
described in Figure 2(b). Denote the new graph by G .
A H A H
.. ..
Ul . Ur Ul . Ur
.. ..
Ol . Erf Ol . Erf
f /s f /s
Er Er
Er Er
..
Ers D . Ers
Er ..
.
.. ..
. Or . Or
El El
We now make use of the following result of Jerrum et al. from [7].
Lemma 6. (Theorem 1.1 in [7]). There exists an FPRAS for the problem of
counting number of perfect matchings a bipartite graph.
Theorem 1. There exists an FPRAS for counting the number of popular match-
ings in the House Allocation problem with Ties.
its preference list. The preference list of ai ∈ A defines a set of edges Ei from
ai to houses in H. Define E = ∪i∈[n] Ei . The problem instance I can then be
represented by a bipartite graph G = (A ∪ H, E).
For the instance I, a matching M is a subset of E such that each agent appears
in at most one edge in M and each house h appears in at most c(h) edges in M .
The definitions of more popular than relationship between two matchings and
popular matching is same as described earlier in Section 1.
We now outline a characterization of popular matchings in CHA from [14].
As before, denote by f (a) the first choice of an agent a ∈ A. A house which is
the first choice of at least one agent is called an f -house. For each house h ∈ H,
define f (h) = {a ∈ A, f (a) = h}. For each agent a ∈ A, we add a unique
last-resort house l(a) with least priority and capacity 1.
For each agent a ∈ A, define s(a) to be the highest ranked house h on a’s
preference list such that one of the following is true:
Notice that s(a) always exists after the inclusion of last-resort houses l(a). The
following lemma gives the characterization of popular matchings in G.
Reduction(S):
1. while (there exists a switching cycle C in S):
let S := S \ C
2. while (S is non-empty):
(a) find a longest path P in S which alternates between weights +1 and −1
(b) let S := S \ P
48 R. Acharyya, S. Chakraborty, and N. Jha
At the end of every iteration of the while loop in Step 1, Lemma 9 still holds
true. We now prove a very crucial invariant of the while loop in Step 2.
Lemma 10. In every iteration of the while loop in Step 2 of the algorithm
Reduction, the longest path in step 2(a) is a switching path for GM .
Proof. Let us denote the stages of the run of algorithm Reduction by t. Initially,
at t = 0, before any of the while loops run, S is exactly the difference of edges
in EM and EM . Let the while loop in Step 1 runs t1 times and the while loop
in Step 2 runs t2 times.
Let the current stage be t = t1 + i. Let P be the maximal path in step 2(a) at
this stage. We show that P starts with an edge of weight +1. For contradiction,
let (hi , hj ) be an edge of weight −1 and that this is the first edge of path P . Let
aij be the agent associated with the edge (hi , hj ).
The Property 5 of switching sets precludes any incoming edge of weight −1
on the vertex hi . Hence, no switching path could have ended at hi at any stage
t < t1 + i. Similarly, no switching cycle with an incoming edge −1 was incident
on hi at an earlier stage.
Let us assume that there were r cycles that were incident at hi at t = 0. At
stage t = t1 + i, let the number of outgoing −1 edges be m. Hence at t = 0,
hi had r incoming +1 edges and r + m outgoing −1 edges. But this would also
imply that at t = 0, hi had r + m incoming +1 edges in GM . This contradicts
Property 2, requiring the number of incoming +1 edges to be constant in the
switching graphs corresponding to different popular matchings.
A similar argument can be made for the fact that the path P can only end at
an edge with weight −1 and that P ends at an unsaturated vertex.
Proof.
(i) We verify that the new matching generated by applying a switching move on
GM satisfies the characterization in Lemma 8. Call the new switching graph
GM and the associated matching M . First, observe that M is indeed an
agent complete matching since GM still has a directed edge for each agent
in A. Next, each agent a is still matched to f (a) or s(a) as the switching
move either reverses an edge of GM or leaves it as it is. Finally, for each
house h, f (h) ⊆ M (h) if |f (h)| < c(h) and |M (h)| = c(h) with M (h) ⊆
f (h) otherwise. This is true because |M (h)| = |M (h)|, by the definition of
switching moves.
(ii) This is implied by Theorem 2.
Counting Popular Matchings in House Allocation Problems 49
Using this information, we can create the description of the instance I so that it
meets our requirement. For simplicity, we assume G to be connected (as isolated
vertices do not affect the count). We orient all the edges of G from A to B and
call the directed graph G = (A ∪ B, E ). Using G , we construct a graph S,
which will be the switching graph.
Let |A| = n1 , |B| = n2 and |E | = m. S is constructed by augmenting G .
We keep all the vertices and edges of G in S and assign each edge a weight of
−1. Further, for each vertex u ∈ A, add a copy u and add a directed edge from
u to u, and assign a weight of +1 to the edge. Call the new set of vertices A .
The sets A and B contain s-houses and the set A contains f -houses. We label
every vertex in A and A as saturated and for each vertex v in B, we label v
as unsaturated with unsaturation degree 1. Hence, the switching graph S has
2n1 + n2 vertices and n1 + m edges.
The CHA instance I corresponding to the switching graph S has 2n1 + n2
houses and n1 + m agents. Each agent has a preference list of length 2 that is
naturally defined by the weight of edges in S.
Let the popular matching represented by S be Mφ . This corresponds to the
empty matching of G. Every non-empty matching of G can be obtained by a
switching move on S. We make this more explicit in the following theorem.
For the converse, observe that S can only have switching paths of length 2
and it has no switching cycles. An edge disjoint set of such paths corresponds
to a matching of G. By the definition of S, it’s easy to see every matching in M
can be obtained by a switching set of S.
Conclusions and Acknowledgement: We obtained an FPRAS for the #P-hard
problem of counting popular matchings where instances could have ties. We
presented a switching graph characterization for Capacitated House Allocation
problem. Though our motivation for studying this structure was to prove a hard-
ness result for counting popular matchings in CHA, the characterization may
itself be of importance to many other problems of interest. This also completes
the picture of House Allocation problems to a wider extent as such characteriza-
tions were only known for HA and HAT instances. We believe that this structure
could be used to give an FPRAS for the case of CHA. This remains an open
question.
We thank Meghana Nasre for fruitful discussions. We also thank anonymous
reviewers for their input.
References
1. Abraham, D.J., Irving, R.W., Kavitha, T., Mehlhorn, K.: Popular matchings.
SIAM J. Comput. 37(4), 1030–1045 (2007)
2. Bhatnagar, N., Greenberg, S., Randall, D.: Sampling stable marriages: why spouse-
swapping won’t work. In: SODA, pp. 1223–1232 (2008)
3. Chebolu, P., Goldberg, L.A., Martin, R.A.: The complexity of approximately count-
ing stable matchings. In: Serna, M., Shaltiel, R., Jansen, K., Rolim, J. (eds.)
APPROX 2010. LNCS, vol. 6302, pp. 81–94. Springer, Heidelberg (2010)
4. Gale, D., Shapley, L.S.: College admissions and the stability of marriage. The
American Mathematical Monthly 69(1), 9–15 (1962)
5. Gärdenfors, P.: Match making: assignments based on bilateral preferences. Behav-
ioral Science 20(3), 166–173 (1975)
6. Irving, R.W., Leather, P.: The complexity of counting stable marriages. SIAM J.
Comput. 15(3), 655–667 (1986)
7. Jerrum, M., Sinclair, A., Vigoda, E.: A polynomial-time approximation algorithm
for the permanent of a matrix with non-negative entries. In: STOC, pp. 712–721
(2001)
8. Kavitha, T., Mestre, J., Nasre, M.: Popular mixed matchings. Theor. Comput.
Sci. 412(24), 2679–2690 (2011)
9. Lovász, L., Plummer, M.D.: Matching theory. North-Holland Mathematics Studies,
vol. 121. North-Holland Publishing Co., Amsterdam (1986), Annals of Discrete
Mathematics, 29
10. Mahdian, M.: Random popular matchings. In: ACM Conference on Electronic
Commerce, pp. 238–242 (2006)
11. McCutchen, R.M.: The least-unpopularity-factor and least-unpopularity-margin
criteria for matching problems with one-sided preferences. In: Laber, E.S., Born-
stein, C., Nogueira, L.T., Faria, L. (eds.) LATIN 2008. LNCS, vol. 4957, pp. 593–604.
Springer, Heidelberg (2008)
Counting Popular Matchings in House Allocation Problems 51
12. McDermid, E., Irving, R.W.: Popular matchings: structure and algorithms. J.
Comb. Optim. 22(3), 339–358 (2011)
13. Nasre, M.: Popular matchings: Structure and cheating strategies. In: STACS,
pp. 412–423 (2013)
14. Sng, C.T.S., Manlove, D.: Popular matchings in the weighted capacitated house
allocation problem. J. Discrete Algorithms 8(2), 102–116 (2010)
Vertex Disjoint Paths in Upward Planar Graphs
Abstract. The k-vertex disjoint paths problem is one of the most stud-
ied problems in algorithmic graph theory. In 1994, Schrijver proved that
the problem can be solved in polynomial time for every fixed k when
restricted to the class of planar digraphs and it was a long standing open
question whether it is fixed-parameter tractable (with respect to param-
eter k) on this restricted class. Only recently, Cygan et al. [5] achieved
a major breakthrough and answered the question positively. Despite the
importance of this result, it is of rather theoretical importance. Their
proof technique is both technically extremely involved and also has a
doubly exponential parameter dependence. Thus, it seems unrealistic
that the algorithm could actually be implemented. In this paper, there-
fore, we study a smaller but well studied class of planar digraphs, the
class of upward planar digraphs which can be drawn in a plane such that
all edges are drawn upwards. We show that on this class the problem
(i) remains NP-complete and (ii) problem is fixed-parameter tractable.
While membership in FPT follows immediately from [5]’s general result,
our algorithm is very natural and has only singly exponential parameter
dependence and linear dependence on the graph size, compared to the
doubly exponential parameter dependence and much higher polynomial
dependence on the graph size for general planar digraphs. Furthermore,
our algorithm can easily be implemented, in contrast to the algorithm
in [5].
1 Introduction
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 52–64, 2014.
c Springer International Publishing Switzerland 2014
Vertex Disjoint Paths in Upward Planar Graphs 53
every directed edge points “upward”, i.e. each directed edge is represented by a
curve that is monotone increasing in the y direction. Upward planar digraphs are
very well studied in a variety of settings, in particular in graph drawing applica-
tions (see e.g. [2]). In contrast to the problem of finding a planar embedding for a
planar graph, which is solvable in linear time, the problem of finding an upward
planar embedding is NP-complete in general [11]. Much work has gone into find-
ing even more restricted classes inside the upward planar class that allow to find
such embeddings in polynomial time [4,3,15].
By definition, upward planar graphs are acyclic graphs. Hence, by the above
results, the k-vertex disjoint paths problem can be solved in polynomial time on
upward planar graphs for any fixed k. As a first result in this paper we show
that the problem remains NP-complete on upward planar graphs, i.e. that we
cannot hope to find a general polynomial-time algorithm. Our construction even
shows that the problem is NP-complete on directed grid graphs.
Our second result is that the problem is fixed-parameter tractable with re-
spect to parameter k on the class of upward planar digraphs if we are given an
upward planar graph together with an upward planar embedding. We present
a linear time algorithm that has single exponential parameter dependency. The
idea of our algorithm is straight forward but the proof of its correctness requires
some work.
2 Preliminaries
By N we denote the set of non-negative integers and for n ∈ N, we write [n] for
the set {1, . . . , n}. We assume familiarity with the basic concepts from (directed)
graph theory, planar graphs and graph drawings and refer the reader to [1,2,6]
for more details. For background on parameterized complexity theory we refer
the reader to [7].
An embedding of a graph G = (V, E) in the real plane is a mapping ϕ that
maps vertices v ∈ V to points ϕv ∈ R2 and edges e = (u, v) ∈ A to continuous
functions ϕe : [0, 1] → R2 such that ϕe (0) = φu and ϕe (1) = ϕv . A plane
embedding is an embedding such that ϕe (z) = ϕe (z ) if z, z ∈ {0, 1} for all
e = e ∈ E. An upward plane embedding is a plane embedding such that every
edge is drawn “upward”, i.e. for all edges e ∈ A, if ϕe (z) = (x, y), ϕe (z ) = (x , y )
and z > z, then y ≥ y. An upward planar graph is a graph that has an upward
plane embedding. To improve readability, we will draw all graphs in this paper
from left to right, instead of upwards.
The k-vertex disjoint paths problem on upward planar graphs is the following
problem.
3 NP-Completeness of UpPlan-VDPP
Before we formally prove the theorem, we give a brief and informal overview
of the proof structure. The proof of NP-completeness is by a reduction from
SAT, the satisfiability problem for propositional logic, which is well-known to
be NP-complete [10]. On a high level, our proof method is inspired by the NP-
completeness proof in [13] but the fact that we are working in a restricted class
of planar graphs requires a number of changes and additional gadgets.
Let V = {V1 , . . . , Vn } be a set of variables and C = {C1 , . . . , Cm } be a set of
clauses over the variables from V. For 1 ≤ i ≤ m let Ci = {Li,1 , Li,2 , . . . , Li,ni }
where each Li,t is a literal, i.e. a variable or the negation thereof. We will con-
struct an upward planar graph GC = (V, E) together with a set of pairs of
vertices in GC such that GC contains a set of pairwise vertex disjoint directed
paths connecting each source to its corresponding target if, and only if, C is
satisfiable. The graph GC is roughly sketched in Fig. 1.
C1 C2 Cm
C1 C2
Cm
We will have the source/target pairs (Vi , Vi ) ∈ V 2 for i ∈ [n] and (Cj , Cj ) ∈
V for j ∈ [m], as well as some other source/target pairs inside the gadgets
2
Gi,j,t that guarantee further properties. As the picture suggests, there will be
two possible paths from Vi to Vi , an upper path and a lower path and our
construction will ensure that these paths cannot interleave. Any interpretation
of the variable Vi will thus correspond to the choice of a unique path from Vi to
Vi . Furthermore, we will ensure that there is a path from Cj to Cj if and only
if some literal is interpreted such that Cj is satisfied under this interpretation.
56 S.A. Amiri et al.
We need some additional gadgets which we describe first to simplify the pre-
sentation of the main proof.
Routing Gadget: The rôle of a routing gadget is to act as a planar routing
device. It has two incoming connections, the edges et from the top and el from
the left, and two outgoing connections, the edges eb to the bottom and er to the
right. The gadget is constructed in a way that in any solution to the disjoint
paths problem it allows for only two ways of routing a path through the gadget,
either using et and eb or el and er .
⇓ et ⇓
et
el er 2
⇒ ⇒ 1
2 1
eb ⇓
e1
⇒ el e3
e4 er ⇒
e2
3 4
4 3
eb
⇓
Fig. 2. The routing gadget. In the following, when a routing gadget appears as a
subgadget in a figure, it will be represented by a black box as shown on the left.
Formally, the gadget is defined as the graph displayed in Fig. 2 with source/tar-
get pairs (i, i) for i ∈ [4]. Immediately from the construction of the gadget we
get the following lemma which captures the properties of routing gadgets needed
in the sequel.
Lemma 3.2. Let R be a routing gadget with source/target pairs (i, i) for i ∈ [4].
Crossing Gadget: A crossing gadget has two incoming connections to its left
via the vertices H in and Lin and two outgoing connections to its right via the
vertices H out and Lout . Furthermore, it has one incoming connection at the
Vertex Disjoint Paths in Upward Planar Graphs 57
top via the vertex T and outgoing connection at the bottom via the vertex B.
Intuitively, we want that in any solution to the disjoint paths problem, there is
exactly one path P going from left to right and exactly one path P going from
top to bottom. Furthermore, if P enters the gadget via H in then it should leave
it via H out and if it enters the gadget via Lin then it should leave it via Lout . Of
course, in a planar graph there cannot be such disjoint paths P, P as they must
cross at some point. We will have to split one of the paths, say P , by removing
the outward source/sink pair and introducing two new source/sink pairs, one to
the left of P and one to its right.
e+
m1
e−
H in b1 m2 m4 b4 m7 m9 H out
b3 b6
X W m0 Z Y
b2 b5
m12
Formally, the gadget is defined as the graph displayed in Fig. 3. The following
lemma follows easily from Lemma 3.2.
The next lemma shows that we can connect crossing gadgets in rows in a useful
way. It follows easily by induction from Lemma 3.3.
58 S.A. Amiri et al.
Lemma 3.4. Let G be a row of crossing gadgets. Then both associated vertex
disjoint paths problems Pr+ , Pr− have unique solutions. For all i ∈ [t − 1], each
path in the solution of Pr+ from Zi to Wi+1 passes through Hi+1in
and each path
−
in the solution of Pr from Zi to Wi+1 passes through Li+1 .
in
The next lemma shows that we can force a relation between rows and columns
of crossing gadgets.
Let G1 , . . . , Gt be a sequence of crossing gadgets drawn from top to bottom in
that order. For each i ∈ [t − 1], we add the edge (Bi , Ti+1 ) and call the resulting
graph a column of crossing gadgets. We equip this graph with the source/target
pairs (Xi , Yi ) for i ∈ [t] and with the pair (T1 , Bt ) to obtain an associated vertex
disjoint paths problem P.
Note that the paths Pi as stated in the lemma exist and they are uniquely
determined by Lemma 3.3.
We are now ready to construct a vertex disjoint paths instance for any SAT
instance C.
– For j ∈ [m], t ∈ [nj ] we add the edges (Cj , T1,j,t ) and (Bn,j,t , Cj ).
– Finally, we delete the edge e+ for all i ∈ [n], j ∈ [m], t ∈ [nj ] in Gi,j,t if
Lj,t is a variable and the edge e− if it is a negated variable.
We draw the graph GC as shown in Fig. 1.
2. We define the following vertex disjoint paths problem PC on GC . We add all
source/target pairs that are defined inside the routing gadgets. Furthermore:
– For i ∈ [n], j ∈ [m], t ∈ [nj − 1], we add the pairs
• (Vi , Wi,1,1 ),
• (Zi,m,nm , Vi ),
• (Xi,j,t , Yi,j,t ) and
• (Zi,j,t , Wi,j,t+1 ).
– For i ∈ [n], j ∈ [m − 1], we add the pairs (Zi,j,nj , Wi,j+1,1 ).
– For j ∈ [m], we add the pairs (Cj , Cj ).
The proof of the following theorem is based on the fact that in our construction,
edge e+ is present in gadget Gi,j,t , if and only if Cj does not contain variable Vi
negatively and e− is present in gadget Gi,j,t , if and only if Cj does not contain
variable Vi positively (especially, both edges are present if the clause does not
contain the variable at all). In particular, every column contains exactly one
gadget where one edge is missing. Now it is easy to conclude with Lemma 3.4
and Lemma 3.5.
Theorem 4.1. The problem UpPlan-VDPP can be solved in time O(k! · k · n),
where n := |V (G)|.
For the rest of the section we fix a planar upward graph G together with an
upward planar embedding and k pairs (s1 , t1 ), . . . , (sk , tk ) of vertices. We will not
distinguish notationally between G and its upward planar embedding. Whenever
we speak about a vertex v on a path P we mean a vertex v ∈ V (G) which is
contained in P . If we speak about a point on the path we mean a point (x, y) ∈ R2
60 S.A. Amiri et al.
which is contained in the drawing of P with respect to the upward planar drawing
of G. The algorithm is based on the concept of a path in G being to the right of
another path which we define next.
The next two lemmas follow immediately from the definition of upward planar
drawings.
Lemma 4.3. Let P and Q be vertex disjoint paths in an upward planar drawing
of G. Then either right(P ) ∩ Q = ∅ or left(P ) ∩ Q = ∅.
We show next that for every set P of pairwise vertex disjoint paths in G the
relation ≺∗ is a partial order on P. Towards this aim, we first show that ≺ is
irreflexive and anti-symmetric on P.
Proof. The first claim immediately follows from the definition of ≺. Towards
the second statement, suppose there are P1 , P2 ∈ P such that P1 ≺P P2 and
P2 ≺P P1 .
Hence, for j = 1, 2 and i = 1, 2 there are points pij = (xij , yji ) such that pij ∈ Pi
and x11 < x21 , y11 = y12 and x12 > x22 , y21 = y22 . W.l.o.g. we assume that y11 < y21 .
Let Q ⊆ P be the subpath of P from p11 to p12 , including the endpoints. Let
Q1 := {(x11 , z) : z < y11 } and Q2 := {(x12 , z) : z > y21 } be the two lines parallel to
the y-axis going from p11 towards negative infinity and from p12 towards infinity.
Vertex Disjoint Paths in Upward Planar Graphs 61
Then Q1 ∪ Q ∪ Q2 separates the plane into two disjoint regions R1 and R2 each
containing a point of P2 . As P1 and P2 are vertex disjoint but p21 and p22 are
connected by P2 , P2 must contain a point in Q1 or Q2 which, on P2 lies between
p21 and p22 . But the y-coordinate of any point in Q1 is strictly smaller than y12
and y22 whereas the y-coordinate of any point in Q2 is strictly bigger than y12
and y22 . This contradicts Lemma 4.4.
We use the previous lemma to show that ≺∗P is a partial order for all sets P of
pairwise vertex disjoint paths.
Lemma 4.7. Let P be a set of pairwise vertex disjoint directed paths. Then ≺∗P
is a partial order.
Proof. By definition, ≺∗P is transitive. Hence we only need to show that it is anti-
symmetric for which, by transitivity, it suffices to show that ≺∗P is irreflexive.
To show that ≺∗P is irreflexive, we prove by induction on k that if P0 , . . . , Pk ∈
P are paths such that P0 ≺P · · · ≺P Pk then Pk ≺P P0 . As for all P ∈ P,
P ≺P P , this proves the lemma.
Towards a contradiction, suppose the claim was false and let k be minimum
such that there are paths P0 , . . . , Pk ∈ P with P0 ≺P · · · ≺P Pk and Pk ≺P P0 .
By Lemma 4.6, k > 1.
k−2
Let R := i=0 right(Pi ). Note that k − 2 ≥ 0, so R is not empty. Furthermore,
as for all P, Q with P ≺ Q, right(P ) ∩ right(Q) = ∅, R is a connected region in
R2 without holes. Let L := k−1 i=1 left(Pi ). Again, as k > 1, L = ∅ and L is a
connected region without holes.
As Pk−2 ≺P Pk−1 , we have L ∩ R = ∅ and therefore L ∪ R separates the plane
into two unbounded regions, the upper region T and the lower region B.
The minimality of k implies that Pi ≺P Pk for all i < k − 1 and therefore
R ∩ Pk = ∅. Analogously, as Pk ≺P Pi for any i > 0, we have L ∩ Pk = ∅.
Hence, either Pk ⊆ B or Pk ⊆ T . W.l.o.g. we assume Pk ⊆ B. We will show that
left(P0 ) ∩ B = ∅.
Suppose there was a point (x, y) ∈ P and some x < x such that (x , y) ∈ B.
This implies that y < v for all (u, v) ∈ L. But this implies that B is bounded by
right(P0 ) and L contradicting the fact that right(Pk−1 ) ∩ B = ∅.
We have shown so far that ≺∗ is a partial order on every set of pairwise vertex
disjoint paths.
Remark 4.8. Note that if two paths P, Q ∈ P are incomparable with respect to
≺∗P then one path is strictly above the other, i.e. (right(P )∪left(P ))∩(right(Q)∪
left(Q)) = ∅. This is used in the next lemma.
Definition 4.9. Let s, t ∈ V (G) be vertices in G such that there is a directed
path from s to t. The right-most s-t-path in G is an s-t-path P such that for all
s-t-paths P , P ⊆ P ∪ right(P ).
Lemma 4.10. Let s, t ∈ V (G) be two vertices and let P be a path from s to t in
an upward planar drawing of G. If P is an s-t path such that P ∩ right(P ) = ∅
then there is an s-t path Q such that Q ⊆ P ∪ right(P ) and Q ∩ right(P ) = ∅.
62 S.A. Amiri et al.
The corollary states that between any two s and t, if there is an s-t path then
there is a rightmost one. The proof of Lemma 4.10 also indicates how such a
path can be computed. This is formalised in the next lemma.
Lemma 4.12. There is a linear time algorithm which, given an upward planar
drawing of a graph G and two vertices s, t ∈ V (G) computes the right-most
s-t-path in G, if such a path exists.
Proof. We first use a depth-first search starting at s to compute the set of ver-
tices U ⊆ V (G) reachable from s. Clearly, if t ∈ U then there is no s-t-path and
we can stop. Otherwise we use a second, inverse depth-first search to compute the
set U ⊆ U of vertices from which t can be reached. Finally, we compute the right-
most s-t path inductively by starting at s ∈ U and always choosing the right-most
successor of the current vertex until we reach t. The right-most successor is deter-
mined by the planar embedding of G. As G is acyclic, this procedure produces the
right-most path and can clearly be implemented in linear time.
We show next that in any solution P to the disjoint paths problem in an upward
planar digraph, if P ∈ P is a maximal element with respect to ≺∗P , we can
replace P by the right-most s-t path and still get a valid solution, where s and
t are the endpoints of P .
Lemma 4.13. Let G be an upward planar graph with a fixed upward planar
embedding and let (s1 , t1 ), . . . , (sk , tk ) be pairs of vertices. Let P be a set of
pairwise disjoint paths connecting (si , ti ) for all i. Let P ∈ P be path connecting
si and ti , for some i, which is maximal with respect to ≺∗P . Let P be the right-
most si − ti -path in G. Then P \ {P } ∪{P } is also a valid solution to the disjoint
paths problem on G and (s1 , t1 ), . . . , (sk , tk ).
The previous lemma yields the key to the proof of Theorem 4.1 :
Proof of Theorem 4.1. Let G with an upward planar drawing of G and k pairs
(s1 , t1 ), . . . , (sk , tk ) be given. To decide whether there is a solution to the disjoint
paths problem on this instance we proceed as follows. In the first step we compute
Vertex Disjoint Paths in Upward Planar Graphs 63
for each si the set of vertices reachable from si . If for some i this does not include
ti we reject the input as obviously there cannot be any solution.
In the second step, for every possible permutation π of {1, . . . , k} we proceed
as follows. Let i1 := π(k), . . . , ik := π(1) be the numbers 1 to k ordered as
indicated by π and let uj := sij and vj := tij , for all j ∈ [k]. We can view π as
a linear order on 1, . . . , k and for every such π we will search for a solution P of
the disjoint paths problem for which ≺∗P is consistent with π.
For a given π as above we inductively construct a sequence P0 , . . . , Pk of sets
of pairwise vertex disjoint paths such that for all i, Pi contains a set of i paths
P1 , . . . , Pi such that for all j ∈ [i] Pj links uj to vj . We set P0 := ∅ which
obviously satisfies the condition. Suppose for some 0 ≤ i < k, Pi has already
been constructed. To obtain Pi+1 we compute the right-most path linking ui+1
to vi+1 in the graph G\ Pi . By Lemma 4.12, this can be done in linear time for
each such pair (si+1 , ti+1 ). If there is such a path P we define Pi+1 := Pi ∪ {P }.
Otherwise we reject the input. Once we reach Pk we stop and output Pk as
solution.
Clearly, for every permutation π the algorithm can be implemented to run in
time O(k · n), using Lemma 4.12, so that the total running time is O(k! · k · n)
as required.
Obviously, if the algorithm outputs a set P of disjoint paths then P is indeed a
solution to the problem. What is left to show is that whenever there is a solution
to the disjoint path problem, then the algorithm will find one.
So let P be a solution, i.e. a set of k paths P1 , . . . , Pk so that Pi links si
to ti . Let ≤ be a linear order on {1, . . . , k} that extends ≺∗P and let π be
the corresponding permutation such that (u1 , v1 ), . . . , (uk , vk ) is the ordering
of (s1 , t1 ), . . . , (sk , tk ) according to ≤. We claim that for this permutation π the
algorithm will find a solution. Let P be the right-most uk -vk -path in G as com-
puted by the algorithm. By Lemma 4.13, P \ {Pk } ∪ P is also a valid solution so
we can assume that Pk = P . Hence, P1 , . . . , Pk−1 form a solution of the disjoint
paths problem for (u1 , v1 ), . . . , (uk−1 , vk−1 ) in G\ P . By repeating this argument
we get a solution P := {P1 , . . . , Pk } such that each Pi links ui to vi and is the
right-most ui -vi -path in G \ j>i Pj . But this is exactly the solution found by
the algorithm. This prove the correctness of the algorithm and concludes the
proof of the theorem.
We remark that we can easily extend this result to “almost upward planar”
graphs, i.e., to graphs such that the deletion of at most h edges yields an upward
planar graph. As finding an upward planar drawing of an upward planar graph
is NP-complete, this might be of use if we have an approximation algorithm that
produces almost upward planar embeddings.
5 Conclusion
In this paper we showed that the k-vertex disjoint paths problem is NP-complete
on a restricted and yet very interesting class of planar digraphs. On the other
64 S.A. Amiri et al.
References
1. Bang-Jensen, J., Gutin, G.Z.: Digraphs - Theory, Algorithms and Applications,
2nd edn. Springer (2010)
2. Battista, G.D., Eades, P., Tamassia, R., Tollis, I.G.: Graph Drawing: Algorithms
for the Visualization of Graphs. Prentice-Hall (1999)
3. Bertolazzi, P., Di Battista, G., Liotta, G., Mannino, C.: Upward drawings of tri-
connected digraphs. Algorithmica 12(6), 476–497 (1994)
4. Bertolazzi, P., Di Battista, G., Mannino, C., Tamassia, R.: Optimal upward pla-
narity testing of single-source digraphs. SIAM J. Comput. 27(1), 132–169 (1998)
5. Cygan, M., Marx, D., Pilipczuk, M., Pilipczuk, M.: The planar directed k-vertex-
disjoint paths problem is fixed-parameter tractable. In: 2013 IEEE 54th Annual
Symposium on Foundations of Computer Science, pp. 197–206 (2013)
6. Diestel, R.: Graph Theory, 3rd edn. Springer (2005)
7. Downey, R., Fellows, M.: Parameterized Complexity. Springer (1998)
8. Fortune, S., Hopcroft, J.E., Wyllie, J.: The directed subgraph homeomorphism
problem. Theor. Comput. Sci. 10, 111–121 (1980)
9. Ganian, R., Hliněný, P., Kneis, J., Langer, A., Obdržálek, J., Rossmanith, P.: On
digraph width measures in parameterized algorithmics. In: Chen, J., Fomin, F.V.
(eds.) IWPEC 2009. LNCS, vol. 5917, pp. 185–197. Springer, Heidelberg (2009)
10. Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory
of NP-Completeness. W.H. Freeman (1979)
11. Garg, A., Tamassia, R.: On the computational complexity of upward and rectilinear
planarity testing. SIAM J. Comput. 31(2), 601–625 (2001)
12. Johnson, T., Robertson, N., Seymour, P.D., Thomas, R.: Directed tree-width. J.
Comb. Theory, Ser. B 82(1), 138–154 (2001)
13. Lynch, J.F.: The equivalence of theorem proving and the interconnection problem.
ACM SIGDA Newsletter 5(3), 31–36 (1975)
14. Ohtsuki, T.: The two disjoint path problem and wire routing design. In: Saito, N.,
Nishizeki, T. (eds.) Graph Theory and Algorithms. LNCS, vol. 108, pp. 207–216.
Springer, Heidelberg (1981)
15. Papakostas, A.: Upward planarity testing of outerplanar dags (extended abstract)
(1995), 10.1007/3-540-58950-3 385
16. Robertson, N., Seymour, P.D.: Graph minors XIII. The disjoint paths problem.
Journal of Combinatorial Theory, Series B 63, 65–110 (1995)
17. Schrijver, A.: Finding k disjoint paths in a directed planar graph. SIAM Jornal on
Computing 23(4), 780–788 (1994)
18. Seymour, P.D.: Disjoint paths in graphs. Discrete Math. 29, 293–309 (1980)
19. Shiloach, Y.: A polynomial solution to the undirected two paths problem. J.
ACM 27, 445–456 (1980)
20. Slivkins, A.: Parameterized tractability of edge-disjoint paths on directed acyclic
graphs. In: European Symposium on Algorithms, pp. 482–493 (2003)
21. Thomassen, C.: 2-linked graphs. European Journal of Combinatorics 1, 371–378
(1980)
On Lower Bounds for Multiplicative Circuits and
Linear Circuits in Noncommutative Domains
Abstract. In this paper we show some lower bounds for the size of
multiplicative circuits computing multi-output functions in some non-
commutative domains such as monoids and finite groups. We also intro-
duce and study a generalization of linear circuits in which the goal is to
compute M Y where Y is a vector of indeterminates and M is a matrix
whose entries come from noncommutative rings. We show some lower
bounds in this setting as well.
1 Introduction
Let (S, ◦) be a semigroup, i.e., S is a set closed under the binary operation ◦
which is associative. A natural multi-output computational model is a circuit
over (S, ◦). The circuit is given by a directed acyclic graph with input nodes
labeled x1 , ..., xn of indegree 0 and output nodes y1 , ..., ym of outdegree 0.
The gates of the circuit all compute the monoid product. We assume that all
gates have fanin 2. The size of the circuit is the number of nodes in it and it
computes a function f : S n → S m .
This provides a general setting to some well studied problems in circuit com-
plexity. For example:
(1) If S = F2 and ◦ is addition in F2 , the problem is one of computing Ax for
an m × n matrix over F2 . The problem of giving an explicit A such that the size
of any circuit for it is superlinear is a longstanding open problem. By means of
counting arguments, we know that there exist such matrices A [11].
This problem has a rich literature with many interesting developments. Mor-
genstern [7] showed an Ω(n log n) lower bound for the Hadamard matrix in the
bounded coefficient model when F = C. Valiant [11] developed matrix rigid-
ity as a means to attack the problem in the case of logarithmic depth circuits.
In spite of many interesting results and developments, superlinear size lower
bounds remain elusive over any field F even for the special case of log-depth
circuits (Lokam’s monograph [6] contains most of the recent results).
(2) When S = {0, 1} and ◦ is the boolean OR, this problem is also well studied
and due to its monotone nature it has explicit lower bounds of circuit size n2−o(1)
(e.g. see section 3.4 in [3]).
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 65–76, 2014.
c Springer International Publishing Switzerland 2014
66 V. Arvind, S. Raja, and A.V. Sreejith
A more restricted form is S = (N, +) called SUM circuits also well studied e.g.
[3]. While for monotone settings (OR,SUM circuits) there are nontrivial lower
bounds, in the commutative case for S we do not have strong lower bounds
results. In this paper, we explore the case when (S, ◦) is noncommutative and
manage to prove strong lower bounds in some cases.
An interesting aspect is that the number of inputs can be restricted to just two:
x0 , x1 . The explicit functions yi , 1 ≤ i ≤ m are defined as words yi = yi1 yi2 ...yin
where yij ∈ {x0 , x1 } and {y1 , y2 , ..., ym } are explicitly defined. We show that any
circuit C : {x0 , x1 } → {y1 , y2 , ..., ym } is of size Ω( log
mn
2 n ) in the following four
settings:
constant d > 0.
We consider the free monoid X ∗ where X is a finite alphabet and the monoid
operation is concatenation with the empty string as identity. The notion of
a multiplicative circuits over a free monoid is also known in th area of data
compression as a straight line program [5].
Notice that when X is a singleton set X = {1} then (1∗ , ◦) is essentially
the semigroup (N, +). We consider the simplest noncommutative setting with
X = {0, 1}. In the problem, we consider circuits that take the ”generating set”
X as input and the m outputs y1 , y2 , ..., ym ∈ X n ( where n is the ”input”
parameter).
Since each yi is of length n, clearly n gates are sufficient to compute each
yi and hence O(mn) is an obvious upper bound for the circuit size. We will
give an explicit set y1 , y2 , ..., ym ∈ {0, 1}n so that Ω( log
mn
2 n ) is the circuit size
Construction of S
Consider the set [n2 ] of the first n2 natural numbers. Each i ∈ [n2 ] requires
2 log2 n bits to represent in binary. Initially let D = [n2 ].
for i = 1, ..., n do
On Lower Bounds for Multiplicative Circuits and Linear Circuits 67
This defines the set S = {y1 , y2 , ..., yn }. Each yi constructed has the property
that yi has ≥ 2 log
n
n distinct substrings of length 2 log n. We show the following
two result about these strings:
– For each yi ∈ S any concatenation circuit that generates yi from input
X = {0, 1} requires size Ω( logn2 n ).
– Any concatenation circuit that takes X = {0, 1} as input and outputs S =
2
{y1 , y2 , ..., yn } at n output gates requires size Ω( logn2 n ).
Lemma 1. Let s ∈ X n be any string where |X| ≥ 2, such that the number of
distinct substrings of s of length l is N . Then any concatenation circuit for s
will require Ω( Nl ) gates.
Proof. Let C be any circuit that computes the string s. Now each gate g of C
computes some string sg . Suppose g = g1 ◦ g2 is a gate whose inputs are gates
g1 , g2 .
Suppose sg1 has k1 distinct substrings of length l and sg2 has k2 distinct
substrings of length l. Now, in sg notice that the new substrings of length l (not
occurring in sg1 or sg2 ) could only arise as a concatenation of some suffix of sg1
and prefix of sg2 such that neither of them is the empty string. The number of
such substrings is at most l − 1.
Hence, sg can have at most k1 + k2 + l − 1 distinct substrings of length l. Thus,
each new gate of C can generate at most l − 1 new substrings of length l. Since
the output string s has N distinct length l substrings, it follows that number of
gates in C is Ω( Nl ).
Note the case not covered by the lemma: |X| = 1. In that case we know that
every string of length n (for every n) has a concatenation circuit of size ≤ 2 log2 n
and the circuit exploits the fact that for each length l there is a unique string.
Similar to Lemma 1 is known earlier (e.g. see Lemma 3 in [2]).
Theorem 1. Let S ⊆ {0, 1}n be the explicit set of n strings defined above. Any
concatenation circuit that takes X = {0, 1} as input and outputs S at its n output
2
gates will require size Ω( logn2 n ).
Proof. Let S = {y1 , y2 , ..., yn } as defined above. Notice that, each yi can be
generated by size n circuit. Let C be any concatenation circuit that takes X =
{0, 1} as inputs and at its n output gates generates y1 , y2 , ..., yn respectively. Let
C be a concatenation circuit obtained from C by adding n − 1 new gates such
that C outputs the concatenation y = y1 y2 ...yn . By construction size(C ) =
size(C)+n−1. The number of distinct length 2 log n strings in the string y is, by
n2
construction, ≥ 2 log n . This is because each yi has ≥ 2 log n distinct substrings
n
2
and these are disjoint for different yi . Hence by Lemma 1, size(C ) = Ω( logn2 n )
2
which implies size(C) = Ω( logn2 n ).
68 V. Arvind, S. Raja, and A.V. Sreejith
Theorem 2. Any circuit over (M, ◦) that takes M0 , M1 as input and computes
2
{Myi |yi ∈ S} at its n output gates is of size Ω( logn2 n ).
apply these rules and obtain a normal form w ∈ GX from it which cannot be
simplified further. This normal form, by Church-Rosser property, is unique and
independent of how we apply the rules.
Recall the set of binary strings we constructed in Section 2. Replacing 0 by
x1 and 1 by x2 we obtain S = {y1 , y2 , ..., yn } ⊆ {x1 , x2 }n ⊆ GX . Each word yi
constructed has the property that yi has ≥ 2 log n
n distinct subwords of length
2 log n. These words are already in their normal forms.
Proof. Let C be any circuit that computes the word w. Now each gate g of C
computes some word wg and, as above, wg denotes its normal form.
Suppose g = g1 ◦ g2 is a gate whose inputs are gates g1 , g2 . Then, by the
Church-Rosser property of cancellations, the normal form for wg satisfies
Proof. Let S = {y1 , y2 , ..., yn } as defined above and let C be any concatenation
circuit that takes X = {x1 , x2 , x−1 −1
1 , x2 } as inputs and at its n output gates
generates y1 , y2 , ..., yn respectively. Let C be a concatenation circuit obtained
from C by adding n − 1 new gates such that C outputs the concatenation
y = y1 y2 ...yn . By construction size(C ) = size(C) + n − 1. The number of
n2
distinct length 2 log n words in the words y is, by construction, ≥ 2 log n . This is
because each yi has ≥ 2 log n
n distinct subwords and these are disjoint for different
2 2
yi . Hence by Lemma 2, size(C ) = Ω( logn2 n ) which implies size(C) = Ω( logn2 n ).
12 10
Remark 1. Let M0 = , M1 = be 2 × 2 matrices. Consider the
01 21
infinite group G generated by these elements and their inverses over the field
of rationals Q. It is well known (e.g. see [4] for a nice complexity theoretic
70 V. Arvind, S. Raja, and A.V. Sreejith
application) that the group G is isomorphic to the free group GX , where the
isomorphism is defined by x1 → M0 and x2 → M1 . It follows that Theorem 3
also applies to the group G by setting x1 = M0 and x2 = M1 .
Definition of π0 , π1 :
We pick r primes p1 , p2 , ..., pr where r = n2 such that n < p1 < p2 < ... <
pr < n4 . The permutation π0 is defined as the product of r + 1 disjoint cycles,
π0 = C0 .C1 ...Cr where C0 , C1 are of length p1 and for i ≥ 2, Ci is of length
pi . Similarly, π1 = C0 .C1 ...Cr is a product of r + 1 disjoint cycles with C0 and
C1 of length p1 and for i ≥ 2, Ci is of length pi . Let supp(C) denote the set
of points moved by C for a cycle C (i.e., if we write C = (i1 i2 ...ip ) it means
C maps i1 to i2 and so on ip to i1 and moves no other element of the domain.
Hence, supp(C) = {i1 , i2 , ..., ip }). In the construction above we pick the cycles
Ci and Ci , 0 ≤ i ≤ r such that supp(C0 ) ∩ supp(C0 ) = {1} and ∀(i, j) = (0, 0)
supp(Ci ) ∩ supp(Cj ) = φ. The domain [N ] on which these permutations are
defined is ri=0 (supp(Ci ) ∪ supp(Ci )). Note that N ≤ 4p1 + 2 ri=2 pi = O(n6 ).
Thus, the problem we consider is that of designing a circuit over SN that takes
n
as input x0 , x1 and outputs at the n output gates πyi = Πj=1 xyi [j] where yi [j]
is the j-th bit of string yi for each yi ∈ S.
Theorem 4. Any circuit over the group (SN , ◦) that takes as input π0 , π1 and
2
computes GS = {πyi |yi ∈ S} as output is of size Ω( logn2 n ).
Proof. Let C be the circuit that solves this problem of computing GS from x0 , x1 .
We fix the input as x0 = π0 and x1 = π1 . Now, consider the corresponding
concatenation circuit C with input x0 , x1 ∈ X. At each output gate gi , 1 ≤ i ≤
m, circuit C computes some word wi ∈ X ∗ such that ∀i, πwi = πyi where πwi
is the permutation in SN obtained by putting x0 = π0 and x1 = π1 in wi . If
wi = yi for all i, then in fact C as a concatenation circuit computes the set S
2
at its output gates. This implies by Theorem 1 that size(C ) = Ω( logn2 n ) and
2
size(C) = Ω( logn2 n ).
Suppose wi = yi at some output gate gi . We can write wi = u ◦ b2 ◦ s and
yi = v ◦ b1 ◦ s where b1 = b2 . Assume, without loss of generality, that b1 = 0 and
b2 = 1. Since πwi = πyi , we know πu πb2 πs = πv πb1 πs (i.e., πu π1 πs = πv π0 πs ).
Let α ∈ [N ] such that πs (α) = 1. In πyi = πv π0 πs , the permutation π0 will
On Lower Bounds for Multiplicative Circuits and Linear Circuits 71
When R is a field we get the well-studied linear circuits model [7,11,6]. How-
ever, no explicit superlinear size lower bounds are known for this model over
fields (except for some special cases like the bounded coefficient model [7] or in
the cancellation free case [1]).
When the coefficients to come from a noncommutative ring R, we prove lower
bounds for certain restricted linear circuits. Suppose the coefficient ring is R =
Fx0 , x1 consisting of polynomials over the field F in noncommuting variables
x0 and x1 .
Let M ∈ Fn×n x0 , x1 where x0 , x1 are noncommuting variables and Y =
(y1 , y2 , . . . , yn )T is a column vector of input variables. The first restriction we
consider are homogeneous linear circuits over the ring Fx0 , x1 for computing
M Y . The restriction is that for every gate g in the circuit, if g has its two
incoming edges from nodes g1 and g2 , then the edges (g1 , g) and (g2 , g) are
labeled by α and β respectively, where α, β ∈ Fx0 , x1 are restricted to be
homogeneous polynomials of same degree in the variables x0 and x1 . It follows,
as a consequence n of this restriction, that each gate g of the circuit computes a
linear form i=1 αi yi , where the αi ∈ Fx0 , x1 are all homogeneous polynomials
of the same degree. Our goal is to construct an explicit matrix M ∈ Fn×n x0 , x1
such that M Y can not be computed by any circuit C with size O(n) and depth
O(log n). We prove this by suitably generalizing Valiant’s matrix rigidity method
[11] as explained below.
Consider n × n matrices Fn×n over field F. The support of a matrix A ∈ Fn×n
is the set of locations supp(A) = {(i, j) | Aij = 0}.
Definition 1. Let F be any field. The rigidity ρr (A) of a deck of matrices A =
{A1 , A2 , . . . , AN } ⊆ Fn×n is the smallest number t for which there are a set of
t positions S ⊆ [n] × [n] and a deck of matrices B = {B1 , B2 , . . . , BN } such that
for all i: supp(Bi ) ⊆ S and the rank of Ai + Bi is bounded by r. A collection
A = {A1 , A2 , . . . , AN } ⊆ Fn×n is a rigid deck if ρ·n (A) = Ω(n2−o(1) ), where
> 0 is a constant.
Notice that for N = 1 this is precisely the notion of rigid matrices. We are
interested in constructing explicit rigid decks: I.e. a deck A such that for each
k ∈ [N ] and each 1 ≤ i, j ≤ n there is a polynomial (in n) time algorithm that
2
outputs the (i, j)th entry of Ak . We describe an explicit deck of size N = 2n
over any field F and use it to prove our first lower bound result. It is convenient
2
to write the deck as A = {Am | m ∈ {x0 , x1 }n } with matrices Am indexed by
monomials m of degree n2 in the noncommuting variables x0 and x1 . The matrix
Am is defined as follows:
1 if mij = x1
Am [i, j] =
0 if mij = x0
Note that all the matrices Am in the deck A are in Fn×n . Clearly, A is an
explicit deck. We prove that it is a rigid deck.
2
Lemma 3. The deck A = {Am | m ∈ {x0 , x1 }n } is an explicit rigid deck for
any field F.
On Lower Bounds for Multiplicative Circuits and Linear Circuits 73
Proof. Valiant [11] showed that almost all n × n 0-1 matrices over any field F
2
have rigidity Ω( (n−r)
log n ) for target rank r. In particular, for r = · n, over any
δ·n2
field F, there is a 0-1 matrix R for which we have ρr (R) ≥ log n for some constant
δ > 0 depending on .
δ·n2
We claim that for the deck A we have ρn (A) ≥ log n . To see this, let
2
E = {Em ∈ Fn×n |m ∈ {x0 , x1 }n } be any collection of matrices such that
δn2
|supp(Em )| ≤ log n for each m. Since the deck A contains all 0-1 matrices, in
particular R ∈ A and R = Am for some monomial m. From the rigidity of R
we know that the rank of R + Em is at least n. This proves the claim and the
lemma follows.
We now turn to the lower bound result for homogeneous linear circuits where
the coefficient ring is Fx0 , x1 . We define an explicit n × n matrix M as
2
−((i−1)n+j)
Mij = (x0 + x1 )(i−1)n+j−1 · x1 · (x0 + x1 )n . (1)
It is easy to see that we can express the matrix M as M = m∈{x0 ,x1 }n2 Am m,
n2
where A = {Am | m ∈ {x0 , x1 } } is the deck defined above.
Proof. Assume to the contrary that C is a homogeneous linear circuit of size O(n)
and depth O(log n) computing M Y . We know that by Valiant’s graph-theoretic
argument (see e.g. [6]) that in the circuit C there is a set of gates V of cardinality
s = logc1log n = o(n) such that at least n − n
n 2 1+δ
, for δ < 1, input-output pairs
have all their paths going through V . Thus, we can write M = B1 B2 + E
where B1 ∈ Fn×s x0 , x1 and B2 ∈ Fs×n x0 , x1 and E ∈ Fn×n x0 , x1 , and
|supp(E)| ≤ n1+δ . By collecting the matrix coefficient of each monomial we can
express M and E as
M= Am m, and E = Em m,
m∈{x0 ,x1 }n2 m∈{x0 ,x1 }n2
where Am are already defined and | ∪m∈{x0 ,x1 }n2 supp(Em )| ≤ n1+δ . Now con-
sider the matrix B1 B2 . By collecting matrix coefficients of monomials we can
write B1 B2 = m∈{x0 ,x1 }n2 Bm m.
We now analyze the matrices Bm . Crucially, by the homogeneity condition
on the circuit C, we can partition V = V1 ∪ V2 ∪ . . . V , where each gate g in Vi
computes a linear form nj=1 γj yj and γj ∈ Fx0 , x1 is a homogeneous degree
di polynomial. Let si = |Vi |, 1 ≤ i ≤ . Then we have s = s1 + s2 + . . . s . Every
monomial m has a unique prefix of lengthdi for each degree di associated with
the gates in V . Thus, we can write Bm = j=1 Bm,j,1 Bm,j,2 , where Bm,j,1 is the
n × sj matrix corresponding to the dj -prefix of m and Bm,j,2 is the sj × n matrix
corresponding to the n2 − dj -suffix of m. It follows that for each monomial m
74 V. Arvind, S. Raja, and A.V. Sreejith
Remark 2. For the matrix M = (mij ), as defined above, it does not seem that
Shoup-Smolensky dimension method [10] can be used to prove a similar lower
bound. To see this, suppose ΓM (n) is the set of all monomials of degree n in
{mij } and let DM (n) be the dimension of the vector space over F spanned by the
set ΓM (n). The upper bound for DM (n) that we can show for a depth d and size
O(n) linear circuit over the ring Fx0 , x1 is as large as ( O(n) dn
d ) . This bound,
unfortunately, is much larger than the bounds obtainable for the commutative
case [10]. On the other hand, the lower bound for DM (n) is only nΘ(n) . Thus,
we do not get a superlinear size lower bound for the size using Shoup-Smolensky
dimensions when the coefficient ring is Fx0 , x1 .
We next consider homogeneous depth 2 linear circuits. These are linear circuits
of depth 2, where each addition gate can have unbounded fanin. More precisely,
gt is an addition gate with inputs from g1 , g2 , . . . , gt then the gate g computes
if
i=1 αi gi , where each edge (gi , g) is labeled by αi ∈ Fx0 , x1 such that αi , 1 ≤
i ≤ t are all homogeneous polynomials of the same degree. We again consider the
problem of computing M Y for M ∈ Fn×n x0 , x1 . The goal is to lower bound
the number of wires in the linear circuit. This problem is also well studied for
linear circuits over fields and only an explicit Ω(n log2 n/ log log n) lower bound is
known for it [6,9], although for random matrices the lower bound is Ω(n2 / log n).
We show that for the explicit matrix M as defined above, computing M Y by
n2
a depth 2 homogeneous linear circuit (with unbounded fanin) requires Ω( log n)
wires.
Proof. Let C be such a linear circuit computing M Y . Since edges can be la-
beled by constant-degree polynomials, we can first obtain a linear circuit C
computing M Y such that each edge is labeled by a homogeneous linear form.
The size size(C ) = O(size(C) log n). From C , we can obtain a noncommuta-
tive algebraic branching program Ĉ that computes the palindrome polynomial
R
w∈{x0 ,x1 }2 log n ww such that size(Ĉ) = O(size(C )). By Nisan’s lower bound
2
n
[8] size(Ĉ) = Ω(n2 ), which implies size(C) = Ω( log n ).
Theorem 8. Any linear circuit, whose edge labels are restricted to be either
a homogeneous degree 4 log n polynomial or a scalar, computing M Y requires
Ω(n2 ) size, where M is the palindrome matrix. Moreover, there is a matching
upper bound.
Proof. Let C be any linear circuit computing M Y . Each entry m ij of
the matrix
M can be written as sum of products of polynomials mij = ρij e∈ρij l(e)
where ρij is a path from input yj to output gate i in C and l(e) is the label of
edge e in C. Let S be set of all edge labels in C with degree 4 log n polynomial.
Thus, each mij is a linear combinations of elements in the set S over F. This
implies that mij ∈ Span(S) where i ≤ i, j ≤ n. Since all mij are distinct,
2
|S| ≥ n2 . Since fan in is 2, size(C) ≥ n2 = Ω(n2 ).
For upper bound, we use n2 edges (n edges starting from each input yi ) each
labeled by a corresponding monomial in M (of degree 4 log n) and then we add
76 V. Arvind, S. Raja, and A.V. Sreejith
relevant edges to get the output gates. Thus, upper bound is O(n2 ) for computing
MY .
Note that, since we have not used noncommutativity in the proof, Theorem 8
also holds in the commutative settings (we require Ω(n2 ) entries of M to be
distinct).
7 Concluding Remarks
For multiplicative circuits we could prove lower bounds only for large monoids
and large groups. The main question here is whether we can prove lower bounds
for an explicit function f : S n → S m , for some constant size nonabelian group
or monoid S.
We introduced the notion of rigidity for decks of matrices, but the only
2
explicit example we gave was the trivial one with a deck of size 2n . A natural
question is to give explicit constructions for smaller rigid decks of n × n
matrices, say of size n! or less. Or is the construction of rigid decks of smaller
size equivalent to the original matrix rigidity problem?
References
1. Boyar, J., Find, M.G.: Cancellation-free circuits in unbounded and bounded depth.
In: Gasieniec,
L., Wolter, F. (eds.) FCT 2013. LNCS, vol. 8070, pp. 159–170.
Springer, Heidelberg (2013)
2. Charikar, M., Lehman, E., Liu, D., Panigrahy, R., Prabhakaran, M., Sahai, A.,
Shelat, A.: The smallest grammar problem. IEEE Transactions on Information
Theory 51(7), 2554–2576 (2005)
3. Jukna, S., Sergeev, I.: Complexity of linear boolean operators. Foundations and
Trends in Theoretical Computer Science 9(1), 1–123 (2013)
4. Lipton, R.J., Zalcstein, Y.: Word problems solvable in logspace. Journal of the
ACM (JACM) 24(3), 522–526 (1977)
5. Lohrey, M.: Algorithmics on slp-compressed strings: A survey. Groups Complexity
Cryptology 4(2), 241–299 (2012)
6. Lokam, S.V.: Complexity lower bounds using linear algebra. Foundations and
Trends in Theoretical Computer Science 4(1-2), 1–155 (2009)
7. Morgenstern, J.: Note on a lower bound on the linear complexity of the fast fourier
transform. Journal of the ACM (JACM) 20(2), 305–306 (1973)
8. Nisan, N.: Lower bounds for non-commutative computation (extended abstract).
In: STOC, pp. 410–418 (1991)
9. Pudlak, P.: Large communication in constant depth circuits. Combinatorica 14(2),
203–216 (1994)
10. Shoup, V., Smolensky, R.: Lower bounds for polynomial evaluation and interpola-
tion problems. Computational Complexity 6(4), 301–311 (1996)
11. Valiant, L.G.: Graph-theoretic arguments in low-level complexity. In: Gruska, J.
(ed.) MFCS 1977. LNCS, vol. 53, pp. 162–176. Springer, Heidelberg (1977)
Testing Low Degree Trigonometric Polynomials
1 Introduction
Probabilistically checkable proofs and property testing represent some of the
most important areas in theoretical computer science within the last two decades.
Among the many deep results obtained one highlight is the proof of the PCP
theorem [2,3] giving an alternative characterization of complexity class NP in
the Turing model. An alternative proof of the theorem has been given by Dinur
more recently [10].
A branch of computability and complexity theory alternative to the Turing
approach and dealing with real and complex number computations has been
developed by Blum, Shub, and Smale in [8], see also [7]. It presents a model of
uniform algorithms in an algebraic context following the tradition in algebraic
complexity theory [9]. As major problem both for real and complex number
complexity theory the analogue of the classical P versus NP question remains
unsolved in the BSS model as well. We assume the reader to be familiar with
the basic definitions of complexity classes in this model, see [7].
Given the tremendous importance probabilistically checkable proofs and the
PCP theorem exhibit in classical complexity theory, for example, with respect
to the areas of property testing and approximation algorithms it seems natural
to analyze such verification procedures and the corresponding classes as well
in the BSS model. This refers both to the question which kind of interesting
properties can be verified with high probability in the algebraic framework and
to the validity of PCP theorems.
Both authors were supported under projects ME 1424/7-1 and ME 1424/7-2 by the
Deutsche Forschungsgemeinschaft DFG. We gratefully acknowledge the support.
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 77–96, 2014.
c Springer International Publishing Switzerland 2014
78 M. Baartse and K. Meer
Starting point of this paper is the original proof of the classical PCP theorem
for NP [2,3]. It consists basically of three major steps. The easiest is the con-
struction of so called long transparent proofs for problems in NP. It relies on
testing linear functions. Here, given a table of function values a verifier checks
with high probability whether the table in a certain sense is close to a linear func-
tion. Next, another verification procedure is designed, this time based on testing
low-degree (algebraic) polynomials over finite fields instead of linear functions.
It is combined with a so called sum-check procedure to obtain a different verifier
for problems in NP. The two verification procedures then in a third step are
combined applying a clever new technique of composing verifiers.
Our main result in the present work is that the second step above, i.e., a
structurally similar verification procedure for certain low degree trigonometric
polynomials can be set up in the real number model as well.
dealing with finite fields new difficulties arise that way. The major drawback is
the following. All the above mentioned tests rely on restricting the given func-
tion table to one-dimensional subsets, thus working with univariate polynomials
during the test. However, in contrast to algebraic polynomials the degree of a
univariate restriction of such a trigonometric polynomial to an arbitrary line in
F k is not bounded by its original multivariate degree. Depending on the line
chosen the degree of such a restriction can grow too much. This implies that
not all lines are appropriate as restrictions to work with. As consequence, the
design of a suitable set H ⊂ F k of directions of test-lines and the analysis of
a corresponding test require considerable additional technical efforts. The latter
are twofold. First, using the theory of expander graphs one has to establish that
the set H is small, but still rich enough to cover in a reasonable sense all F k .
Secondly, it must be shown that a function table which does not give errors on
H with high probability is close to a trigonometric polynomial on F k .
As main result we obtain a verification procedure for trigonometric polyno-
mials that inspects a constant number of relatively small blocks of proof compo-
nents, thus giving a low degree test which respects the structural requirements
necessary for verifier composition. Independently of this aspect, we extend the
still small list of interesting real number properties for which a probabilistic ver-
ification is possible. In particular, as far as we know trigonometric polynomials
have not yet been used in the realm of real number complexity theory. Given
the huge importance of Fourier analysis this might be interesting to be studied
further.
The paper is organized as follows. Section 2 introduces trigonometric poly-
nomials that map elements from a k-dimensional vector space over a finite field
into the reals. The main task of testing whether a table of real values arises from
such a polynomial is described precisely and a test to figure this out is given.
The rest of the paper then is devoted to prove that the test has the required
properties. Towards this aim two major theorems have to be shown; this is done
in Section 3. The concluding section will discuss the importance of the result in
view of (re-)proving the real PCP theorem; we explain how to choose the pa-
rameters in our statements to use it for PCPs and outline what has to be done
to obtain the full PCP theorem over R.
A final remark: Some of the proofs necessary to establish our main result are
quite technical. Given the page restriction in this extended abstract we thus
focus on presenting the main proof structure. Full proofs have to be postponed
in most cases to the full paper.
Let us start with defining the main objects of this paper, namely trigonometric
polynomials. Let F be a finite field with q := |F | being prime. As usual, we
identify F with {0, . . . , |F | − 1}. We want to consider particular real valued
functions defined on some F k .
d
f (x1 , . . . , xk ) = a0 (x1 , . . . , xk−1 ) + am (x1 , . . . , xk−1 ) · cos(2πm xqk )+
m=1
d
+ bm (x1 , . . . , xk−1 ) · sin(2πm xqk ),
m=1
k
f (x1 , . . . , xk ) = ct · exp(2πi xj tj ),
t j=1
where the sum is taken over all t := (t1 , . . . , tk ) ∈ Zk with |t1 | ≤ d, . . . , |tk | ≤ d
and ct ∈ C satisfy ct = c−t for all such t.
In all situations below the potential degrees we work with will be much less than
the field’s cardinality.
Since we shall mainly deal with trigonometric polynomials in this paper we
drop most of the times the term ’trigonometric’. Whenever we refer to usual
algebraic polynomials we state it explicitly.
The ultimate goal of this paper is to design a verifier which performs a test
whether a given table of function values is generated with high probability by a
multivariate polynomial. More precisely, the following is our main result.
The verifier first uniformly generates O(k·log q) random bits; next, it uses
the random bits to determine a point x ∈ F k together with one segment in
the proof string it wants to read. Finally, using the values of f (x) and those
of the chosen segment it performs a test (to be described below). According
to the outcome of the test the verifier either accepts or rejects the input.
The running time of the verifier is polynomially bounded in the quantity
k · log q, i.e., polylogarithmic in the input size O(k · q 2k ).
2. For every function value table representing a trigonometric max-degree d
polynomial there exists a proof string such that the verifier accepts with prob-
ability 1.
3. For any 0 < < 10−19 and for every function value table whose distance
to a closest max-degree 2hkd polynomial is at least 2 the probability that
the verifier rejects is at least , no matter what proof string is given. Here,
for two functions f, g : F k → R their distance is defined as dist(f, g) :=
|F k | · |{x ∈ F |f (x) = g(x)}|.
1 k
The first and the second property in the theorem will follow directly from the
description of the test. Proving the last property - as usual with such statements
- is the main task. Repeating the verifier’s computation constantly many times
decreases the error probability below any given fixed positive constant.
Performing (one round of) the test the verifier reads 2hkd+k+1 real numbers.
Thus, it can only test for a local property of low degree polynomials f : F k → R.
A major amount of work will be to figure out what this local property should
look like. The starting idea is common for low degree tests, namely to consider
univariate restrictions along certain lines of F k . The segments of a proof string
mentioned above precisely present the coefficients of such a univariate restriction.
An advantage using a finite field as domain is that such lines only contain |F |
many points. So we do not have to deal with the problem of splitting the domains
into a large test domain and a small safe domain as it is, for example, the case
with the real linearity test from [12]. On the other hand, it will turn out not to
be a good idea to allow any arbitrary line in F k for such a test as it is done in
the classical approach [2]. A fair amount of work will be necessary to figure out
a suitable subset H ⊂ F k of lines for which the test shall be performed.
As mentioned above, the verifier expects each segment of the proof to specify a
univariate polynomial of appropriate degree on a line. Since univariate restric-
tions of trigonometric polynomials along a line behave a bit differently than of
algebraic polynomials some care is necessary. Let f : F k → R be a (trigonomet-
ric) max-degree d polynomial and let := {x + tv|t ∈ F }, x, v ∈ F k be a line. For
determining an upper bound of the degree of the univariate restriction of f on
it turns out to be helpful to define a kind of absolute value for the elements of F .
The definition is inspired by the fact that if we later on restrict a trigonometric
Testing Low Degree Trigonometric Polynomials 83
polynomial to lines with small components in absolute value the resulting uni-
variate polynomials have a relatively small degree. For t ∈ F = {0, . . . , |F | − 1}
put
t if t < |F |/2
|t| = .
|F | − t if t > |F |/2
If a univariate polynomial p : F → R has degree d, then for a, b ∈ F the
polynomial t → p(a + bt) has degree at most d · |b| and thus t → f (x + tv) has
k
degree at most d · i=1 |vi | , where v = (v1 , . . . , vk ). This is an easy consequence
of Definition 1.
For the test performed by the verifier we want to specify a suitable set H ⊂ F k
of lines along which univariate restrictions are considered. Suitable here refers
to the maximal degree such a restriction could have given a max-degree d multi-
variate polynomial. This maximal degree in a certain sense should be small. The
constant parameter h in Theorem 1 determines what we mean by small. Though
h = 1015 of course is a large constant the decisive point is its independence of
d, k, q.
Definition 2. Let F be a finite field, k ∈ N and h be as in Theorem 1. The set
H is defined to be any subset of F k \ {0} satisfying the following two conditions:
i) For every 0 = v := (v1 , . . . , vk ) ∈ H we have |v| := max{|v1 |, . . . , |vk |} ≤ h
and
ii) if for a fixed v ∈ F k several points in the set {tv|t ∈ F } satisfy condition i)
only one of them is included in H.
Condition i) requires the direction of lines that we consider to have small com-
ponents, whereas condition ii) just guarantees that each line (as point set) is
included at most once. We abstain from specifying which v we include in such a
case and just fix H as one such set.
If a k-variate polynomial of max-degree d is restricted to a line {x + tv|t ∈ F }
whose direction v belongs to H, then the resulting univariate polynomial has
degree at most hkd. Note that for the values chosen hkd is much smaller than
|F |
2 . In later arguments the cardinality of H will be important, so let us say
something about it already now. For h sufficiently smaller than |F | there are
(2h + 1)k − 1 elements v ∈ F k − {0}k such that |v| ≤ h. For every such v it is
| − v| ≤ h, therefore 12 ((2h + 1)k − 1) is an upper bound for |H|. It can be shown
|H|
that for increasing k the fraction 1 ((2h+1) k −1) approaches 1.
2
Given a table of function values for an f : F k → R the verifier now expects
the following information from a potential proof that f is a trigonometric poly-
nomial of max-degree d. For every line in F k which has a direction v ∈ H
the proof should provide a segment of real numbers which represent a univariate
polynomial as follows. The segment consists of a point x ∈ F k on the line as well
as reals a0 , . . . , ahkd , b1 , . . . , bhkd . The verifier will interpret this information as
the univariate polynomial with coefficients ai , bj that ideally, i.e., for a trigono-
metric polynomial, represents f ’s restriction to parametrized as t → f (x + tv).
Obviously, there are several different parametrizations depending on the point x.
84 M. Baartse and K. Meer
Since F is discrete the objects picked in Step 1 can be addressed using O(k ·
log |F |) random bits. Note that this first step is the same as saying we pick
a random direction v ∈ H together with a random line among those having
direction v. There are |F | many points on each such line, i.e., |F | choices for x
result in the same line.
theorem gives for the rejection probability gets very small (and even can become
negative). So intuitively the theorem states that if the rejection probability is
small, then f is either very close or very far away from a max-degree 2hkd
polynomial.
Thus we have to deal with the case that though the rejection probability might be
small given the above lower bound f is far away from such a polynomial. Theorem
3 basically shows that this case cannot occur using the following idea: if for a
function f and a proof string π the probability of rejection is small, then f and π
can be changed in a number of small steps such that these changes do not increase
the rejection probability too much and in the end a max-degree 2hkd polynomial
fs is obtained. Since by Theorem 2 such a transformation process would not be
possible if f would be far away from any max-degree 2hkd polynomial (the
process would have to cross functions for which the test rejects with higher
probability), it follows that a reasonably small rejection probability only occurs
for functions f that were already close to a max-degree 2hkd polynomial.
Theorem 3. Let 0 < ≤ 10−19 and let a function f0 together with a proof π0
be given. If the low-degree test rejects with probability at most , then there is a
sequence (f0 , π0 ), (f1 , π1 ), . . . , (fs , πs ) such that
1. for every i ≤ s the probability that the test rejects input (fi , πi ) is at most
2,
2. for every i < s the functions fi and fi+1 differ in at most |F | arguments and
3. the function fs is a max-degree 2hkd polynomial.
Note that it is only the existence of such a sequence that we need for the proof
of Theorem 1, it does not describe anything that the test does. So it does not
have to be (efficiently) computable.
Assuming validity of both theorems the Main Theorem can be proven as
follows:
Proof. (of Main Theorem 1) Statements 1. and 2. of the theorem being obvious
from the foregoing explanations let us assume we are given a function value table
for f : F k → R together with a verification proof π such that the low-degree
test rejects with a probability at most ≤ 10−19 . We will show that the distance
δ from f to the set of max-degree 2hkd polynomials is at most 2. In order to
avoid tedious calculations the arguments are given on a slightly more abstract
level based on continuity, however it is no problem to fill in the precise values
for δ in all cases.
86 M. Baartse and K. Meer
|H| lines and taking into account that there are |U | = δ|F |k choices for x there
can be at most
δ|F |k · |H| · 4h2 k 2 d
triples in C satisfying the first alternative.
Next we aim for a lower bound on the total number of triples in C. This easily
implies a lower bound on the number of triples satisfying the second alternative;
from that a lower bound for the probability that the test rejects can be obtained.
A lower bound on |C| is given in the following proposition. It basically says
that the set H of test directions is sufficiently large. Its proof requires consider-
able technical efforts relying on the theory of expander graphs, so we just give
the statement here.
Proposition 1. Let U ⊆ F k as above (or any other arbitrary set with cardinal-
ity δ|F |k ) with 0 ≤ δ ≤ 1. Then there are at least
2h
δ(1 − δ)|H|(|F | − 1)|F |k
2h + 1
pairs (x, y) ∈ U × (F k − U ) such that the line through x and y has direction in
H.
This proposition together with the above claim implies that the number of triples
in C satisfying the second alternative is at least
2h
δ(1 − δ)|H|(|F | − 1)|F |k − δ|F |k · |H| · 4h2 k 2 d.
2h + 1
In order to finish the proof of Theorem 2 an alternative view of the low-degree
test helps. The test can as well be seen as first choosing randomly two points x, y
such that they determine a direction v ∈ H. Since there are |H| directions and
|F | points on each line there are |H|(|F | − 1)|F |k such triples (x, v, y) in total.
Then, with probability 12 the test decided whether to check if pv,x (τx ) = f (x)
or if pv,x (τy ) = f (y). Since triples in C that satisfy alternative 2 result in an
error for the low-degree test if the appropriate point for evaluation is chosen, its
probability for rejection is at least
2h 4h2 k 2 d
(1 − δ) − δ.
2h + 1 |F | − 1
Half of this value is contributed by triples (x, v, y) ∈ C for which pv,x (τx ) = f (x)
or pv,x (τy ) = f (y). The other half arises from triples (y, v, x) for which (x, v, y) ∈
C and pv,x (τx ) = f (x) or pv,x (τy ) = f (y). 2
Proof. For a fixed x ∈ F k let mx be the the number of v ∈ H such that the
value pv,x (τx ) specified by π satisfies pv,x (τx ) = f (x). The rejection probability
. Now for any v ∈ H there cannot be more than mx many v ∈ H
mx
is 1 − |F kx|·|H|
such that (x, v, v ) satisfies pv,x (τx )
= pv ,x (τx ). Applying this to the |H| many
directions v there are at most |H| · x mx triples that do not contribute to π’s
inconsistency. Rearranging shows that the inconsistency is at least as large as
the rejection probability.
Vice versa, for fixed x there must be an H ⊂ H with |H | = mx such that
for all v, v ∈ H the m2x many equations pv,x (τx ) = pv ,x (τx ) are satisfied. Thus
2
x mx
the inconsistency is upper bounded by 1 − . The
latter is easily shown
|F k |·|H|2
mx
to be at most twice the rejection probability, i.e., 2 · 1 − |F kx|·|H| . 2
Without loss of generality we may assume that for the inputted pair (f0 , π0 )
function f0 is already a majority function for π0 . Else we could just define the
first pair in the sequence of (fi , πi ) by changing stepwise one value of f0 while
Testing Low Degree Trigonometric Polynomials 89
The proof needs several additional technical results. Let us first collect them and
then prove the proposition. The following definition specifies certain point sets
important in the further analysis.
Definition 5. Let a pair (f, π) as above be given. Let α := 10−2 for the rest of
the paper.
a) Define S ⊆ F k to consist of those points x for which the fraction of directions
v ∈ H satisfying pv,x (τx ) = f (x) is less than 1 − α.
b) For v ∈ H define S(v)
⊆ F k as S(v) := {x ∈ F k |x ∈ S and pv,x (τx ) =
f (x)}.
The set S contains those points for which there are relatively many, namely
at least α|H|, inconsistencies between different line polynomials through x and
the value f (x). The set S(v) on the other hand contains the points for which
most of the line polynomials agree with f on x, but the particular pv,x does
not. As consequence, the latter disagrees with most of the others with respect to
point x.
The main purpose using the following proposition is to pick out a line along
which the given proof can be changed in such a way that its inconsistency re-
duces. For obtaining this line v∗ ,x∗ the objects x∗ and v ∗ are determined by the
following crucial proposition. Due to its length and technical feature the proof
has to be postponed to the full version. We also note that at this point the
significance of Proposition 3 may be hard to see. Its meaning will become clear
in the proof of Proposition 2.
1. ∗ );
x∗ ∈ S(v
2. at most 40 1
α · |F | points on v∗ ,x∗ belong to S;
3. |H | ≥ (1 − 4α)|H| and
4. for all v ∈ H
i) the fraction of pairs (t, s) ∈ F 2 for which pv∗ ,x∗ +sv (τx∗ +tv∗ +sv ) =
pv,x∗ +tv∗ (τx∗ +tv∗ +sv ) is at most 14 and
ii) the fraction of s ∈ F for which pv∗ ,x∗ +sv (τx∗ +sv ) = pv,x∗ (τx∗ +sv ) is at
most 12 .
Fig. 1. The figure shows those values that are compared in the fourth item of Propo-
sition 3
The second technical result that we need is a direct adaption of a similar lemma
by Arora and Safra [3] to trigonometric polynomials. It says that if the entries
of an |F | × |F | matrix both row-wise and column-wise arise to a large extent
from univariate polynomials, then the majority of values of the entire matrix
arise from a bivariate polynomial.
Lemma 2. (see [2], adapted for trigonometric polynomials) Let d˜ ∈ N, |F | ≥
104 (2d˜ + 1)3 . Suppose there are two sets of univariate trigonometric degree d˜
polynomials {rs }s∈F and {ct }t∈F such that the fraction of pairs (s, t) ∈ F 2 for
which there is a disagreement, i.e., rs (t) = ct (s), is at most 14 . Then there exists
a bivariate trigonometric max degree d˜ polynomial Q(s, t) such that for at least a
3 -fraction of rows s it holds that rs (t) ≡ Q(s, t); similarly for at least a 3 -fraction
2 2
1 2hkd
− .
3 |F |
Proof of Claim 1: By Lemma 2 R(v ) is the unique polynomial to which the
(v )
function t → ct (0) is close with a distance of at most 13 . If R(v ) ≡ R(v ) ,
then as polynomials of degree hkd they differ in at least |F | − 2hkd points, thus
(v ) (v )
t → ct (0) and t → ct (0) have at least the claimed distance.
Next consider the number of inconsistencies on v∗ ,x∗ , i.e., the number of
triples (y, v, w) ∈ v∗ ,x∗ × H 2 for which pv,y (τy ) = pw,y (τy ). Proposition 3 intu-
itively implies that the number of inconsistencies cannot be too large. On the
other hand, Claim 1 above implies that any two v , v for which R(v ) ≡ R(v )
will lead to many inconsistencies on v∗ ,x∗ . Hence, for most v , v ∈ H it will be
the case that R(v ) ≡ R(v ) . More precisely:
Claim 2: The number of pairs (v , v ) ∈ (H )2 for which R(v ) ≡ R(v )
is at
least
2α
(1 − 4α) − 1
2
· |H|2 . (1)
3 − 1
40 α − 2hkd
|F |
For any y ∈ S there are at least (1 − α)|H| directions w ∈ H such that the
values pw,y (τy ) coincide with f (y) and thus with each other; so for such a fixed
y at least (1 − α)2 |H|2 triples will not result in an inconsistency. Vice versa, at
most (1 − (1 − α)2 )|H|2 ≤ 2α|H|2 inconsistencies can occur. Since there are at
most |F | choices for y ∈ v∗ ,x∗ we have the following upper bound:
|{(y, v, w) ∈ v∗ ,x∗ × H 2 |y ∈ S and pv,y (τy ) = pw,y (τy )}| ≤ 2α|H|2 |F |. (2)
Next consider inconsistencies (y, v , v ) caused by (v , v ) ∈ H such that
(v )
R ≡ R(v ) . According to Claim 1 each such pair (v , v ) implies the existence
of at least 13 |F | − 2hkd points y ∈ v∗ ,x∗ such that (y, v , v ) is an inconsistency
for π. Requiring in addition y ∈ S according to Proposition 3 will still give at
least 13 |F |−2hkd− 40 1
α|F | many such y, i.e., for each (v , v ) ∈ H , R(v ) ≡ R(v )
it holds
1 1
|{y ∈ v ,v |y ∈ S and pv ,y (τy ) = pv ,y (τy )}| ≥ |F | − 2hkd − α|F |. (3)
3 40
Combining (2) and (3) it follows that the number of pairs (v , v ) ∈ (H )2 for
which R(v ) ≡ R(v ) is upper bounded by
2α|H|2 |F | 2α
= · |H|2 .
3 |F | − 2hkd − 40 α|F | − −
1 1 1 1 2hkd
3 40 α |F |
From α := 10−2 in Definition 5 and our assumption that |F | ≥ 104 (2hkd + 1)3
it follows that β > 0.84.
Claim 4: The majority polynomial R and r0 are different: R ≡ r0 .
(v )
Proof of Claim 4: Recall that by definition r0 (t) equals r0 (t) for each v ∈ H
and is the polynomial which is claimed by π on v∗ ,x∗ . Similarly, for the majority
of v ∈ H polynomial R(t) equals R(v ) (t). We prove Claim 4 by showing that
the particular value R(0) is attained for more choices of v ∈ H than r0 (0).
(v )
First note that item 4,ii) of Proposition 3 for all v ∈ H implies c0 (s) :=
pv∗ ,x∗ +sv (τx∗ +sv ) = pv ,x∗ (τx∗ +sv ) for at least 12 |F | values of s. Next, Lemma
(v )
2 implies for each v ∈ H that for at least 23 |F | values of s it holds rs (t) =
Q(v ) (s, t) as polynomials in t. For those s it follows in particular that Q(v ) (s, 0) =
(v )
rs (0) = pv∗ ,x∗ +sv (τx∗ +sv ).
Combining the two equations results for each v in at least ( 23 − 12 )|F | many
(v )
values for s for which c0 (s) = Q(v ) (s, 0). Now since both functions are uni-
variate polynomials of degree at most khd they are equal as long as |F | is large
enough.
(v )
Next, it follows that pv ,x∗ (τx∗ ) = c0 (0) = Q(v ) (0, 0) = R(v ) (0); the latter
by definition of R(v ) and pv ,x∗ (τx∗ ) equals the value R(0) for at least β|H|
choices of v ∈ H .
On the other hand it is x∗ ∈ S(v ∗ ), thus for at most α|H| many w ∈ H the
value r0 (0) = pv∗ ,x∗ (τx∗ ) conincides with pw,x∗ (τx∗ ). But β > α, therefore the
claim R ≡ r0 follows.
What remains to be done is to show that using R instead of r0 in the corre-
sponding segment of π strictly reduces its inconsistency.
Claim 5: The number of pairs (y, w) with y ∈ v∗ ,x∗ and w ∈ H for which py,w
agrees with R on y is larger than the number of such pairs for which py,w agrees
with r0 on y.
Proof of Claim 5: Since R = r0 they agree in at most 2hkd points on v∗ ,x∗ .
By the inclusion-exclusion principle it thus suffices to show that among the
|F ||H| triples of form (y, v ∗ , w), y ∈ v∗ ,x∗ , w ∈ H (note that v ∗ is fixed) there
are more than ( 12 |F | + 2hkd)|H| many for which pw,y agrees with R on x∗ .
By Lemma 2 and Claim 3 there exist β|H| directions v ∈ H for which the
(v )
distance from t → ct (0) to R is at most 13 . It follows that |{(y, w) ∈ v∗ ,x∗ ×
H|pw,y agrees with R on y}| ≥ β|H| · 23 |F |.
Plugging in the bounds for β and |F | gives β|H| · 23 |F | > ( 12 |F | + 2hkd)|H|.
This finishes the proof of Claim 5 and thus also the one of Proposition 2. 2
Proof. (of Theorem 3) We have shown that given a verification proof π and
a function f which is a majority function of π and not a max-degree 2hkd
polynomial we can construct a verification proof π with a majority function f
such that the following holds.
94 M. Baartse and K. Meer
– The univariate polynomials that π and π claim differ on one line (i.e. π and
π differ in one segment) and f and f disagree in at most |F | places.
– The inconsistency of π is strictly less than the inconsistency of π.
If we apply this construction iteratively it must come to an end after finitely
many steps because the inconsistency cannot be reduced an unbounded number
of times. Hence, at some point we must obtain a function fs which is a max-
degree 2hkd polynomial. Lemma 1 implies that for each (fi , πi ) in the sequence
the rejection probability is at most 2 and this finishes the proof. 2
Here is a brief outline of how to finish a proof of the real PCP theorem along
these lines. The next step is to use the low-degree test of the present paper
to design a sum-check procedure establishing (once again) the characterization
NPR = PCPR (O(log n), poly log n). This in principle is done using the ideas from
[13]. As in the original proof the verifier resulting from combining the low-degree
test and the sum-checking procedure lacks the necessary segmentation properties
for applying verifier composition; it reads too many blocks. To repair this a
second test is developed which together with using the low-degree test allows to
restructure sum-checking in an appropriate way so that a properly segmented
version is obtained. Though this procedure is not as general as the original
ongoing by Arora et al., which gives quite a general segmentation procedure, it
turns out to be sufficient for our purposes. In a final step, composition of real
verifiers has to be worked out in detail and applied to the long transparent verifier
from [12,6] and the verifier obtained from the above considerations. Filling all
details requires a significant amount of work and space. Therefore we postpone
it to the full version as explained in the introduction.
Let us mention briefly another outcome once a proof of the PCP theorem as
indicated above is at hand. In our main result there seemingly is a discrepancy
with respect to the test accepting degree d polynomials on one side and rejecting
functions far away from degree 2hkd polynomials on the other. This lacking
sharpness is of no concern for our results but seems a bit unusual in comparison
to similar results in testing. However, the full proof can be used to close this
degree gap and make the result sharp from that point of view.
Another line of future research addresses the area of locally testable codes. The
paper shows that trigonometric polynomials can be used as such codes over the
real numbers. So far, not many results into this direction have been obtained in
the BSS model. For example, what about tests for algebraic polynomials? Using
our test for trigonometric polynomials we expect it is possible to design a test
for algebraic polynomials which uses a logarithmic number of random bits and
makes a constant number of queries.
Acknowledgement. Thanks go to the anonymous referees for very helpful
remarks.
References
1. Arora, S., Barak, B.: Computational Complexity: A Modern Approach. Cambridge
University Press (2009)
2. Arora, S., Lund, C., Motwani, R., Sudan, M., Szegedy, M.: Proof verification and
hardness of approximation problems. Journal of the ACM 45(3), 501–555 (1998)
3. Arora, S., Safra, S.: Probabilistic checking proofs: A new characterization of NP.
Journal of the ACM 45(1), 70–122 (1998)
4. Ausiello, G., Crescenzi, P., Gambosi, G., Kann, V., Marchetti-Spaccamela, A., Pro-
tasi, M.: Complexity and Approximation: Combinatorial Optimization Problems
and Their Approximability Properties. Springer (1999)
5. Baartse, M., Meer, K.: The PCP theorem for NP over the reals. To appear in
Foundations of Computational Mathematics. Springer
96 M. Baartse and K. Meer
6. Baartse, M., Meer, K.: Topics in real and complex number complexity theory. In:
Montana, J.L., Pardo, L.M. (eds.) Recent Advances in Real Complexity and Com-
putation, Contemporary Mathematics, vol. 604, pp. 1–53. American Mathematical
Society (2013)
7. Blum, L., Cucker, F., Shub, M., Smale, S.: Complexity and Real Computation.
Springer (1998)
8. Blum, L., Shub, M., Smale, S.: On a theory of computation and complexity over
the real numbers: NP-completeness, recursive functions and universal machines.
Bull. Amer. Math. Soc. 21, 1–46 (1989)
9. Bürgisser, P., Clausen, M., Shokrollahi, M.A.: Algebraic Complexity Theory.
Springer (1997)
10. Dinur, I.: The PCP theorem by gap amplification. Journal of the ACM 54(3) (2007)
11. Friedl, K., Hátsági, Z., Shen, A.: Low-degree tests. In: Proc. SODA, pp. 57–64
(1994)
12. Meer, K.: Transparent long proofs: A first PCP theorem for NPR .. Foundations of
Computational Mathematics 5(3), 231–255 (2005)
13. Meer, K.: Almost transparent short proofs for NPR . In: Owe, O., Steffen, M., Telle,
J.A. (eds.) FCT 2011. LNCS, vol. 6914, pp. 41–52. Springer, Heidelberg (2011)
Property Testing Bounds for Linear and
Quadratic Functions via Parity Decision Trees
1 Introduction
The field of property testing broadly deals with determining whether a given
object satisfies a property P or is very different from all the objects that satisfy
P. In this paper, the objects of interest are Boolean functions on n variables,
i.e. functions of the form
f : {0, 1}n → {0, 1}.
A Boolean function property P is a collection of Boolean functions. Given a
function g and a parameter , the goal of a tester is to distinguish between the
following two cases:
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 97–110, 2014.
c Springer International Publishing Switzerland 2014
98 A. Bhrushundi, S. Chakraborty, and R. Kulkarni
– g∈P
– g differs from every function in P in at least fraction of points in {0, 1}n.
The query complexity for testing P is the number of queries (of the form “what
is the value of g at x ∈ {0, 1}n?”) made by the best tester that distinguishes
between the above two cases. If the queries made by the tester depend on the
answers to the previous queries, the tester is called adaptive. Also, if the tester
accepts whenever g ∈ P, it is called one-sided.
Testing of Boolean function properties has been extensively studied over the
last couple of decades (See [16,28]). Examples of problems that have been stud-
ied are linearity testing [11], k-junta testing [17,7], monotonicity testing [18,13],
k-linearity testing [19,8,12] etc. An important problem in the area is to char-
acterize Boolean function properties whose query complexity is constant (i.e.,
independent of n, though it can depend on ). For example, such a characteriza-
tion is known in the case of graph properties [1]. Though a general characteriza-
tion for function properties is not yet known, there has been progress for some
special classes of properties. In this paper, we attempt characterizing one such
class: properties which only consist of linear functions. More specifically, we try
to characterize all properties P of linear Boolean functions which can be tested
using constant number of queries.
An example of a property of linear functions is one that contains all parities
on k variables. The problem of testing this property is known as k-linearity
testing. While this problem had been studied earlier [19], recently Blais et al. [8]
used communication complexity to obtain a lower bound of Ω(k) on the query
complexity of adaptive testers for k-linearity. The best known upper bound in
the case of adaptive testers is O(k log k). Whereas a tight bound of Θ(k log k) is
known for the non-adaptive case [12], a gap still exists for adaptive testing: Ω(k)
vs O(k log k). In this paper we give another approach to obtain the Ω(k) lower
bound for the adaptive query complexity. While the lower bound technique of
Blais et al.[8] is unlikely to give a bound beyond Ω(k), our technique has the
potential of proving a better lower bound. We remark that other proof techniques
for the lower bound have also been studied [9].
A rich class of properties for which characterizing constant query testability
has been studied are properties that are invariant under natural transformations
of the domain. For example, [22,4,3] study invariance under affine/linear trans-
formations in this context. Properties that consist of functions isomorphic to a
given function also form an important subclass. The testing of such properties
is commonly referred to as isomorphism testing, and has seen two directions of
study: testing if a function is equivalent to a given function up to permutation
of coordinates [14,10], and testing affine/linear isomorphism.
Our second result1 concerns testing affine isomorphism. A function f is affine
isomorphic to g if there is an invertible affine transformation T such that f ◦ T =
g. Recently, Wimmer and Yoshida [30] characterized the query complexity of
testing affine/linear isomorphism to a function in terms of its Fourier norm. We
complement their work by providing the first example of a function for which
1
This result appears in the preprint [5].
Property Testing Bounds for Linear and Quadratic Functions 99
This is the first such characterization of linear function properties and we hope
our result is a small step towards our understanding of function properties
testable in constant number of queries.
Testing k-linearity. We also obtain an alternate proof of the lower bound for
testing k-linearity due to Blais et al. [8].
Theorem 4. Any adaptive two-sided tester for testing k-linearity requires Ω(k)
queries.
The idea behind the proof is as follows. Applying Theorem 1 in the case of
k-linearity, EP turns out to be equal to the function Ek that outputs 1 if and
only if there are exactly k 1s in the input string. Thus, to prove Theorem 4 we
lower bound the randomized parity decision tree complexity of Ek by Ω(k).
Note that this leaves open the possibility of proving a tight Ω(k log k) bound
for testing k-linearity by improving our lower bound on the randomized parity
decision tree complexity of Ek .
Lower Bound for Testing Affine Isomorphism. Let IPn (x) denote the
n/2
inner product function i=1 xi xn/2+i . We consider the problem of testing affine
isomorphism to IPn (x) and prove a tight lower bound.
Theorem 5. Any adaptive two-sided tester for testing affine isomorphism to
IPn (x) requires Ω(n2 ) queries.
The proof of Theorem 5 is similar to that of Theorem 4, though in this case,
EP turns out to be En , a function that maps graphs on n vertices to {0, 1}, and
outputs 1 if and only if the input graph’s adjacency matrix is nonsingular over
F2 . As mentioned before, this is the first example of a function for which testing
affine isomorphism requires Ω(n2 ) queries (O(n2 ) is a trivial upper bound for
any function and follows from a folklore result).
It can be show that testing the set of quadratic Bent functions reduces to
testing affine isomorphism to IPn (x). Thus, Theorem 5 gives a lower bound for
testing the set of quadratic Bent functions. Furthermore, using a result from
[15], the following corollary can be obtained.
Corollary 1. Any adaptive two-sided tester for testing the set of Bent functions
requires Ω(n2 ) queries.
2 Preliminaries
2.1 Boolean Functions
Recall that functions mapping {0, 1}n to {0, 1}are called Boolean functions. A
Boolean function is linear if it is expressible as i∈S xi for S ⊆ [n] over F2 . The
set of linear functions will be denoted by L.
Property Testing Bounds for Linear and Quadratic Functions 101
Parity decision trees extends the model of ordinary decision trees such that one
may
query the parity of a subset of input bits, i.e. the queries are of form “is
i∈S xi ≡ 1 (mod 2)? ” for an arbitrary subset S ⊆ [n]. We call such queries
parity queries.
Let f be a Boolean function. For a parity decision tree Pf for f, let C(Pf , x)
denote the number of parity queries made by Pf on input x. The parity decision
tree complexity of f is D⊕ (f ) = minPf maxx C(Pf , x).
Note that D⊕ (f ) ≤ D(f ), where D(f ) is the deterministic decision tree com-
plexity of f , as the queries made by a usual decision tree, “is xi = 1?”, are also
valid parity queries.
f
A bounded error randomized parity decision tree R⊕ is a probability distribu-
tion over all deterministic decision trees such that for every input the expected
f
error of the algorithm is bounded by 1/3. The cost C(R⊕ , x) is the highest pos-
f
sible number of queries made by R⊕ on x, and the bounded error randomized
f
decision tree complexity of f is R⊕ (f ) = minRf maxx C(R⊕ , x)
⊕
For a Boolean function f , it turns out that R⊕ (f ) can be lower bounded by the
randomized communication complexity of the so-called XOR function f (x ⊕ y)
(See [23] for the definition of randomized communication complexity and XOR
functions). So we have the following lemma.
Proof. Given a Boolean function f : {0, 1}n → {0, 1} on n consider the commu-
nication game where x is with Alice and y is with Bob and they want to compute
f (x ⊕ y) with error bounded by 1/3. Let RCC(f (x ⊕ y)) denote the randomized
communication complexity of this communication game.
f
Given a randomized parity decision tree R⊕ , Alice and Bob can convert it
f
into a protocol by simulating the parity queries made by R⊕ by two bits of
communication, and thus the inequality follows.
Let ei ∈ {0, 1}n denote the Boolean string whose ith bit is 1 and all other bits
are 0. For any linear function f let us define a string B(f ) ∈ {0, 1}n such that
the ith bit of B(f ) is 1 iff f (ei ) = 1. The following lemma is easy to prove:
Property Testing Bounds for Linear and Quadratic Functions 103
Lemma 3. The map B : L → {0, 1}n gives a bijection between the set L and
strings of length n.
We omit the proof of Lemma 4 as it follows directly from Lemma 3 and Obser-
vation 1.
Now, by Lemma 4, testing where f is in P or is 1/2-far from P is exactly same
as deciding if B(f ) ∈ SP . Furthermore, we can translate the queries made by the
tester T to the truth table of f into parity
queries to the string B(f ), and vice-
versa. Since f is linear, we have f (x) = i xi · f (ei ). Now, if Sx := {i | xi = 1}
then, whenever T queries f at x, it can be equivalently viewed as the query
i∈Sx (B(f ))i made to B(f ).
Consider the Boolean function EP : {0, 1}n → {0, 1}, where EP (x) = 1 iff
−1
B (x) ∈ P. From the above discussion, deciding “is x ∈ SP ?” is same as
deciding “is EP (x) = 1?” Thus we have:
Notice that Theorem 1 follows from this by using Q1/2 (P) ≥ Q1 (P) from Ob-
servation 2.
c2 · (||f||1 )2
1/4
2
For the purpose of this section, it will be convenient to assume that the range of a
Boolean function is {−1, +1}.
Property Testing Bounds for Linear and Quadratic Functions 105
Proof. For the first inequality, we obtain from Lemma 2 that RCC(f (x ⊕ y)) ≤
2R⊕ (f ). Now, it is well known that RCC(f (x ⊕ y)) = Ω(log ||f||1 ) (see for
1/4
To see the second inequality, we will construct a randomized parity decision tree3
T with query complexity O((||f||1 )2 ) that computes f . Let g : {0, 1}n → R be a
1/4
function that point-wise 1/4-approximates f (i.e. for all x, |f (x) − g(x)| ≤ 1/4)
such that || g||1 is the minimum among all functions that 1/4-approximate f .
Let Dg denote a distribution on subsets of [n] such that a set S has probability
|ĝ(S)|/||
g||1 .
We define the randomized parity decision tree T as follows. T makes d (the
parameter will be fixed later) random parity queries S1 , S2 . . . Sd , such that each
Si is distributed according to Dg . Let X1 , X2 , . . . Xd be random variables such
that
sign(ĝ(Si ))(−1) j∈Si xj
Xi =
||
g ||1
Here the sign function sign(x) outputs −1 is x < 0, and 1 otherwise. Finally, the
tree outputs sign( di=1 Xi ).
The first thing to note is that
sign(ĝ(Si ))(−1) j∈Si xj
|ĝ(S)| g(x)
E[Xi ] = =
||
g||1 ||
g ||1 g ||1 )2
(||
S⊆[n]
d
Let X = i=1 Xi . Then, E[X] = d · g(x)/(||g ||1 )2 . Setting d = 100 · (||
g ||1 )2 , we
get E[X] = 100 · g(x).
g||1 , +1/||
Now each Xi is bounded and lies in [−1/|| g||1 ]. Thus by Hoeffding’s
inequality we have
−2 · (50)2 −25
Pr[|X − E[X]| ≥ 50] ≤ exp = exp . (2)
400 2
Let P be a property of linear functions, and Q1 (P) denote the query complex-
ity of testing P when the input function is promised to be linear. Then, from
the above lemma and Theorem 6, there exist constants c1 , c2 > 0 such that for
large enough n,
P ||1/4 ≤ Q1 (P) ≤ c2 · (||E
c1 · log ||E P ||1/4 )2 (4)
1 1
Using Observation 2 and 3 and Equation 4, we get, for ∈ (0, 1/4), there exists
a constant c2 that depends on such that for large enough n:
Thus, we can conclude the Theorem 3 from the discussion: a property P of linear
P ||1/4 is
functions is testable using constant number of queries if and only if ||E 1
constant.
5 Testing k-linearity
In this section we apply the result from Section 3 to prove a lower bound for
testing k-linearity. We shall use P to denote the set of k-linear functions on n
variables.
Let Ek : {0, 1}n → {0, 1} denote the Boolean function that outputs 1 if and
only if the number of 1s is exactly k. Recall a notation from Section 3: for any
linear function f we can define a string B(f ) ∈ {0, 1}n such that B(f )i = 1 iff
f (ei ) = 1. We observe the following:
Observation 5. A Boolean function f is k-linear if and only if B(f ) has exactly
k 1s.
Thus, EP is exactly the function Ek . Using Theorem 6 we have the following:
Thus we obtain a lower bound of Ω(k) using the lower bound for the randomized
communication complexity of the XOR function Ek (x ⊕ y). Note that using this
method we cannot expect to obtain a better lower bound as there is an upper
bound of O(k) on the communication complexity. But there is hope that one may
be able to obtain a better lower bound for the parity decision tree complexity of
Ek directly.
On the other hand, if one is able to construct a randomized parity decision tree of
depth O(k) for deciding Ek , Lemma 5 immediately implies a tester for k-linearity
that makes O(k) queries under the promise that the input function is linear. Notice
that the exact complexity for even the promise problem is not known and the best
upper bound is O(k log k). (while, naturally, the lower bound is Ω(k).)
Let Mn (F2 ) denote the set of n × n matrices over F2 , and Detn : Mn (F2 ) →
{0, 1} be the function such that Detn (A) = 1 iff A ∈ Mn (F2 ) is nonsingular.
The following result from [29] analyzes the communication complexity of Detn .
Lemma 11. RCC(Detn (x ⊕ y)) = Ω(n2 )
It turns out that the communication complexity of Detn relates to that of En .
Lemma 12. = RCC(Detn (x ⊕ y)) ≤ RCC(E2n (x ⊕ y))
Proof. Let A ∈ Mn (F2 ). Consider the 2n × 2n matrix A given by
0 At
A :=
A 0
A ∈ G2n by construction and it can be easily verified that A is nonsingular iff
A is nonsingular.
Now, let the inputs to Alice and Bob be A and B respectively. Since (A⊕B) =
A ⊕ B , Detn (A ⊕ B) = 1 iff E2n ((A ⊕ B) ) = 1 iff E2n (A ⊕ B ) = 1. Thus, to
Proof. It is well known via [2] that Q is testable with constant number of queries
(say q1 ()). Suppose there is a tester that tests B using q2 (, n) queries. From
Lemma 14, we know that dist(B \ Q, Q \ B) ≥ 14 . Thus, by Lemma 13, we have
that there is a tester that makes O(max{q1 (), q1 ( 18 )} + max{q2 (, n), q2 ( 18 , n)})
queries to -test B ∩ Q.
Setting = 14 , we have a tester that makes O(q1 ( 18 ) + q2 ( 18 , n)) queries to test
if a given f is in B ∩ Q, or 1/4-far from it. Since Q1/4 (B ∩ Q) = Ω(n2 ) and q1 ( 18 )
is a constant, we get q2 ( 18 , n) = Ω(n2 ), which completes the proof.
References
1. Alon, N., Fischer, E., Newman, I., Shapira, A.: A combinatorial characterization
of the testable graph properties: It’s all about regularity. SIAM J. Comput. 39(1),
143–167 (2009)
2. Alon, N., Kaufman, T., Krivelevich, M., Litsyn, S.N., Ron, D.: Testing low-
degree polynomials over GF(2). In: Arora, S., Jansen, K., Rolim, J.D.P., Sahai, A.
(eds.) APPROX 2003 + RANDOM 2003. LNCS, vol. 2764, pp. 188–199. Springer,
Heidelberg (2003)
3. Bhattacharyya, A., Fischer, E., Hatami, H., Hatami, P., Lovett, S.: Every locally char-
acterized affine-invariant property is testable. In: Proceedings of the 45th Annual
ACM Symposium on Symposium on Theory of Computing, STOC 2013, pp. 429–436.
ACM Press, New York (2013), http://doi.acm.org/10.1145/2488608.2488662
4. Bhattacharyya, A., Grigorescu, E., Shapira, A.: A unified framework for testing
linear-invariant properties. In: Proceedings of the 51st Annual IEEE Symposium
on Foundations of Computer Science, pp. 478–487 (2010)
5. Bhrushundi, A.: On testing bent functions. Electronic Colloquium on Computa-
tional Complexity (ECCC) 20, 89 (2013)
6. Bhrushundi, A., Chakraborty, S., Kulkarni, R.: Property testing bounds for lin-
ear and quadratic functions via parity decision trees. Electronic Colloquium on
Computational Complexity (ECCC) 20, 142 (2013)
7. Blais, E.: Testing juntas nearly optimally. In: Proc. ACM Symposium on the The-
ory of Computing, pp. 151–158. ACM, New York (2009)
8. Blais, E., Brody, J., Matulef, K.: Property testing via communication complexity.
In: Proc. CCC (2011)
9. Blais, E., Kane, D.: Tight bounds for testing k-linearity. In: Gupta, A., Jansen,
K., Rolim, J., Servedio, R. (eds.) APPROX/RANDOM 2012. LNCS, vol. 7408,
pp. 435–446. Springer, Heidelberg (2012)
10. Blais, E., Weinstein, A., Yoshida, Y.: Partially symmetric functions are efficiently
isomorphism-testable. In: FOCS, pp. 551–560 (2012)
11. Blum, M., Luby, M., Rubinfeld, R.: Self-testing/correcting with applications to
numerical problems. In: STOC, pp. 73–83 (1990)
110 A. Bhrushundi, S. Chakraborty, and R. Kulkarni
12. Buhrman, H., Garcı́a-Soriano, D., Matsliah, A., de Wolf, R.: The non-adaptive
query complexity of testing k-parities. CoRR abs/1209.3849 (2012)
13. Chakrabarty, D., Seshadhri, C.: A o(n) monotonicity tester for boolean functions
over the hypercube. CoRR abs/1302.4536 (2013)
14. Chakraborty, S., Fischer, E., Garcı́a-Soriano, D., Matsliah, A.: Junto-symmetric
functions, hypergraph isomorphism and crunching. In: IEEE Conference on Com-
putational Complexity, pp. 148–158 (2012)
15. Chen, V., Sudan, M., Xie, N.: Property testing via set-theoretic operations. In:
ICS, pp. 211–222 (2011)
16. Fischer, E.: The art of uninformed decisions: A primer to property testing. Sci-
ence 75, 97–126 (2001)
17. Fischer, E., Kindler, G., Ron, D., Safra, S., Samorodnitsky, A.: Testing juntas.
Journal of Computer and System Sciences 68(4), 753–787 (2004), Special Issue on
FOCS 2002
18. Fischer, E., Lehman, E., Newman, I., Raskhodnikova, S., Rubinfeld, R., Samorod-
nitsky, A.: Monotonicity testing over general poset domains. In: STOC, pp. 474–483
(2002)
19. Goldreich, O.: On testing computability by small width obdds. In: Serna, M.,
Shaltiel, R., Jansen, K., Rolim, J. (eds.) APPROX 2010. LNCS, vol. 6302,
pp. 574–587. Springer, Heidelberg (2010)
20. Grigorescu, E., Wimmer, K., Xie, N.: Tight lower bounds for testing linear isomor-
phism. In: Raghavendra, P., Raskhodnikova, S., Jansen, K., Rolim, J.D.P. (eds.)
RANDOM 2013 and APPROX 2013. LNCS, vol. 8096, pp. 559–574. Springer,
Heidelberg (2013)
21. Huang, W., Shi, Y., Zhang, S., Zhu, Y.: The communication complexity of the
hamming distance problem. Inf. Process. Lett. 99(4), 149–153 (2006)
22. Kaufman, T., Sudan, M.: Algebraic property testing: the role of invariance. In:
STOC, pp. 403–412 (2008)
23. Lee, T., Shraibman, A.: Lower bounds in communication complexity. Foundations
and Trends in Theoretical Computer Science 3(4), 263–398 (2009)
24. MacWilliams, F.J., Sloane, N.J.A.: The Theory of Error-Correcting Codes (North-
Holland Mathematical Library). North Holland Publishing Co. (June 1988),
http://www.worldcat.org/isbn/0444851933
25. Neumann, T.: Bent functions, Master’s thesis (2006)
26. O’Donnell, R.: Analysis of boolean functions (2012),
http://www.analysisofbooleanfunctions.org
27. Rothaus, O.: On bent functions. Journal of Combinatorial Theory, Series
A 20(3), 300–305 (1976), http://www.sciencedirect.com/science/article/
pii/0097316576900248
28. Rubinfeld, R., Shapira, A.: Sublinear time algorithms. Electronic Colloquium on
Computational Complexity (ECCC) 11(013) (2011)
29. Sun, X., Wang, C.: Randomized communication complexity for linear algebra prob-
lems over finite fields. In: STACS, pp. 477–488 (2012)
30. Wimmer, K., Yoshida, Y.: Testing linear-invariant function isomorphism. In:
Fomin, F.V., Freivalds, R., Kwiatkowska, M., Peleg, D. (eds.) ICALP 2013, Part
I. LNCS, vol. 7965, pp. 840–850. Springer, Heidelberg (2013)
31. Zhang, Z., Shi, Y.: On the parity complexity measures of boolean functions. Theor.
Comput. Sci. 411(26-28), 2612–2618 (2010)
A Fast Branching Algorithm
for Cluster Vertex Deletion
1 Introduction
The problem to cluster objects based on their pairwise similarities has arisen
from applications both in computational biology [6] and machine learning [5]. In
the language of graph theory, as an input we are given a graph where vertices
correspond to objects, and two objects are connected by an edge if they are
observed to be similar. The goal is to transform the graph into a cluster graph
(a disjoint union of cliques) using a minimum number of modifications.
The set of allowed modifications depends on the particular problem variant
and an application considered. Probably the most studied variant is the Cluster
Editing problem, known also as Correlation Clustering, where we seek for
a minimal number of edge edits to obtain a cluster graph. The study of Cluster
Editing includes [3, 4, 14, 20, 31] and, from the parameterized perspective,
[7–11, 15, 16, 19, 22–24, 27–29].
The main principle of parameterized complexity is that we seek algorithms
that are efficient if the considered parameter is small. However, the distance
Partially supported by NCN grant N206567140 and Foundation for Polish Science.
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 111–124, 2014.
c Springer International Publishing Switzerland 2014
112 A. Boral et al.
measure in Cluster Editing, the number of edge edits, may be quite large
in practical instances, and, in the light of recent lower bounds refuting the ex-
istence of subexponential FPT algorithms for Cluster Editing [19, 27], it
seems reasonable to look for other distance measures (see e.g. Komusiewicz’s
PhD thesis [27]) and/or different problem formulations.
In 2008, Hüffner et al. [25, 26] initiated the parameterized study of the
Cluster Vertex Deletion problem (ClusterVD for short). Here, the al-
lowed modifications are vertex deletions.
Cluster Vertex Deletion (ClusterVD) Parameter: k
Input: An undirected graph G and an integer k.
Question: Does there exist a set S of at most k vertices of G such that G \ S
is a cluster graph, i.e., a disjoint union of cliques?
In terms of motivation, we want to refute as few objects as possible to make
the set of observations completely consistent. Since a vertex deletion removes as
well all its incident edges, we may expect that this new editing measure may be
significantly smaller in practical applications than the edge-editing distance.
As ClusterVD can be equivalently stated as the problem of hitting, with
minimum number of vertices, all induced P3 s (paths on 3 vertices) in the input
graph, ClusterVD can be solved in O(3k (n + m)) time by a straightforward
branching algorithm [13], where n and m denote the number of vertices and edges
of G, respectively. The dependency on k can be improved by considering more
elaborate case distinction in the branching algorithm, either directly [21], or via a
general algorithm for 3-Hitting Set [17]. Hüffner et al. [26] provided an elegant
O(2k k 9 + nm)-time algorithm, using the iterative compression principle [30]
and a reduction to the weighted maximum matching problem. This algorithm,
presented at LATIN 2008 [25], quickly became one of the textbook examples of
an application of the iterative compression technique.
In our work we pick up this line of research and obtain the fastest algorithm
for (unweighted) ClusterVD.
Theorem 1. Cluster Vertex Deletion can be solved in O(1.9102k (n + m))
time and polynomial space on an input (G, k) with |V (G)| = n and |E(G)| = m.
The source of the exponential 2k factor in the time complexity of the algorithm
of [26] comes from enumeration of all possible intersections of the solution we
are looking for with the previous solution of size (k + 1). As the next step in
each subcase is a reduction to the weighted maximum matching problem (with
a definitely nontrivial polynomial-time algorithm), it seems hard to break the
2k -barrier using the approach of [26]. Hence, in the proof of Theorem 1 we go
back to the bounded search tree approach. However, to achieve the promised
time bound, and at the same time avoiding very extensive case analysis, we
do not follow the general 3-Hitting Set approach. Instead, our methodology
is to carefully investigate the structure of the graph and an optimum solution
around a vertex already guessed to be not included in the solution. We note
that a somehow similar approach has been used in [26] to cope with a variant of
ClusterVD where we restrict the number of clusters in the resulting graph.
A Fast Branching Algorithm for Cluster Vertex Deletion 113
More precisely, the main observation in the proof of Theorem 1 is that, if for
some vertex v we know that there exists a minimum solution S not containing
v, in the neighbourhood of v the ClusterVD problem reduces to Vertex
Cover. Let us define N1 and N2 to be the vertices at distance 1 and 2 from v,
respectively, and define the auxiliary graph Hv to be a graph on N1 ∪ N2 having
an edge for each edge of G between N1 and N2 and for each non-edge in G[N1 ].
In other words, two vertices are connected by an edge in Hv if, together with
v, they form a P3 in G. We observe that a minimum solution S not containing
v needs to contain a vertex cover of Hv . Moreover, one can show that we may
greedily choose a vertex cover with inclusion-wise maximal intersection with N2 ,
as deleting vertices from N2 helps us resolve the remaining part of the graph.
Branching to find the ‘correct’ vertex cover of Hv is very efficient, with worst-
case (1, 2) (i.e., golden-ratio) branching vector. However, we do not have the
vertex v beforehand, and branching to obtain such a vertex is costly. Our ap-
proach is to get as much gain as possible from the vertex cover-style branching
on the graph Hv , to be able to balance the loss from some inefficient branches
used to obtain the vertex v to start with. Consequently, we employ involved
analysis of properties and branching algorithms for the auxiliary graph Hv .
Note that the algorithm of Theorem 1 can be pipelined with the kernelization
algorithm of 3-Hitting Set [1], yielding the following corollary.
Corollary 2. Cluster Vertex Deletion can be solved in O(1.9102k k 4 +nm)
time and polynomial space on an input (G, k) with |V (G)| = n and |E(G)| = m.
However, due to the O(nm) summand in the complexity of Corollary 2, for a
wide range of input instances the running time bound of Theorem 1 is better
than the one of Corollary 2. In fact, the advantage of our branching approach
is that the obtained dependency on the graph size in the running time is linear,
whereas with the approach of [26], one needs to spend at least quadratic time
either on computing weighted maximum matching or on kernelizing the instance.
In the full version [12] we also analyse the co-cluster setting, where one aims
at obtaining a co-cluster graph instead of a cluster one, and show that the linear
dependency on the size of the input can be maintained also in this case.
The paper is organised as follows. We give some preliminary definitions and
notation in Section 2. In Section 3 we analyse the structural properties of the
auxiliary graph Hv . Then, in Section 4 we prove Theorem 1, with the main tool
being a subroutine branching algorithm finding all relevant vertex covers of Hv .
2 Preliminaries
We use standard graph notation. All our graphs are undirected and simple. For
a graph G, by V (G) and E(G) we denote its vertex- and edge-set, respectively.
For v ∈ V (G), the set NG (v) = {u | uv ∈ E(G)} is the neighbourhood of v in G
and NG [v] = NG (v) ∪ {v} is the closed neighbourhood.
We extend these notions
to sets of vertices X ⊆ V (G) by NG [X] = v∈X NG [v] and NG (X) = NG [X]\X.
We omit the subscript if it is clear from the context. For a set X ⊆ V (G) we
114 A. Boral et al.
Lemma 3. Let G be a connected graph which is not a clique. Then, for every
v ∈ V (G), there is a P3 containing v.
E(Hv ) = {uw | u, w ∈ N1 , uw ∈
/ E} ∪ {uw | u ∈ N1 , w ∈ N2 , uw ∈ E}.
We now investigate the case when Hv has a very specific structure. The motiva-
tion for this analysis will become clear in Section 4.3.
A seagull is a connected component of Hv that is isomorphic to a P3 with
middle vertex in N1 and endpoints in N2 . The graph Hv is called an s-skein if
it is a disjoint union of s seagulls and some isolated vertices.
4 Algorithm
In this section we show our algorithm for ClusterVD, proving Theorem 1. The
algorithm is a typical branching algorithm, where at each step we choose one
branching rule and apply it. In each subcase, a number of vertices is deleted,
and the parameter k drops by this number. If k becomes negative, the current
subcase is terminated with a negative answer. On the other hand, if k is non-
negative and G is a cluster graph, the vertices deleted in this subcase form a
solution of size at most k.
4.1 Preprocessing
At each step, we first preprocess simple connected components of G.
We are now ready to present a branching algorithm that guesses the ‘correct’
vertex cover of Hv , for a fixed vertex v. That is, we are now working in the setting
where we look for a minimum solution to ClusterVD on (G, k) not containing
v, thus, by Corollary 5, containing a vertex cover of Hv . Our goal is to branch
into a number of subcases, in each subcase picking a vertex cover of Hv . By
Corollary 8, our branching algorithm, to be correct, needs only to generate at
least one element from each equivalence class of the ‘equivalent’ relation, among
maximal elements in the ‘dominate’ relation.
The algorithm consists of a number of branching steps; in each subcase of
each step we take a number of vertices into the constructed vertex cover of Hv
and, consequently, into the constructed minimum solution to ClusterVD on
G. At any point, the first applicable rule is applied.
First, we disregard isolated vertices in Hv . Second, we take care of large-degree
vertices.
Note that Rule 1 yields a branching vector (1, d), where d ≥ 3 is the degree
of u in Hv . Henceforth, we can assume that vertices have degree 1 or 2 in Hv .
Assume there exists u ∈ N1 of degree 1, with uw ∈ E(Hv ). Moreover, assume
there exists a minimum solution S containing u. If w ∈ S, then, by Lemma 7,
S \ {u} is also a solution, a contradiction. If w ∈ N2 \ S, then (S \ {u}) ∪ {w}
dominates S. Finally, if w ∈ N1 \ S, then (S \ {u}) ∪ {w} is equivalent to S.
Hence, we infer the following greedy rule.
Rule 3. If there are vertices u, w ∈ N1 , uw ∈ E(Hv ) then include either NHv (w)
or NHv (u) into the vertex cover, that is, use the branching step (NHv (w), NHv (u)).
In the previous discussion we have argued that invoking each branching step
takes linear time. As in each branch we decrease the parameter k by at least
one, the depth of the recursion is at most k. In this section we analyse branching
vectors occurring in our algorithm. To finish the proof of Theorem 1 we need
to show that the largest positive root of the equation 1 = i=1 x−ai among all
r
Case 1. Here the algorithm of Section 4.3 performs branchings with vectors not
worse than (1, 2).
Case 3. The situation is analogous to the previous case. The script invokes
the procedure branch Hv on h = 3 and allow skein=False to obtain a list of
possible branching vectors. For each such vector, we append the entry (1) from
the subcase when v is deleted.
Summary. We infer that the largest root of the equation 1 = ri=1 x−ai occurs
for branching vector (1, 3, 3, 4, 4, 5) and is less than 1.9102. This branching vector
corresponds to Case 3 and the algorithm of Section 4.3, invoked on Hv , first
performs a branching step with the vector (1, 3) and in the branch with 1 deleted
vertex, finds Hv to be a 2-skein and performs two independent branching steps
with vectors (1, 2).
This analysis concludes the proof of Theorem 1. We remark that the worst
branching vector in Case 2 is (2, 2, 3, 3, 3) (with solution x < 1.8933), corre-
sponding to the case with single (1, 2)-branch when v is deleted and a 2-skein in
the case when v is kept. Obviously, the worst case in Case 1 is the golden-ratio
branch (1, 2) with solution x < 1.6181.
A Fast Branching Algorithm for Cluster Vertex Deletion 123
References
1. Abu-Khzam, F.N.: A kernelization algorithm for d-hitting set. Journal of Computer
and System Sciences 76(7), 524–531 (2010)
2. Abu-Khzam, F.N., Fernau, H.: Kernels: Annotated, proper and induced. In: Bod-
laender, H.L., Langston, M.A. (eds.) IWPEC 2006. LNCS, vol. 4169, pp. 264–275.
Springer, Heidelberg (2006)
3. Ailon, N., Charikar, M., Newman, A.: Aggregating inconsistent information: Rank-
ing and clustering. Journal of the ACM 55(5), 23:1–23:27 (2008)
4. Alon, N., Makarychev, K., Makarychev, Y., Naor, A.: Quadratic forms on graphs.
In: Proceedings of STOC 2005, pp. 486–493. ACM (2005)
5. Bansal, N., Blum, A., Chawla, S.: Correlation clustering. Machine Learning 56,
89–113 (2004)
6. Ben-Dor, A., Shamir, R., Yakhini, Z.: Clustering gene expression patterns. Journal
of Computational Biology 6(3/4), 281–297 (1999)
7. Böcker, S.: A golden ratio parameterized algorithm for cluster editing. Journal of
Discrete Algorithms 16, 79–89 (2012)
8. Böcker, S., Briesemeister, S., Bui, Q.B.A., Truß, A.: Going weighted: Parameterized
algorithms for cluster editing. Theoretical Computer Science 410(52), 5467–5480
(2009)
9. Böcker, S., Briesemeister, S., Klau, G.W.: Exact algorithms for cluster editing:
Evaluation and experiments. Algorithmica 60(2), 316–334 (2011)
10. Böcker, S., Damaschke, P.: Even faster parameterized cluster deletion and cluster
editing. Information Processing Letters 111(14), 717–721 (2011)
11. Bodlaender, H.L., Fellows, M.R., Heggernes, P., Mancini, F., Papadopoulos, C.,
Rosamond, F.A.: Clustering with partial information. Theoretical Computer Sci-
ence 411(7-9), 1202–1211 (2010)
12. Boral, A., Cygan, M., Kociumaka, T., Pilipczuk, M.: Fast branching algorithm for
cluster vertex deletion. CoRR, abs/1306.3877 (2013)
13. Cai, L.: Fixed-parameter tractability of graph modification problems for hereditary
properties. Information Processing Letters 58(4), 171–176 (1996)
14. Charikar, M., Wirth, A.: Maximizing quadratic programs: Extending
Grothendieck’s inequality. In: Proceedings of FOCS 2004, pp. 54–60. IEEE
Computer Society (2004)
15. Damaschke, P.: Fixed-parameter enumerability of cluster editing and related prob-
lems. Theory of Computing Systems 46(2), 261–283 (2010)
124 A. Boral et al.
16. Fellows, M.R., Guo, J., Komusiewicz, C., Niedermeier, R., Uhlmann, J.: Graph-
based data clustering with overlaps. Discrete Optimization 8(1), 2–17 (2011)
17. Fernau, H.: A top-down approach to search-trees: Improved algorithmics for 3-
hitting set. Algorithmica 57(1), 97–118 (2010)
18. Fomin, F.V., Kratsch, D.: Exact Exponential Algorithms. Texts in theoretical com-
puter science. Springer, Heidelberg (2010)
19. Fomin, F.V., Kratsch, S., Pilipczuk, M., Pilipczuk, M., Villanger, Y.: Tight bounds
for parameterized complexity of cluster editing. In: Proceedings of STACS 2013.
LIPIcs, vol. 20, pp. 32–43. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik,
Leibniz-Zentrum fuer Informatik (2013)
20. Giotis, I., Guruswami, V.: Correlation clustering with a fixed number of clusters.
Theory of Computing 2(1), 249–266 (2006)
21. Gramm, J., Guo, J., Hüffner, F., Niedermeier, R.: Automated generation of search
tree algorithms for hard graph modification problems. Algorithmica 39(4), 321–347
(2004)
22. Gramm, J., Guo, J., Hüffner, F., Niedermeier, R.: Graph-modeled data cluster-
ing: Exact algorithms for clique generation. Theory of Computing Systems 38(4),
373–392 (2005)
23. Guo, J., Kanj, I.A., Komusiewicz, C., Uhlmann, J.: Editing graphs into disjoint
unions of dense clusters. Algorithmica 61(4), 949–970 (2011)
24. Guo, J., Komusiewicz, C., Niedermeier, R., Uhlmann, J.: A more relaxed model
for graph-based data clustering: s-plex cluster editing. SIAM Journal of Discrete
Mathematics 24(4), 1662–1683 (2010)
25. Hüffner, F., Komusiewicz, C., Moser, H., Niedermeier, R.: Fixed-parameter algo-
rithms for cluster vertex deletion. In: Laber, E.S., Bornstein, C., Nogueira, L.T.,
Faria, L. (eds.) LATIN 2008. LNCS, vol. 4957, pp. 711–722. Springer, Heidelberg
(2008)
26. Hüffner, F., Komusiewicz, C., Moser, H., Niedermeier, R.: Fixed-parameter algo-
rithms for cluster vertex deletion. Theory of Computing Systems 47(1), 196–217
(2010)
27. Komusiewicz, C.: Parameterized Algorithmics for Network Analysis: Clustering &
Querying. PhD thesis, Technische Universität Berlin (2011),
http://fpt.akt.tu-berlin.de/publications/diss-komusiewicz.pdf
28. Komusiewicz, C., Uhlmann, J.: Alternative parameterizations for cluster editing.
In: Černá, I., Gyimóthy, T., Hromkovič, J., Jefferey, K., Králović, R., Vukolić, M.,
Wolf, S. (eds.) SOFSEM 2011. LNCS, vol. 6543, pp. 344–355. Springer, Heidelberg
(2011)
29. Protti, F., da Silva, M.D., Szwarcfiter, J.L.: Applying modular decomposition
to parameterized cluster editing problems. Theory of Computing Systems 44(1),
91–104 (2009)
30. Reed, B.A., Smith, K., Vetta, A.: Finding odd cycle transversals. Operations Re-
search Letters 32(4), 299–301 (2004)
31. Shamir, R., Sharan, R., Tsur, D.: Cluster graph modification problems. Discrete
Applied Mathematics 144(1-2), 173–182 (2004)
Separation Logic with One Quantified VariableÆ
Abstract. We investigate first-order separation logic with one record field re-
stricted to a unique quantified variable (1SL1). Undecidability is known when
the number of quantified variables is unbounded and the satisfiability problem is
PSPACE -complete for the propositional fragment. We show that the satisfiability
problem for 1SL1 is PSPACE -complete and we characterize its expressive power
by showing that every formula is equivalent to a Boolean combination of atomic
properties. This contributes to our understanding of fragments of first-order sepa-
ration logic that can specify properties about the memory heap of programs with
singly-linked lists. When the number of program variables is fixed, the complex-
ity drops to polynomial time. All the fragments we consider contain the magic
wand operator and first-order quantification over a single variable.
1 Introduction
Separation Logic for Verifying Programs with Pointers. Separation logic [20] is a well-
known logic for analysing programs with pointers stemming from BI logic [14]. Such
programs have specific errors to be detected and separation logic is used as an asser-
tion language for Hoare-like proof systems [20] that are dedicated to verify programs
manipulating heaps. Any procedure mechanizing the proof search requires subroutines
that check the satisfiability or the validity of formulæ from the assertion language. That
is why, characterizing the computational complexity of separation logic and its frag-
ments and designing optimal decision procedures remain essential tasks. Separation
logic contains a structural separating connective and its adjoint (the separating impli-
cation, also known as the magic wand). The main concern of the paper is to study a
non-trivial fragment of first-order separation logic with one record field as far as ex-
pressive power, decidability and complexity are concerned. Herein, the models of sep-
aration logic are pairs made of a variable valuation (store) and a partial function with
finite domain (heap), also known as memory states.
Decidability and Complexity. The complexity of satisfiability and model-checking prob-
lems for separation logic fragments have been quite studied [6,20,7] (see also new de-
cidability results in [13] or undecidability results in [5,16] in an alternative setting).
Separation logic is equivalent to a Boolean propositional logic [17,18] if first-order
quantifiers are disabled. Separation logic without first-order quantifiers is decidable, but
Æ
Work partially supported by the ANR grant DynRes (project no. ANR-11-BS02-011) and by
the EU Seventh Framework Programme under grant agreement No. PIOF-GA-2011-301166
(DATAVERIF).
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 125–138, 2014.
c Springer International Publishing Switzerland 2014
126 S. Demri et al.
2 Preliminaries
2.1 First-Order Separation Logic with One Selector 1SL
Let PVAR x1 , x2 , . . . be a countably infinite set of program variables and FVAR
u1 , u2, . . . be a countably infinite set of quantified variables. A memory state (also
Separation Logic with One Quantified Variable 127
called a model) is a pair s, h such that s is a variable valuation of the form s : PVAR
N (the store) and h is a partial function h : N N with finite domain (the heap) and we
write domh to denote its domain and ranh to denote its range. Two heaps h1 and
h2 are said to be disjoint, noted h1 h2 , if their domains are disjoint; when this holds,
we write h1
h2 to denote the heap corresponding to the disjoint union of the graphs
of h1 and h2 , hence domh1
h2 domh1 domh2 . When the domains of h1
and h2 are not disjoint, the composition h1
h2 is not defined even if h1 and h2 have
the same values on domh1 domh2 .
Formulæ of 1SL are built from expressions of the form e :: x
u where x PVAR
and u FVAR, and atomic formulæ of the form π :: e e
e e
emp. Formulæ
are defined by the grammar A ::
π
A B
A
A B
A B
u A, where
u FVAR. The connective is separating conjunction and is separating implication,
usually called the magic wand. The size of a formula A, written
A
, is defined as
the number of symbols required to write it. An assignment is a map f : FVAR
N. The satisfaction relation is parameterized by assignments (clauses for Boolean
connectives are omitted):
– s, h f emp iff domh .
– s, h f e e iff e e , with x sx and u fu.
def def
Theorem 2. [6,4,9] Satisfiability and model-checking problems for 1SL0 are PSPACE-
complete, satisfiability problem for 1SL is undecidable, even restricted to two variables.
– The domain of the heap has at least k elements: emp emp (k times).
– The variable xi is allocated in the heap: allocxi xi xi .
def
u xi u allocu.
– Variables xi and xj point to a shared location: convxi , xj u xi u
def
u u x j .
– Location interpreted by xi has exactly one predecessor can be expressed in 1SL1:
u u xi u u xi u u xi.
– Heap has at least 3 self-loops: u u u u u u u u u.
loops, h. So, obviously domh rems, h preds, h loops, h. The sets
preds, h and loops, h are not necessarily disjoint. As a consequence of h being a
partial function, the sets preds, h, i and preds, h, j intersect only if sxi sxj ,
in which case preds, h, i preds, h, j .
We introduce a second partition of domh by distinguishing the locations related
to a cell involving a program variable interpretation on the one hand, and the remain-
ing locations in the domain on the other hand. So, the sets below are also implicitly
parameterized by V: ref s, h domh sV , accs, h domh hsV ,
def def
♥s, h ref s, h accs, h, ♥s, h domh♥s, h. The core of the mem-
def def
ory state, written ♥s, h, contains the locations l in domh such that either l is the
Separation Logic with One Quantified Variable 129
The above figure presents a memory state s, h with the variables x1 , . . . ,x4 . Nodes
labelled by ’♥’ [resp. ’’, ’p’, ’r’] belong to ♥s, h [resp. loop♥ s, h, pred♥ s, h,
rem♥ s, h]. The introduction of the above sets provides a canonical way to decompose
the heap domain, which will be helpful in the sequel.
Lemma 3 (Canonical decomposition). For all stores s and heaps h, the following
identity holds: domh ♥s, h pred♥ s, h loop♥ s, h rem♥ s, h.
Remark that both pred♥ s, h, i or pred♥ s, h, i pred♥ s, h, j are possible.
Below, we present properties about the canonical decomposition.
Proposition 5. Let s, h, h1 , h2 be such that h h1
h2 . Then, ♥s, h domh1
♥s, h1 Δs, h1 , h2 with Δs, h1 , h2 domh1 h2 sV sV h1 sV
def
(where X NX).
def
The set Δs, h1 , h2 contains the locations belonging to the core of h and to the
domain of h1 , without being in the core of h1 . Its expression in Proposition 5 uses only
basic set-theoretical operations. From Proposition 5, we conclude that ♥s, h1
h2
can be different from ♥s, h1 ♥s, h2 .
0. Formula Af is a conjunction made of literals from Tq such that a positive literal B
occurs exactly when fB 1 and a negative literal B occurs exactly when fB 0.
We write Apos
f to denote B
B Tq and fB 1.
130 S. Demri et al.
Lemma 6. (I) For any k 1, there is a formula # loop♥ k s.t. for any s, h,
we have s, h # loop♥ k iff cardloop♥ s, h k. (II) For any k 1 and
any i 1, q , there is a formula # predi♥ k s.t. for any s, h, we have s, h
# predi♥ k iff cardpred♥ s, h, i k. (III) For any k 1, there is a # rem♥ k
s.t. for any s, h, we have s, h # rem♥ k iff cardrem♥ s, h k.
3 Expressive Completeness
We introduce the notion of equipotence and state a few properties about it. This will
be useful in the forthcoming developments. Let α N. We say that two finite sets X
and Y are α-equipotent and we write X "α Y if, either cardX cardY or both
cardX and cardY are greater that α. The equipotence relation is also decreasing,
i.e. "α2 "α1 holds for all α1 α2 . We state below two lemmas that will be helpful
in the sequel.
1 2
Test formulæ express simple properties about the memory states; this includes proper-
ties about program variables but also global properties about numbers of predecessors
or loops, following the decomposition in Section 2.3. These test formulæ allow us to
characterize the expressive power of 1SL1, similarly to what has been done in [17,18,3]
for 1SL0. Since every formula in 1SL1 is shown equivalent to a Boolean combination
of test formulæ (forthcoming Theorem 19), this process can be viewed as a means to
eliminate separating connectives in a controlled way; elimination is not total since the
test formulæ require such separating connectives. However, this is analogous to quan-
tifier elimination in Presburger arithmetic for which simple modulo constraints need to
be introduced in order to eliminate the quantifiers (of course, modulo constraints are
defined with quantifiers but in a controlled way too).
Separation Logic with One Quantified Variable 131
Let us introduce the test formulæ. We distinguish two types, leading to distinct sets.
There are test formulæ that state properties about the direct neighbourhood of program
variables whereas others state global properties about the memory states. The test for-
mulæ of the form # predi♥ k are of these two types but they will be included in
Sizeα since these are cardinality constraints.
Definition 9 (Test formulæ). Given q, α 1 , we define sets of test formulæ:
Test formulæ express simple properties about the memory states, even though quite
large formulæ in 1SL1 may be needed to express them, while being of memory thresh-
old polynomial in q α. An atom is a conjunction of test formulæ or their negation (lit-
eral) such that each formula from Testuα occurs once (saturated conjunction of literals).
Any memory state satisfying an atom containing allocx1 # pred1♥ 1
# loop♥ 1 # rem♥ 1 (with q 1) has an empty heap.
Lemma 10. Satisfiability of conjunctions of test formulæ or their negation can be
checked in polynomial time (q and α are not fixed and the bounds k in test formulæ
from Sizeα are encoded in binary).
The tedious proof of Lemma 10 is based on a saturation algorithm. The size of a Boolean
combination of test formulæ is the number of symbols to write it, when integers are en-
coded in binary (those from Sizeα ). Lemma 10 entails the following complexity char-
acterization, which indeed makes a contrast with the complexity of the satisfiability
problem for 1SL1 (see Theorem 28).
Theorem 11. Satisfiability problem for Boolean combinations of test formulæ in set
u
α1 Testα (q and α are not fixed, and bounds k are encoded in binary) is NP -complete.
Definition 12. We say that s, h, l and s , h , l are basically equivalent [resp. extra
equivalent, resp. α-equivalent] and we denote s, h, l #b s , h , l [resp. s, h, l #u
s , h , l , resp. s, h, l #α su , h , l ] when theu condition s, hu l B iff s , h l
½
Hence s, h, l and s , h , l are basically equivalent [resp. extra equivalent, resp. α-
equivalent] if and only if they cannot be distinguished by the formulæ of Basicu [resp.
Extrau , resp. Testuα ]. Since Extrau Basicu Testuα , it is obvious that the inclusions
#α #b #u hold.
Proposition 13. s, h, l #α s , h , l is equivalent to (1) s, h, l #b s , h , l and
(2) pred♥ s, h, i "α pred♥ s , h , i for any i 1, q , and (3) loop♥ s, h "α
loop♥ s , h and (4) rem♥ s, h "α rem♥ s , h .
The proof is based on the identity Basicu Sizeα Testuα . The pseudo-core of s, h,
written p♥s, h, is defined as p♥s, h sV hsV and ♥s, h is equal to
p♥s, h domh.
Lemma 14 (Bijection between pseudo-cores). Let l0 , l1 N and s, h and s , h
be two memory states s.t. s, h, l0 #b s , h , l1 . Let R be the binary relation on N
defined by: l R l iff (a) [l l0 and l l1 ] or (b) there is i 1, q s.t. [l sxi
and l s xi ] or [l hsxi and l h s xi ]. Then R is a bijective relation
between p♥s, h l0 and p♥s , h l1 . Its restriction to ♥s, h is in bijection
with ♥s , h too if case (a) is dropped out from definition of R.
The proof is by structural induction on A using Lemma 15, 16 and 17. Here is one
of our main results characterizing the expressive power of 1SL1.
The proof of Theorem 19 does not provide a constructive way to eliminate quanti-
fiers, which will be done in Section 4 (see Corollary 30).
the other test formulæ cannot systematically enforce constraints on the cardinality of
the set of loops outside of the core. Last but not least, we need to prove that the set
of test formulæ is expressively complete to get Theorem 19. Lemmas 15, 16 and 17
are helpful to obtain Lemma 18 taking care of the different quantifiers. It is in their
proofs that the completeness of the set Testuα is best illustrated. Nevertheless, to apply
these lemmas in the proof of Lemma 18, we designed the adequate definition for the
function th, and we arranged different thresholds in their statements. So, there is
a real interplay between the definition of th, and the lemmas used in the proof of
Lemma 18.
A small model property can be also proved as a consequence of Theorem 19 and the
proof of Lemma 10, for instance.
Corollary 20 (Small Model Property). Let A be a formula in 1SL1 with q program
variables. Then, if A is satisfiable, then there is a memory state s, h and l N such
that s, h l A and maxmaxvals, h, l 3q 1 q 3thq, A.
134 S. Demri et al.
There is no need to count over thq, A (e.g., for the loops outside the core) and the
core uses at most 3q locations. Theorem 19 provides a characterization of the expressive
power of 1SL1, which is now easy to differenciate from 1SL2.
Corollary 21. 1SL2 is strictly more expressive than 1SL1.
Given q, α 1, the number of abstract memory states over q, α is not only finite but
reasonably bounded. Given s, h, we define its abstraction abss, h over q, α as the
abstract memory state V, E , l, r, p1 , . . . , pq such that
– l minloop♥ s, h, α, r minrem♥ s, h, α, pi minpred♥ s, h, i, α
for every i 1, q .
– P is a partition of x1 , . . . , xq so that for all x, x , sx sx iff x and x belong
to the same set in P .
– V is made of elements from P as well as of locations from the set below:
hsx : sx domh, i 1, q
i i
hhsx : hsx domh, i 1, q sx : i 1, q
i i i
Equivalence between (1) and (3) is a consequence of the definition of the relation
#α. Hence, a pointed abstract memory state represents an atom of Testuα , except that it
is a bit more concise (only space in Oq logα is required whereas an atom requires
polynomial space in q α).
Definition 25. Given pointed abstract memory states a, u, a1 , u1 and a2 , u2 , we
write a a, u, a1 , u1 , a2 , u2 if there exist l N, a store s and disjoint heaps h1
and h2 such that abss, h1
h2 , l a, u, abss, h1 , l a1 , u1 and abss, h2 , l
a2 , u2 .
The ternary relation a is not difficult to check even though it is necessary to verify
that the abstract disjoint union is properly done.
Lemma 26. Given q, α 1, the ternary relation a can be decided in polynomial time
in q log α for all the pointed abstract memory states built over q, α.
136 S. Demri et al.
1: if B is emp then return iff E and all numerical values are zero;
2: if B is xi xj then return iff xi , xj X, for some X P ;
3: if B is xi u then return iff u X for some X P such that xi X;
4: if B is u u then return ;
5: if B is xi
xj then return iff X, X E where xi X P and xj X P ;
6: if B is xi
u then return iff X, u E for some X P such that xi X;
7: if B is u
xi then return iff either u P i or (u V and there is some X P such
that xi X and u, X E);
8: if B is u
u then return iff either u L or u, u E;
Here is another by-product of our proof technique. The PSPACE bound is preserved
when formulæ are encoded as DAGs instead of trees. The size of a formula is then sim-
ply its number of subformulæ. This is similar to machine encoding, provides a better
conciseness and complexity upper bounds are more difficult to obtain. With this alter-
native notion of length, thq, A is only bounded by q 2
A
(compare with Lemma 1).
Nevertheless, this is fine to get PSPACE upper bound with this encoding since the al-
gorithm to solve the satisfiability problem runs in logarithmic space in α, as we have
shown previously.
5 Conclusion
In [4], the undecidability of 1SL with a unique record field is shown. 1SL0 is also known
to be PSPACE-complete [6]. In this paper, we provided an extension with a unique quan-
tified variable and we show that the satisfiability problem for 1SL1 is PSPACE-complete
by presenting an original and fine-tuned abstraction of memory states. We proved that
in 1SL1 separating connectives can be eliminated in a controlled way as well as first-
order quantification over the single variable. In that way, we show a quantifier elimina-
tion property. Apart from the complexity results and the new abstraction for memory
states, we also show a quite surprising result: when the number of program variables is
bounded, the satisfiability problem can be solved in polynomial time. Last but not least,
we have established that satisfiability problem for Boolean combinations of test for-
mulæ is NP-complete. This is reminiscent of decision procedures used in SMT solvers
and it is a challenging question to take advantage of these features to decide 1SL1 with
an SMT solver. Finally, the design of fragments between 1SL1 and undecidable 1SL2
that can be decided with an adaptation of our method is worth being further investigated.
Acknowledgments. We warmly thank the anonymous referees for their numerous and
helpful suggestions, improving significantly the quality of the paper and its extended
version [10]. Great thanks also to Morgan Deters (New York University) for feedback
and discussions about this work.
References
1. Barrett, C., Conway, C.L., Deters, M., Hadarean, L., Jovanović, D., King, T., Reynolds, A.,
Tinelli, C.: CVC4. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806,
pp. 171–177. Springer, Heidelberg (2011)
2. Berdine, J., Calcagno, C., O’Hearn, P.: Smallfoot: Modular automatic assertion checking
with separation logic. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.)
FMCO 2005. LNCS, vol. 4111, pp. 115–137. Springer, Heidelberg (2006)
3. Brochenin, R., Demri, S., Lozes, E.: Reasoning about sequences of memory states.
APAL 161(3), 305–323 (2009)
4. Brochenin, R., Demri, S., Lozes, E.: On the almighty wand. IC 211, 106–137 (2012)
138 S. Demri et al.
5. Brotherston, J., Kanovich, M.: Undecidability of propositional separation logic and its neigh-
bours. In: LICS 2010, pp. 130–139. IEEE (2010)
6. Calcagno, C., Yang, H., O’Hearn, P.W.: Computability and complexity results for a spatial as-
sertion language for data structures. In: Hariharan, R., Mukund, M., Vinay, V. (eds.) FSTTCS
2001. LNCS, vol. 2245, pp. 108–119. Springer, Heidelberg (2001)
7. Cook, B., Haase, C., Ouaknine, J., Parkinson, M., Worrell, J.: Tractable reasoning in a
fragment of separation logic. In: Katoen, J.-P., König, B. (eds.) CONCUR 2011. LNCS,
vol. 6901, pp. 235–249. Springer, Heidelberg (2011)
8. de Moura, L., Bjørner, N.: Z3: An efficient SMT solver. In: Ramakrishnan, C.R., Rehof, J.
(eds.) TACAS 2008. LNCS, vol. 4963, pp. 337–340. Springer, Heidelberg (2008)
9. Demri, S., Deters, M.: Two-variable separation logic and its inner circle (September 2013)
(submitted)
10. Demri, S., Galmiche, D., Larchey-Wendling, D., Mery, D.: Separation logic with one quan-
tified variable. arXiv (2014)
11. Galmiche, D., Méry, D.: Tableaux and resource graphs for separation logic. JLC 20(1), 189–
231 (2010)
12. Haase, C., Ishtiaq, S., Ouaknine, J., Parkinson, M.J.: SeLoger: A Tool for Graph-Based Rea-
soning in Separation Logic. In: Sharygina, N., Veith, H. (eds.) CAV 2013. LNCS, vol. 8044,
pp. 790–795. Springer, Heidelberg (2013)
13. Iosif, R., Rogalewicz, A., Simacek, J.: The tree width of separation logic with recursive
definitions. In: Bonacina, M.P. (ed.) CADE 2013. LNCS, vol. 7898, pp. 21–38. Springer,
Heidelberg (2013)
14. Ishtiaq, S., O’Hearn, P.: BI as an assertion language for mutable data structures. In: POPL
2001, pp. 14–26 (2001)
15. Ladner, R.: The computational complexity of provability in systems of modal propositional
logic. SIAM Journal of Computing 6(3), 467–480 (1977)
16. Larchey-Wendling, D., Galmiche, D.: The undecidability of boolean BI through phase se-
mantics. In: LICS 2010, pp. 140–149. IEEE (2010)
17. Lozes, E.: Expressivité des logiques spatiales. PhD thesis, LIP, ENS Lyon, France (2004)
18. Lozes, E.: Separation logic preserves the expressive power of classical logic. In: Workshop
SPACE 2004 (2004)
19. Piskac, R., Wies, T., Zufferey, D.: Automating separation logic using SMT. In: Sharygina,
N., Veith, H. (eds.) CAV 2013. LNCS, vol. 8044, pp. 773–789. Springer, Heidelberg (2013)
20. Reynolds, J.C.: Separation logic: a logic for shared mutable data structures. In: LICS 2002,
pp. 55–74. IEEE (2002)
QuickXsort: Efficient Sorting with
n log n − 1.399n + o(n) Comparisons on Average
1 Introduction
Sorting a sequence of n elements remains one of the most frequent tasks carried
out by computers. A lower bound for sorting by only pairwise comparisons is
log(n!) ≈ n log n − 1.44n + O(log n) comparisons for the worst and average case
(logarithms denoted by log are always base 2, the average case refers to a uniform
distribution of all input permutations assuming all elements are different). Sort-
ing algorithms that are optimal in the leading term are called constant-factor-
optimal. Tab. 1 lists some milestones in the race for reducing the coefficient in
the linear term. One of the most efficient (in terms of number of comparisons)
constant-factor-optimal algorithms for solving the sorting problem is Ford and
Johnson’s MergeInsertion algorithm [9]. It requires n log n−1.329n+O(log n)
comparisons in the worst case [12]. MergeInsertion has a severe drawback
that makes it uninteresting for practical issues: similar to Insertionsort the
number of element moves is quadratic in n, i. e., it has quadratic running time.
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 139–152, 2014.
c Springer International Publishing Switzerland 2014
140 S. Edelkamp and A. Weiß
With Insertionsort we mean the algorithm that inserts all elements succes-
sively into the already ordered sequence finding the position for each element
by binary search (not by linear search as frequently done). However, MergeIn-
sertion and Insertionsort can be used to sort small subarrays such that
the quadratic running time for these subarrays is small in comparison to the
overall running time. Reinhardt [15] used this technique to design an internal
Mergesort variant that needs in the worst case n log n − 1.329n + O(log n)
comparisons. Unfortunately, implementations of this InPlaceMergesort al-
gorithm have not been documented. Katajainen et al.’s [11,8] work inspired by
Reinhardt is practical, but the number of comparisons is larger.
Throughout the text we avoid the terms in-place or in-situ and prefer the
term internal (opposed to external ). We call an algorithm internal if it needs
at most O(log n) space (computer words) in addition to the array to be sorted.
That means we consider Quicksort as an internal algorithm whereas standard
Mergesort is external because it needs a linear amount of extra space.
Based on QuickHeapsort [2], we develop the concept of QuickXsort in
this paper and apply it to Mergesort and WeakHeapsort, what yields effi-
cient internal sorting algorithms. The idea is very simple: as in Quicksort the
array is partitioned into the elements greater and less than some pivot element.
Then one part of the array is sorted by some algorithm X and the other part is
sorted recursively. The advantage of this procedure is that, if X is an external
algorithm, then in QuickXsort the part of the array which is not currently
being sorted may be used as temporary space, what yields an internal variant
of X. We give an elementary proof that under natural assumptions QuickX-
sort performs up to o(n) terms on average the same number of comparisons as
X. Moreover, we introduce a trick similar to Introsort [14] which guarantees
n log n + O(n) comparisons in the worst case.
The concept of QuickXsort (without calling it like that) was first applied in
UltimateHeapsort by Katajainen [10]. In UltimateHeapsort, first the me-
dian of the array is determined, and then the array is partitioned into subarrays of
equal size. Finding the median means significant additional effort. Cantone and
Cincotti [2] weakened the requirement for the pivot and designed QuickHeap-
sort which uses only a sample of smaller size to select the pivot for partition-
ing. UltimateHeapsort is inferior to QuickHeapsort in terms of average case
number of comparisons, although, unlike QuickHeapsort, it allows an n log n +
O(n) bound for the worst case number of comparisons. Diekert and Weiß [3] an-
alyzed QuickHeapsort more thoroughly and described some improvements re-
quiring less than n log n − 0.99n + o(n) comparisons on average.
Edelkamp and Stiegeler [5] applied the idea of QuickXsort to WeakHeap-
sort (which was first described by Dutton [4]) introducing QuickWeakHeap-
sort. The worst case number of comparisons of WeakHeapsort is nlog n −
2
log n + n − 1 ≤ n log n + 0.09n, and, following Edelkamp and Wegener [6], this
bound is tight. In [5] an improved variant with n log n − 0.91n comparisons in the
worst case and requiring extra space is presented. With ExternalWeakHeap-
sort we propose a further refinement with the same worst case bound, but on
QuickXsort: Efficient Sorting 141
2 QuickXsort
In this section we give a more precise description of QuickXsort and derive
some results concerning the number of comparisons performed in the average
and worst case. Let X be some sorting algorithm. QuickXsort works as fol-
lows: First, choose some pivot element as median of some random sample. Next,
partition the array according to this pivot element, i. e., rearrange the array such
that all elements left of the pivot are less or equal and all elements on the right
are greater or equal than the pivot element. (If the algorithms X outputs the
sorted sequence in the extra memory, the partitioning is performed such that the
all elements left of the pivot are greater or equal and all elements on the right
are less or equal than the pivot element.) Then, choose one part of the array and
sort it with algorithm X. (The preferred choice depends on the sorting algorithm
X.) After one part of the array has been sorted with X, move the pivot element
to its correct position (right after/before the already sorted part) and sort the
other part of the array recursively with QuickXsort.
The main advantage of this procedure is that the part of the array that is
not being sorted currently can be used as temporary memory for the algorithm
X. This yields fast internal variants for various external sorting algorithms such
as Mergesort. The idea is that whenever a data element should be moved
to the external storage, instead it is swapped with the data element occupying
the respective position in part of the array which is used as temporary memory.
Of course, this works only if the algorithm needs additional storage only for
data elements. Furthermore, the algorithm has to be able to keep track of the
positions of elements which have been swapped. As the specific method depends
on the algorithm X, we give some more details when we describe the examples
for QuickXsort.
For the number of comparisons we can derive some general results which hold
for a wide class of algorithms X. Under natural assumptions the average number
of comparisons of X and of QuickXsort differ only by an o(n)-term. For the rest
of
√ the paper, we assume that the pivot is selected as the median of √ approximately
n randomly chosen elements. Sample sizes of approximately n are likely to
be optimal as the results in [3,13] suggest.
The following theorem is one of our main results. It can be proved using
Chernoff bounds and then solving the linear recurrence.
Theorem 1 (QuickXsort Average-Case). Let X be some sorting algorithm
requiring at most n log n + cn + o(n)√ comparisons in the average case. Then,
QuickXsort implemented with Θ( n) elements as sample for pivot selection
is a sorting algorithm that also needs at most n log n + cn + o(n) comparisons in
the average case.
Does QuickXsort provide √ a good bound for the worst case? The obvious
answer is “no”. If always the n smallest elements are chosen for pivot selection,
Θ(n3/2 ) comparisons are performed. However, we can prove that such a worst
case is very unlikely. Let R(n) be the worst case number of comparisons of the
algorithm X.
QuickXsort: Efficient Sorting 143
n · δ(n) off the median, we stop with QuickXsort and continue by sorting both
parts of the partitioned array with the algorithm Y. We call this QuickXYsort.
To achieve a good worst case bound, of course, we also need a good bound for
algorithm X. W. l. o. g. we assume the same worst case bounds for X as for Y.
Note that QuickXYsort only makes sense if one needs a provably good worst
case bound. Since QuickXsort is always expected to make at most as many
comparisons as QuickXYsort (under the reasonable assumption that X on
average is faster than Y – otherwise one would use simply Y), in every step of
the recursion QuickXsort is the better choice for the average case.
Theorem 2 (QuickXYsort Worst-Case). Let X be a sorting algorithm with
at most n log n + cn + o(n) comparisons in the average case and R(n) = n log n +
dn + o(n) comparisons in the worst case (d ≥ c). Let Y be a sorting algorithm
with at most R(n) comparisons in the worst case. Then, QuickXYsort is a
sorting algorithm that performs at most n log n + cn + o(n) comparisons in the
average case and n log n + (d + 1)n + o(n) comparisons in the worst case.
In order to keep the the implementation of QuickXYsort simple, we propose
the following algorithm Y: Find the median with some linear time algorithm
(see e.g. [1]), then apply QuickXYsort with this median as first pivot element.
Note that this algorithm is well defined because by induction the algorithm Y is
already defined for all smaller instances. The proof of Thm. 2 shows that Y, and
thus QuickXYsort, has a worst case number of comparisons in n log n + O(n).
3 QuickWeakHeapsort
In this section consider QuickWeakHeapsort as a first example of Quick-
Xsort. We start by introducing weak heaps and then continue by describing
WeakHeapsort and a novel external version of it. This external version is a
good candidate for QuickXsort and yields an efficient sorting algorithm that
uses approximately n log n−1.2n comparisons (this value is only a rough estimate
and neither a bound from below nor above). A drawback of WeakHeapsort
and its variants is that they require one extra bit per element. The exposition
also serves as an intermediate step towards our implementation of MergeIn-
sertion, where the weak-heap data structure will be used as a building block.
Conceptually, a weak heap (see Fig. 1) is a binary tree satisfying the following
conditions:
144 S. Edelkamp and A. Weiß
0
1
1
3
2 3
4 7
4 5 7 6
8 6 5 9
9 8
2 11
Fig. 1. A weak heap (reverse bits are set for grey nodes, above the nodes are array
indices.)
From the first two properties we deduce that the height of a weak heap that has
n elements is log n + 1. The third property is called the weak-heap ordering
or half-tree ordering. In particular, this property enforces no relation between
an element in a node and those stored its left subtree. On the other hand, it
implies that any node together with its right subtree forms a weak heap on its
own. In an array-based implementation, besides the element array s, an array
r of reverse bits is used, i. e., ri ∈ {0, 1} for i ∈ {0, . . . , n − 1}. The root has
index 0. The array index of the left child of si is 2i + ri , the array index of the
right child is 2i + 1 − ri , and the array index of the parent is %i/2& (assuming
that i = 0). Using the fact that the indices of the left and right children of si
are exchanged when flipping ri , subtrees can be reversed in constant time by
setting ri ← 1 − ri . The distinguished ancestor (d -ancestor (j)) of sj for j = 0, is
recursively defined as the parent of sj if sj is a right child, and the distinguished
ancestor of the parent of sj if sj is a left child. The distinguished ancestor of
sj is the first element on the path from sj to the root which is known to be
smaller or equal than sj by (3). Moreover, any subtree rooted by sj , together
with the distinguished ancestor si of sj , forms again a weak heap with root si
by considering sj as right child of si .
The basic operation for creating a weak heap is the join operation which
combines two weak heaps into one. Let i < j be two nodes in a weak heap
such that si is smaller than or equal to every element in the left subtree of sj .
Conceptually, sj and its right subtree form a weak heap, while si and the left
subtree of sj form another weak heap. (Note that si is not part of the subtree
with root sj .) The result of join is a weak heap with root at position i. If sj < si ,
the two elements are swapped and rj is flipped. As a result, the new element sj
will be smaller than or equal to every element in its right subtree, and the new
element si will be smaller than or equal to every element in the subtree rooted at
QuickXsort: Efficient Sorting 145
sj . To sum up, join requires constant time and involves one element comparison
and a possible element swap in order to combine two weak heaps to a new one.
The construction of a weak heap consisting of n elements requires n − 1 com-
parisons. In the standard bottom-up construction of a weak heap the nodes are
visited one by one. Starting with the last node in the array and moving to the
front, the two weak heaps rooted at a node and its distinguished ancestor are
joined. The amortized cost to get from a node to its distinguished ancestor is
O(1) [6].
When using weak heaps for sorting, the minimum is removed and the weak
heap condition restored until the weak heap becomes empty. After extracting an
element from the root, first the special path from the root is traversed top-down,
and then, in a bottom-up process the weak-heap property is restored using at
most log n join operations. (The special path is established by going once to
the right and then to the left as far as it is possible.) Hence, extracting the
minimum requires at most log n comparisons.
Now, we introduce a modification to the standard procedure described by
Dutton [4], which has a slightly improved performance, but requires extra space.
We call this modified algorithm ExternalWeakHeapsort. This is because it
needs an extra output array, where the elements which are extracted from the
weak heap are moved to. On average ExternalWeakHeapsort requires less
comparisons than RelaxedWeakHeapsort [5]. Integrated in QuickXsort we
can implement it without extra space other than the extra bits r and some other
extra bits. We introduce an additional array active and weaken the requirements
of a weak heap: we also allow nodes on other than the last two levels to have
less than two children. Nodes where the active bit is set to false are considered
to have been removed. ExternalWeakHeapsort works as follows: First, a
usual weak heap is constructed using n − 1 comparisons. Then, until the weak
heap becomes empty, the root – which is the minimal element – is moved to
the output array and the resulting hole has to be filled with the minimum of
the remaining elements (so far the only difference to normal WeakHeapsort
is that there is a separate output area).
The hole is filled by searching the special path from the root to a node x which
has no left child. Note that the nodes on the special path are exactly the nodes
having the root as distinguished ancestor. Finding the special path does not need
any comparisons since one only has to follow the reverse bits. Next, the element
of the node x is moved to the root leaving a hole. If x has a right subtree (i. e.,
if x is the root of a weak heap with more than one element), this hole is filled
by applying the hole-filling algorithm recursively to the weak heap with root x.
Otherwise, the active bit of x is set to false. Now, the root of the whole weak heap
together with the subtree rooted by x forms a weak heap. However, it remains
to restore the weak heap condition for the whole weak heap. Except for the root
and x, all nodes on the special path together with their right subtrees form weak
heaps. Following the special path upwards these weak heaps are joined with their
distinguished ancestor as during the weak heap construction (i. e., successively
they are joined with the weak heap consisting of the root and the already treated
146 S. Edelkamp and A. Weiß
nodes on the special path together with their subtrees). Once, all the weak heaps
on the special path are joined, the whole array forms a weak heap again.
If n is not a power of two, the sizes of left and right parts of WeakHeapsort
are less balanced than the left and right parts of ordinary Mergesort and one
can expect a slightly higher number of comparisons. For QuickWeakHeapsort,
the half of the array which is not sorted by ExternalWeakHeapsort is used
as output area. Whenever the root is moved to the output area, the element that
occupied that place before is inserted as a dummy element at the position where
the active bit is set to false. Applying Thm. 1, we obtain the rough estimate of
n log n − 1.2n comparisons for the average case of QuickWeakHeapsort.
4 QuickMergesort
Pivot Pivot
Pivot
Fig. 2. First the two halves of the left part are sorted moving them from one place to
another. Then, they are merged to the original place.
Bases cases of growing size always lead to a constant factor overhead in run-
ning time if an algorithm with a quadratic number of total operations is applied.
Therefore, in the experiments we also consider constant size base cases, which
offer a slightly worse bound for the number of comparisons, but are faster in
practice. We do not analyze them separately since the preferred choice for the
size depends on the type of data to be sorted and the system on which the
algorithms run.
5 MergeInsertion
MergeInsertion by Ford and Johnson [9] is one of the best sorting algorithms
in terms of number of comparisons. Hence, it can be applied for sorting base
cases of QuickMergesort what yields even better results than Insertionsort.
Therefore, we want to give a brief description of the algorithm and our imple-
mentation. Algorithmically, MergeInsertion(s0 , . . . , sn−1 ) can be described as
follows (an intuitive example for n = 21 can be found in [12]):
1. Arrange the input such that si ≥ si+
n/2 for 0 ≤ i < %n/2& with one
comparison per pair. Let ai = si and bi = si+
n/2 for 0 ≤ i < %n/2&, and
b
n/2 = sn−1 if n is odd.
2. Sort the values a0 ,...,a
n/2−1 recursively with MergeInsertion.
3. Rename the solution as follows: b0 ≤ a0 ≤ a1 ≤ · · · ≤ a
n/2−1 and insert
the elements b1 , . . . , b
n/2−1 via binary insertion, following the ordering b2 ,
b1 , b4 , b3 , b10 , b9 , . . . , b5 , . . . , btk−1 , btk−1 −1 , . . . btk−2 +1 , btk , . . . into the main
chain, where tk = (2k+1 + (−1)k )/3.
addresses. This approach has the advantage that the relations stored in the tour-
nament tree are preserved. The most important procedure for MergeInsertion
is the organization of the calls for binary-insert . After adapting the addresses
for the elements bi (w. r. t. the above description) in the second part of the array,
the algorithm calls the binary insertion routine with appropriate indices. Note
that we always use k comparisons for all elements of the k-th block (i. e., the
elements btk , . . . , btk−1 +1 ) even if there might be the chance to save one compar-
ison. By introducing an additional array, which for each bi contains the current
index of ai , we can exploit the observation that not always k comparisons are
needed to insert an element of the k-th block. In the following we call this the
improved variant. The pseudo-code of the basic variant is shown in Fig. 3. The
last sequence is not complete and is thus tackled in a special case.
Theorem 6 (Average Case of MergeInsertion). The sorting algorithm
MergeInsertion needs n log n − c(n) · n + O(log n) comparisons on average,
where c(n) ≥ 1.3999.
Corollary 3 (QuickMergesort with Base Case MergeInsertion). When
using MergeInsertion as base case, QuickMergesort needs at most n log n−
1.3999n + o(n) comparisons and O(n log n) other instructions on average.
6 Experiments
Our experiments consist of two parts. First, we compare the different algorithms
we use as base cases, i. e., MergeInsertion, its improved variant, and Inser-
tionsort. The results can be seen in Fig. 4. Depending on the size of the arrays
150 S. Edelkamp and A. Weiß
the displayed numbers are averages over 10-10000 runs1 . The data elements we
sorted were randomly chosen 32-bit integers. The number of comparisons was
measured by increasing a counter in every comparison2 .
The outcome in Fig. 4 shows that our improved MergeInsertion imple-
mentation achieves results for the constant κ of the linear term in the range of
[−1.43, −1.41] (for some values of n are even smaller than −1.43). Moreover, the
standard implementation with slightly more comparisons is faster than Inser-
tionsort. By the O(n2 ) work, the resulting runtimes for all three implementa-
tions raise quickly, so that only moderate values of n can be handled.
−1.4 0.4
−1.41
0.35
−1.42
0.3
−1.43
0.25
−1.44
−1.45 0.2
10 12 14 16 10 12 14 16
2 2 2 2 2 2 2 2
n [logarithmic scale] n [logarithmic scale]
The second part of our experiments (shown in Fig. 5) consists of the compar-
ison of QuickMergesort (with base cases of constant and growing size) and
QuickWeakHeapsort with state-of-the-art algorithms as STL-Introsort
(i. e., Quicksort), STL-stable-sort
√ (BottomUpMergesort) and Quick-
sort with median of n elements for pivot selection. For QuickMergesort
with base cases, the improved variant of MergeInsertion is used to sort sub-
arrays of size up to 40 log10 n. For the normal QuickMergesort we used base
cases of size ≤ 9. We also implemented QuickMergesort with median of three
for pivot selection, which turns out to be practically efficient, although
√ it needs
slightly more comparisons than QuickMergesort with median of n. However,
1
Our experiments were run on one core of an Intel Core i7-3770 CPU (3.40GHz, 8MB
Cache) with 32GB RAM; Operating system: Ubuntu Linux 64bit; Compiler: GNU’s
g++ (version 4.6.3) optimized with flag -O3.
2
To rely on objects being handled we avoided the flattening of the array structure
by the compiler. Hence, for the running time experiments, and in each comparison
taken, we left the counter increase operation intact.
QuickXsort: Efficient Sorting 151
0.2
−0.5
0.15
−1 0.1
0.05
−1.5 0
14
2 2
16
2
18
2
20
2
22
2
24 26
2 214 216 218 220 222 224 226
n [logarithmic scale] n [logarithmic scale]
7 Concluding Remarks
Sorting n elements remains a fascinating topic for computer scientists both from
a theoretical and from a practical point of view. With QuickXsort we have
described a procedure how to convert an external sorting algorithm into an inter-
nal one introducing only o(n) additional comparisons on average. We presented
QuickWeakHeapsort and QuickMergesort as two examples for this con-
struction. QuickMergesort is close to the lower bound for the average number
of comparisons and at the same time is practically efficient, even when the com-
parisons are fast.
Using MergeInsertion to sort base cases of growing size for QuickMerge-
sort, we derive an an upper bound of n log n − 1.3999n + o(n) comparisons for
152 S. Edelkamp and A. Weiß
the average case. As far as we know a better result has not been published before.
We emphasize that the average of our best implementation has a proven gap of
at most 0.05n+o(n) comparisons to the lower bound. The value n log n−1.4n for
n = 2k matches one side of Reinhardt’s conjecture that an optimized in-place
algorithm can have n log n − 1.4n + O(log n) comparisons in the average [15].
Moreover, our experimental results validate the theoretical considerations and
indicate that the factor −1.43 can be beaten. Of course, there is still room in
closing the gap to the lower bound of n log n − 1.44n + O(log n) comparisons.
References
1. Blum, M., Floyd, R.W., Pratt, V., Rivest, R.L., Tarjan, R.E.: Time bounds for
selection. J. Comput. Syst. Sci. 7(4), 448–461 (1973)
2. Cantone, D., Cinotti, G.: QuickHeapsort, an efficient mix of classical sorting algo-
rithms. Theoretical Computer Science 285(1), 25–42 (2002)
3. Diekert, V., Weiß, A.: Quickheapsort: Modifications and improved analysis. In:
Bulatov, A.A., Shur, A.M. (eds.) CSR 2013. LNCS, vol. 7913, pp. 24–35. Springer,
Heidelberg (2013)
4. Dutton, R.D.: Weak-heap sort. BIT 33(3), 372–381 (1993)
5. Edelkamp, S., Stiegeler, P.: Implementing HEAPSORT with n log n − 0.9n and
QUICKSORT with n log n + 0.2n comparisons. ACM Journal of Experimental Al-
gorithmics 10(5) (2002)
6. Edelkamp, S., Wegener, I.: On the performance of W EAK − HEAP SORT . In:
Reichel, H., Tison, S. (eds.) STACS 2000. LNCS, vol. 1770, pp. 254–266. Springer,
Heidelberg (2000)
7. Edelkamp, S., Weiß, A.: QuickXsort: Efficient Sorting with n log n − 1.399n + o(n)
Comparisons on Average. ArXiv e-prints, abs/1307.3033 (2013)
8. Elmasry, A., Katajainen, J., Stenmark, M.: Branch mispredictions don’t affect
mergesort. In: Klasing, R. (ed.) SEA 2012. LNCS, vol. 7276, pp. 160–171. Springer,
Heidelberg (2012)
9. Ford, J., Lester, R., Johnson, S.M.: A tournament problem. The American Math-
ematical Monthly 66(5), 387–389 (1959)
10. Katajainen, J.: The Ultimate Heapsort. In: CATS, pp. 87–96 (1998)
11. Katajainen, J., Pasanen, T., Teuhola, J.: Practical in-place mergesort. Nord. J.
Comput. 3(1), 27–40 (1996)
12. Knuth, D.E.: Sorting and Searching, 2nd edn. The Art of Computer Programming,
vol. 3. Addison Wesley Longman (1998)
13. Martı́nez, C., Roura, S.: Optimal Sampling Strategies in Quicksort and Quickselect.
SIAM J. Comput. 31(3), 683–705 (2001)
14. Musser, D.R.: Introspective sorting and selection algorithms. Software—Practice
and Experience 27(8), 983–993 (1997)
15. Reinhardt, K.: Sorting in-place with a worst case complexity of n log n − 1.3n +
o(log n) comparisons and n log n + o(1) transports. In: Ibaraki, T., Iwama, K.,
Yamashita, M., Inagaki, Y., Nishizeki, T. (eds.) ISAAC 1992. LNCS, vol. 650,
pp. 489–498. Springer, Heidelberg (1992)
16. Wegener, I.: Bottom-up-Heapsort, a new variant of Heapsort beating, on an average,
Quicksort (if n is not very small). Theoretical Computer Science 118(1), 81–98
(1993)
Notions of Metric Dimension of Corona
Products: Combinatorial and Computational
Results
Throughout this paper, we only consider undirected simple loop-free graphs and
use standard graph-theoretic terminology. Less known notions are collected at
the end of this section.
Let (X, d) be a metric space. The diameter of a point set S ⊆ X is defined
as diam(S) = sup{d(x, y) : x, y ∈ S}. A generator of (X, d) is a set S ⊆ X such
that every point of the space is uniquely determined by the distances from the
elements of S. A point v ∈ X is said to distinguish two points x and y of X if
d(v, x) = d(v, y). Hence, S is a generator if and only if any pair of points of X
is distinguished by some element of S.
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 153–166, 2014.
c Springer International Publishing Switzerland 2014
154 H. Fernau and J.A. Rodrı́guez-Velázquez
Our main results. In this paper, we study the (local) metric dimension of corona
product graphs via the (local) adjacency dimension of a graph. We show that
the (local) metric dimension of the corona product of a graph of order n and
some non-trivial graph H equals n times the (local) adjacency metric dimension
of H. This relation is much stronger and under weaker conditions compared to
the results of Jannesari and Omoomi [21] concerning the lexicographic product
of graphs. This also enables us to infer NP-hardness results for computing the
(local) metric dimension, based on corresponding NP-hardness results for (lo-
cal) adjacency metric dimension that we also provide. To our knowledge, this
is the first time combinatorial results on this particular form of graph product
have been used to deduce computational hardness results. The obtained reduc-
tions are relatively simple and also allow us to conclude hardness results based
Notions of Metric Dimension of Corona Products 155
Fig. 1. The bold type forms an adjacency basis for P4 P5 but not a dominating set
Let G and H be two graphs of order n and n , respectively. The join (graph)
G + H is defined as the graph obtained from vertex-disjoint graphs G and H
by taking one copy of G and one copy of H and joining by an edge each vertex
of G with each vertex of H. Graph products is one of the recurring themes in
graph theory, see [15]. The corona product (graph) G ( H is defined as the graph
obtained from G and H by taking one copy of G and n copies of H and joining by
an edge each vertex from the ith copy of H with the ith vertex of G [11]. We will
denote by V = {v1 , v2 , . . . , vn } the set of vertices of G and by Hi = (Vi , Ei ) the
ith copy of H so that NGH (vi ) = Vi ∪ NG (vi ) and NGH (x) = {vi } ∪ NHi (x)
for every x ∈ Vi . Notice that the corona graph K1 ( H is isomorphic to the
join graph K1 + H. For our computational complexity results, it is important
but easy to observe that these graph operations can be performed in polynomial
time, given two input graphs. Some of the notions important in this paper are
illustrated in Figure 1.
Simple facts. By definition, the following inequalities hold for any graph G:
The proofs of results marked with an asterisk symbol (∗) can be found in the
long version of this paper that can be retrieved as a Technical Report [30].
dGH (x, u) = dvi +Hi (x, u) = dvi +Hi (y, u) = dGH (y, u).
2. x ∈ Vi and y ∈ V . If y = vi , then for u ∈ Sj , j = i, we have
dGH (x, u) = dGH (x, y) + dGH (y, u) > dGH (y, u).
dGH (x, u) = dGH (x, y) + dGH (y, u) > dGH (y, u).
n
n
dim(G ( H) = |W | ≥ |Wi | ≥ dimA (Hi ) = n · dimA (H).
i=1 i=1
A detailed analysis of the adjacency dimension of the corona product via the
adjacency dimension of the second operand. We now analyze the adjacency di-
mension of the corona product G ( H in terms of the adjacency dimension of H.
Corollary 1. (∗) Let r ≥ 7 with r ≡ 1 mod 5 and r ≡ 3 mod 5. For any con-
nected graph G of order n ≥ 2, dimA (G ( Cr ) = dimA (G ( Pr ) = n · 2r+2
5 .
It is easy to check that any adjacency basis of a star graph K1,r is composed
of r − 1 leaves, with the last leaf non-dominated. Thus, Theorem 4 implies:
Theorem 5. (∗) Let H be a non-trivial graph such that some of its adjacency
bases are also dominating sets, and some are not. If there exists an adjacency
basis S for H such that for every v ∈ V (H) − S it is satisfied that S ⊆ NH (v),
and for any adjacency basis S for H which is also a dominating set, there exists
some v ∈ V (H) − S such that S ⊆ NH (v), then for any connected graph G of
order n ≥ 2, dimA (G ( H) = n · dimA (H) + γ (G).
(i) There exists an adjacency basis S for H, which is also a dominating set,
such that for every v ∈ V (H) − S it is satisfied that S ⊆ NH (v).
(ii) dimA (G ( H) = n · dimA (H).
(iii) dimA (G ( H) = dim(G ( H).
3 Locality in Dimensions
First, we consider some straightforward cases. If H is an empty graph, then
K1 (H is a star graph and diml (K1 (H) = 1. Moreover, if H is a complete graph
of order n, then K1 (H is a complete graph of order n+1 and diml (K1 (H) = n.
It was shown in [31] that for any connected nontrivial graph G and any empty
graph H, diml (G ( H) = diml (G). We are going to state results similar to the
non-local situation as discussed in the previous section. We omit all proofs as
they are along similar lines.
Theorem 8. (∗) For any connected graph G of order n ≥ 2 and any non-trivial
graph H, diml (G ( H) = n · dimA,l (H).
Based on [31], this allows to deduce quite a number of combinatorial results
for the new notion of a local adjacency dimension, as contained in [30].
Fortunately, the comparison of the local adjacency dimension of the corona
product with the one of the second argument is much simpler in the local version
as in the previously studied non-local version.
Theorem 9. (∗) Let G be a connected graph of order n ≥ 2 and let H be a non-
trivial graph. If there exists a local adjacency basis S for H such that for every
v ∈ V (H)−S it is satisfied that S ⊆ NH (v), then dimA,l (G(H) = n·dimA,l (H).
Theorem 10. (∗) Let G be a connected graph of order n ≥ 2 and let H be a non-
trivial graph. If for any local adjacency basis for H, there exists some v ∈ V (H)−
S which satisfies that S ⊆ NH (v), then dimA,l (G ( H) = n · dimA,l (H) + γ(G).
Remark 1. As a concrete example for the previous theorem, consider H = Kn .
Clearly, dimA,l (H) = n − 1, and the neighborhood of the only vertex that is
not in the local adjacency basis coincides with the local adjacency basis. For any
connected graph G of order n ≥ 2, we can deduce that
As a concrete example of graph H where we can apply the above result is the
star K1,r , r ≥ 2. In this case, for any connected graph G of order n ≥ 2, we find
that dimA,l (G ( K1,r ) = n · dimA,l (K1,r ) + γ(G) = n + γ(G).
In this section, we not only prove NP-hardness of all dimension variants, but
also show that the problems (viewed as minimization problems) cannot be solved
in time O(poly(n + m)2o(n) ) on any graph of order n (and size m). Yet, it is
straightforward to see that each of our computational problems can be solved in
time O(poly(n+m)2n ), simply by cycling through all vertex subsets by increasing
cardinality and then checking if the considered vertex set forms an appropriate
basis. More specifically, based on our reductions we can conclude that these
trivial brute-force algorithms are in a sense optimal, assuming the validity of the
Exponential Time Hypothesis (ETH). A direct consequence of ETH (using the
sparsification lemma) is the hypothesis that 3-SAT instances cannot be solved
in time O(poly(n + m)2o(n+m) ) on instances with n variables and m clauses;
see [19,4].
From a mathematical point of view, the most interesting fact is that most of
our computational results are based on the combinatorial results on the dimen-
sional graph parameters on corona products of graphs that are derived above.
Due to the practical motivation of the parameters, we also study their com-
putational complexity on planar graph instances.
We are going to investigate the following problems:
Dim: Given a graph G and an integer k, decide if dim(G) ≤ k or not.
LocDim: Given a graph G and an integer k, decide if diml (G) ≤ k or not.
AdjDim: Given a graph G and an integer k, decide if dimA (G) ≤ k or not.
LocAdjDim: Given a graph G and an integer k, decide if dimA,l (G) ≤ k or not.
As auxiliary problems, we will also consider:
VC: Given a graph G and an integer k, decide if β(G) ≤ k or not.
Dom: Given a graph G and an integer k, decide if γ(G) ≤ k or not.
1-LocDom: Given a graph G and an integer k, decide if there exists a 1-locating
dominating set of G with at most k vertices or not. (A dominating set D ⊆ V in
a graph G = (V, E) is called a 1-locating dominating set if for every two vertices
u, v ∈ V \ D, the symmetric difference of N (u) ∩ D and N (v) ∩ D is non-empty.)
Remark 2. In fact, we can offer a further proof for the NP-hardness of Dim
(on general graphs), based upon Theorem 1 and the following reasoning. If there
were a polynomial-time algorithm for computing dim(G), then we could compute
dimA (H) for any (non-trivial) graph H by computing dim(K2 ( H) with the
assumed polynomial-time algorithm, knowing that this is just twice as much
as dimA (H). As every NP-hardness proof adds a bit to the understanding of
the nature of the problem, this one does so, as well. It shows that Dim is NP-
complete even on the class of graphs that can be written as G ( H, where G is
some connected graph of order n ≥ 2 and H is non-trivial.
Theorem 14. (∗) 1-LocDom is NP-hard, even when restricted to planar graphs.
Moreover, assuming ETH, there is no O(poly(n + m)2o(n) ) algorithm solving
1-LocDom on general graphs of order n and size m.
Proof. (Sketch) Recall the textbook proof for the NP-hardness of VC (see [12])
that produces from a given 3-SAT instance I with n variables and m clauses a
graph G with two adjacent vertices per variable gadget and three vertices per
clause gadget forming a C3 (and 3m more edges that interconnect these gadgets
to indicate which literals occur in which clauses). So, G has 3m + 2n vertices
and 3m + n + 3m = 6m + n edges. We modify G to obtain G as follows: Each
edge that occurs inside of a variable gadget or of a clause gadget is replaced by a
triangle, so that we add 3m + n new vertices of degree two. All in all, this means
that G has (3m+2n)+(3m+n) = 6m+3n vertices and 9m+3n+3m = 12m+3n
edges. Now, assuming (w.l.o.g.) that I contains, for each variable x, at least one
clause with x as a literal and another clause with x̄ as a literal, we can show
that I is satisfiable iff G has a vertex cover of size at most 2m + n iff G has a
1-locating dominating set of size at most 2m + n.
The general case was treated in [7], but that proof (starting out again from
3-SAT) does not preserve planarity, as the variable gadget alone already con-
tains a K2,3 subgraph that inhibits non-crossing interconnections with the clause
gadgets. However, although not explicitly mentioned, that reduction also yields
the non-existence of O(poly(n + m)2o(n) ) algorithms based on ETH. In [30], we
also provide a reduction that works for planar graphs, working on a variant of
Lichtenstein’s reduction [27] that shows NP-hardness of VC on planar graph
instances.
Theorem 15. AdjDim is NP-complete, even when restricted to planar graphs.
Assuming ETH, there is no O(poly(n + m)2o(n) ) algorithm solving AdjDim on
graphs of order n and size m.
Proof. (Sketch) From an instance G = (V, E) and k of 1-LocDom, produce an
instance (G , k) of AdjDim by obtaining G from G by adding a new isolated
vertex x ∈
/ V to G. We claim that G has a 1-locating dominating set of size at
most k if and only if dimA (G ) ≤ k.
Alternatively, NP-hardness of AdjDim (and even the ETH-result) can be
deduced from the strong relation between the domination number and the ad-
jacency dimension as stated in Cor. 2, based on the NP-hardness of Dom.
Notions of Metric Dimension of Corona Products 163
2
1
3
Fig. 2. The clause gadget illustration. The square-shaped vertices do not belong to the
gadget, but they are the three literal vertices in variable gadgets that correspond to
the three literals in the clause.
5 Conclusions
References
1. Bailey, R.F., Meagher, K.: On the metric dimension of Grassmann graphs. Discrete
Mathematics & Theoretical Computer Science 13, 97–104 (2011)
2. Brigham, R.C., Chartrand, G., Dutton, R.D., Zhang, P.: Resolving domination in
graphs. Mathematica Bohemica 128(1), 25–36 (2003)
3. Buczkowski, P.S., Chartrand, G., Poisson, C., Zhang, P.: On k-dimensional graphs
and their bases. Periodica Mathematica Hungarica 46(1), 9–15 (2003)
4. Calabro, C., Impagliazzo, R., Paturi, R.: The complexity of satisfiability of small
depth circuits. In: Chen, J., Fomin, F.V. (eds.) IWPEC 2009. LNCS, vol. 5917, pp.
75–85. Springer, Heidelberg (2009)
5. Charon, I., Hudry, O., Lobstein, A.: Minimizing the size of an identifying or
locating-dominating code in a graph is NP-hard. Theoretical Computer Sci-
ence 290(3), 2109–2120 (2003)
6. Chartrand, G., Saenpholphat, V., Zhang, P.: The independent resolving number of
a graph. Mathematica Bohemica 128(4), 379–393 (2003)
7. Colbourn, C.J., Slater, P.J., Stewart, L.K.: Locating dominating sets in series par-
allel networks. Congressus Numerantium 56, 135–162 (1987)
8. Crowston, R., Gutin, G., Jones, M., Saurabh, S., Yeo, A.: Parameterized study
of the test cover problem. In: Rovan, B., Sassone, V., Widmayer, P. (eds.) MFCS
2012. LNCS, vol. 7464, pp. 283–295. Springer, Heidelberg (2012)
9. Dı́az, J., Pottonen, O., Serna, M.J., van Leeuwen, E.J.: On the complexity of metric
dimension. In: Epstein, L., Ferragina, P. (eds.) ESA 2012. LNCS, vol. 7501, pp.
419–430. Springer, Heidelberg (2012)
10. Feng, M., Wang, K.: On the metric dimension of bilinear forms graphs. Discrete
Mathematics 312(6), 1266–1268 (2012)
11. Frucht, R., Harary, F.: On the corona of two graphs. Aequationes Mathematicae 4,
322–325 (1970)
12. Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory
of NP-Completeness. W. H. Freeman & Co., New York (1979)
13. Guo, J., Wang, K., Li, F.: Metric dimension of some distance-regular graphs. Jour-
nal of Combinatorial Optimization, 1–8 (2012)
14. Gutin, G., Muciaccia, G., Yeo, A.: (non-)existence of polynomial kernels for the
test cover problem. Information Processing Letters 113(4), 123–126 (2013)
15. Hammack, R., Imrich, W., Klavžar, S.: Handbook of product graphs. Discrete
Mathematics and its Applications, 2nd edn. CRC Press (2011)
166 H. Fernau and J.A. Rodrı́guez-Velázquez
16. Harary, F., Melter, R.A.: On the metric dimension of a graph. Ars Combinatoria 2,
191–195 (1976)
17. Hartung, S., Nichterlein, A.: On the parameterized and approximation hardness of
metric dimension. In: Proceedings of the 28th IEEE Conference on Computational
Complexity (CCC 2013), pp. 266–276. IEEE (2013)
18. Haynes, T.W., Henning, M.A., Howard, J.: Locating and total dominating sets in
trees. Discrete Applied Mathematics 154(8), 1293–1300 (2006)
19. Impagliazzo, R., Paturi, R., Zane, F.: Which problems have strongly exponential
complexity? Journal of Computer and System Sciences 63(4), 512–530 (2001)
20. Iswadi, H., Baskoro, E.T., Simanjuntak, R.: On the metric dimension of corona
product of graphs. Far East Journal of Mathematical Sciences 52(2), 155–170
(2011)
21. Jannesari, M., Omoomi, B.: The metric dimension of the lexicographic product of
graphs. Discrete Mathematics 312(22), 3349–3356 (2012)
22. Johnson, M.: Structure-activity maps for visualizing the graph variables arising in
drug design. Journal of Biopharmaceutical Statistics 3(2), 203–236 (1993), pMID:
8220404
23. Johnson, M.A.: Browsable structure-activity datasets. In: Carbó-Dorca, R., Mezey,
P. (eds.) Advances in Molecular Similarity, pp. 153–170. JAI Press Inc., Stamford
(1998)
24. Karpovsky, M.G., Chakrabarty, K., Levitin, L.B.: On a new class of codes for
identifying vertices in graphs. IEEE Transactions on Information Theory 44(2),
599–611 (1998)
25. Khuller, S., Raghavachari, B., Rosenfeld, A.: Landmarks in graphs. Discrete Ap-
plied Mathematics 70, 217–229 (1996)
26. Laifenfeld, M., Trachtenberg, A.: Identifying codes and covering problems. IEEE
Transactions on Information Theory 54(9), 3929–3950 (2008)
27. Lichtenstein, D.: Planar formulae and their uses. SIAM Journal on Computing 11,
329–343 (1982)
28. Lokshtanov, D., Marx, D., Saurabh, S.: Lower bounds based on the Exponential
Time Hypothesis. EATCS Bulletin 105, 41–72 (2011)
29. Okamoto, F., Phinezy, B., Zhang, P.: The local metric dimension of a graph. Math-
ematica Bohemica 135(3), 239–255 (2010)
30. Rodrı́guez-Velázquez, J.A., Fernau, H.: On the (adjacency) metric dimension of
corona and strong product graphs and their local variants: combinatorial and com-
putational results. Tech. Rep. arXiv:1309.2275 [math.CO], ArXiv.org, Cornell Uni-
versity (2013)
31. Rodrı́guez-Velázquez, J.A., Barragán-Ramı́rez, G.A., Gómez, C.G.: On the local
metric dimension of corona product graph (2013) (submitted)
32. Saputro, S., Simanjuntak, R., Uttunggadewa, S., Assiyatun, H., Baskoro, E.,
Salman, A., Bača, M.: The metric dimension of the lexicographic product of graphs.
Discrete Mathematics 313(9), 1045–1051 (2013)
33. Slater, P.J.: Leaves of trees. Congressus Numerantium 14, 549–559 (1975)
34. Suomela, J.: Approximability of identifying codes and locating-dominating codes.
Information Processing Letters 103(1), 28–33 (2007)
35. Yero, I.G., Kuziak, D., Rodrı́quez-Velázquez, J.A.: On the metric dimension
of corona product graphs. Computers & Mathematics with Applications 61(9),
2793–2798 (2011)
On the Complexity of Computing Two
Nonlinearity Measures
1 Introduction
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 167–175, 2014.
c Springer International Publishing Switzerland 2014
168 M.G. Find
than a circuit with the smallest number of gates. Examples of this include pro-
tocols for secure multiparty computation (see e.g. [8,15]), non-interactive secure
proofs of knowledge [3], and fully homomorphic encryption (see for example
[20]).
It is a main topic in several papers (see e.g. [5,7,9]1 ) to find circuits with
few AND gates for specific functions using either exact or heuristic techniques.
Despite this and the applications mentioned above, it appears that the compu-
tational hardness has not been studied before.
The two measures have very different complexities, depending on the repre-
sentation of f .
Organization of the Paper and Results. In the following section, we introduce
the problems and necessary definitions. All our hardness results will be based
on assumptions stronger than P = NP, more precisely the existence of pseu-
dorandom function families and the “Strong Exponential Time Hypothesis”. In
Section 3 we show that if pseudorandom function families exist, the multiplica-
tive complexity of a function represented by its truth table cannot be computed
(or even approximated with a factor (2 − )n/2 ) in polynomial time. This should
be contrasted to the well known fact that nonlinearity can be computed in al-
most linear time using the Fast Walsh Transformation. In Section 4, we consider
the problems when the function is represented by a circuit. We show that in
terms of time complexity, under our assumptions, the situations differ very little
from the case where the function is represented by a truth table. However, in
terms of complexity classes, the picture looks quite different: Computing the
nonlinearity is #P hard, and multiplicative complexity is in the second level of
the polynomial hierarchy.
2 Preliminaries
In the following, we let F2 be the finite field of size 2 and Fn2 the n-dimensional
vector space over F2 . We denote by Bn the set of Boolean functions, mapping
from Fn2 into F2 . We say that f ∈ Bn is affine if there exist a ∈ Fn2 , c ∈ F2 such
that f (x) = a · x + c and linear if f is affine with f (0) = 0, with arithmetic over
F2 . This gives the symbol “+” an overloaded meaning, since we also use it for
addition over the reals. It should be clear from the context, what is meant.
In the following an XOR-AND circuit is a circuit with fanin 2 over the basis
(∧, ⊕, 1) (arithmetic over GF (2)). All circuits from now on are assumed to be
XOR-AND circuits. We adopt standard terminology for circuits (see e.g. [21]).
If nothing else is specified, for a circuit C we let n be the number of inputs and
m be the number of gates, which we refer to as the size of C, denoted |C|. For a
circuit C we let fC denote the function computed by C, and c∧ (C) denote the
number of AND gates in C.
For a function f ∈ Bn , the multiplicative complexity of f , denoted c∧ (f ), is
the smallest number of AND gates necessary and sufficient in an XOR-AND
1
Here we mean concrete finite functions, as opposed to giving good (asymptotic)
upper bounds for an infinite family of functions.
On the Complexity of Computing Two Nonlinearity Measures 169
Here AH denotes that the algorithm A has oracle access to a function H, that
might be fn (k, ·) for some k ∈ Fn2 or a random g ∈ Bn , for more details see [1].
Some of our hardness results will be based on the following assumption.
Assumption 1. There exist pseudorandom function families.
It is known that pseudorandom function families exist if one-way functions
exist [11,12,1], so we consider Assumption 1 to be very plausible. We will also
use the following assumptions on the exponential complexity of SAT , due to
Impagliazzo and Paturi.
Assumption 2 (Strong Exponential Time Hypothesis [13]). For
any fixed c < 1, no algorithm runs in time 2cn and computes SAT correctly.
Proof. Assume for the sake of contradiction that the algorithm A violates the
theorem. The algorithm breaking any pseudorandom function family works as
the one in the previous proof, but instead we return 1 if the value returned by
A is at least T = (nc + 1) · (2 − )n/2 . Now arguments similar to those in the
proof above show that if A returns a value larger than T , H must be random,
and if H is random, h has multiplicative complexity at most (nc + 1) · (2 − )n/2
with probability at most
c 2
+1)·(2−)(10c log n)/2 ) +2(nc +1)·(2−)10c log n/2 10c log n+10c log n+1
2((n
2210c log n
This tends to zero, implying that under the assumption on A, there is no pseu-
dorandom function family.
4 Circuit as Input
From a practical point of view, the theorems 1 and 2 might seem unrealistic.
We are allowing the algorithm to be polynomial in the length of the truth table,
which is exponential in the number of variables. However most functions used for
practical purposes admit small circuits. To look at the entire truth table might
(and in some cases should) be infeasible. When working with computational
problems on circuits, it is somewhat common to consider the running time in
two parameters; the number of inputs to the circuit, denoted by n, and the size
of the circuit, denoted by m. In the following we assume that m is polynomial
in n. In this section we show that even determining whether a circuit computes
an affine function is coNP-complete. In addition N LC can be computed in time
poly(m)2n , and is #P-hard. Under Assumption 1, M CC cannot be computed
in time poly(m)2O(n) , and is contained in the second level of the polynomial
hierarchy. In the following, we denote by AF F IN E the set of circuits computing
affine functions.
F (e(i) ) = ai + 1 = 1 = F (0),
Theorem 4. N LC is #P-hard.
inputs. To see that any other affine function approximates fC worse than 0,
notice that any nonconstant affine function is balanced and thus has to disagree
On the Complexity of Computing Two Nonlinearity Measures 173
The relation between circuit size and multiplicative complexity given in the
proof above is not tight, and we do not need it to be. See [18] for a tight rela-
tionship.
References
1. Arora, S., Barak, B.: Computational Complexity - A Modern Approach, pp. 1–579.
Cambridge University Press (2009)
2. Boyar, J., Peralta, R., Pochuev, D.: On the multiplicative complexity of Boolean
functions over the basis (∧,⊕,1). Theoretical Computer Science 235(1), 43–57
(2000)
3. Boyar, J., Damgård, I., Peralta, R.: Short non-interactive cryptographic proofs. J.
Cryptology 13(4), 449–472 (2000)
4. Boyar, J., Find, M., Peralta, R.: Four measures of nonlinearity. In: Spirakis, P.G.,
Serna, M. (eds.) CIAC 2013. LNCS, vol. 7878, pp. 61–72. Springer, Heidelberg
(2013)
5. Boyar, J., Matthews, P., Peralta, R.: Logic minimization techniques with applica-
tions to cryptology. J. Cryptology 26(2), 280–312 (2013)
6. Carlet, C.: Boolean functions for cryptography and error correcting codes. In:
Crama, Y., Hammer, P.L. (eds.) Boolean Models and Methods in Mathematics,
Computer Science, and Engineering, ch. 8, pp. 257–397. Cambridge Univ. Press,
Cambridge (2010)
7. Cenk, M., Özbudak, F.: On multiplication in finite fields. J. Complexity 26(2),
172–186 (2010)
8. Chaum, D., Crépeau, C., Damgård, I.: Multiparty unconditionally secure protocols
(extended abstract). In: Simon, J. (ed.) STOC, pp. 11–19. ACM (1988)
9. Courtois, N., Bard, G.V., Hulme, D.: A new general-purpose method to multiply
3x3 matrices using only 23 multiplications. CoRR abs/1108.2830 (2011)
10. Daemen, J., Rijmen, V.: AES proposal: Rijndael (1999),
http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf
11. Goldreich, O., Goldwasser, S., Micali, S.: How to construct random functions. J.
ACM 33(4), 792–807 (1986)
12. Håstad, J., Impagliazzo, R., Levin, L.A., Luby, M.: A pseudorandom generator
from any one-way function. SIAM J. Comput. 28(4), 1364–1396 (1999)
13. Impagliazzo, R., Paturi, R.: On the complexity of k-SAT. J. Comput. Syst.
Sci. 62(2), 367–375 (2001)
14. Kabanets, V., yi Cai, J.: Circuit minimization problem. In: Yao, F.F., Luks, E.M.
(eds.) STOC, pp. 73–79. ACM (2000)
15. Kolesnikov, V., Schneider, T.: Improved garbled circuit: Free XOR gates and
applications. In: Aceto, L., Damgård, I., Goldberg, L.A., Halldórsson, M.M.,
Ingólfsdóttir, A., Walukiewicz, I. (eds.) ICALP 2008, Part II. LNCS, vol. 5126,
pp. 486–498. Springer, Heidelberg (2008)
16. O’Donnell, R.: Analysis of Boolean Functions. Book draft (2012),
http://www.analysisofbooleanfunctions.org
17. Razborov, A.A., Rudich, S.: Natural proofs. J. Comput. Syst. Sci. 55(1), 24–35
(1997)
On the Complexity of Computing Two Nonlinearity Measures 175
18. Sergeev, I.S.: A relation between additive and multiplicative complexity of Boolean
functions. CoRR abs/1303.4177 (2013)
19. Sloane, N., MacWilliams, F.J.: The Theory of Error-Correcting Codes. North-
Holland Math. Library 16 (1977)
20. Vaikuntanathan, V.: Computing blindfolded: New developments in fully homomor-
phic encryption. In: Ostrovsky, R. (ed.) FOCS, pp. 5–16. IEEE (2011)
21. Wegener, I.: The Complexity of Boolean Functions. Wiley-Teubner (1987)
Block Products and Nesting Negations in FO2
1 Introduction
The study of logical fragments over words has a long tradition in computer
science. The seminal Büchi-Elgot-Trakhtenbrot Theorem from the early 1960s
states that a language is regular if and only if it is definable in monadic second-
order logic [1,5,32]. A decade later, in 1971, McNaughton and Papert showed
that a language is definable in first-order logic if and only if it is star-free [17].
Combining this result with Schützenberger’s famous characterization of star-
free languages in terms of finite aperiodic monoids [21] shows that it is decidable
whether a given regular language is first-order definable. Since then, many logical
fragments have been investigated, see e.g. [3,25] for overviews.
The motivation for such results is two-fold. First, restricted fragments often
yield more efficient algorithms for computational problems such as satisfiability
or separability. Second, logical fragments give rise to a descriptive complexity:
∗
The last two authors acknowledge the support by the German Research Foundation
(DFG) under grant DI 435/5-1.
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 176–189, 2014.
© Springer International Publishing Switzerland 2014
Block Products and Negation Nesting in FO2 177
The simpler the fragment to define a language, the simpler the language. This
approach can help in understanding the rich structure of regular languages.
Logical fragments are usually defined by restricting some resources in formu-
las. The three most natural restrictions are the quantifier depth (i.e., the num-
ber of nested quantifiers), the alternation depth (i.e., the number alternations
between existential and universal quantification), and the number of variables.
With respect to decidability questions regarding definability, quantifier depth is
not very interesting since for fixed quantifier depth only finitely many languages
are definable (which immediately yields decidability), see e.g. [4]. The situation
with alternation in first-order logic is totally different: Only the very first level
(i.e., no alternation) is known to be decidable [8,23]. By a result of Thomas [31]
the alternation hierarchy in first-order logic is tightly connected with the dot-
depth hierarchy [2] or the Straubing-Thérien hierarchy [24,29], depending on the
presence or absence of the successor predicate. Some progress in the study of
the dot-depth hierarchy and the Straubing-Thérien hierarchy was achieved by
considering the half-levels. For example, the levels 1⁄2 and 3⁄2 in each of the two
hierarchies are decidable [6,18,19]. The half levels also have a counterpart in the
alternation hierarchy of first-order logic by requiring existential quantifiers in the
first block. Another point of view of the same hierarchy is to disallow universal
quantifiers and to restrict the number of nested negations.
Regarding the number of variables, Kamp showed that linear temporal logic is
expressively complete for first-order logic over words [7]. Since every modality in
linear temporal logic can be defined using three variables, first-order logic with
only three different names for the variables (denoted by FO3 ) defines the same
languages as full first-order logic. This result is often stated as FO3 = FO. Allow-
ing only two variable names yields the proper fragment FO2 of first-order logic.
Thérien and Wilke [30] showed that a language is FO2 definable if and only if
its syntactic monoid belongs to the variety DA and, since the latter is decidable,
one can effectively check whether a given regular language is FO2 -definable. For
further information on the numerous characterizations of FO2 we refer to [3,28].
Inside FO2 , the alternation depth is also a natural restriction. One difference
to full first-order logic is that one cannot rely on prenex normal forms as a
simple way of defining the alternation depth. Weil and the second author gave
an effective algebraic characterization of the mth level FO2m of this hierarchy.
More precisely, they showed that it is possible to ascend the FO2 -alternation
hierarchy using so-called Mal’cev products [15] which in this particular case
preserve decidability. There are two main ingredients in the proof. The first
one is a combinatorial tool known as rankers [33] or turtle programs [22], and
the second is a relativization property of two-variable first-order logic. These
two ingredients are then combined using a proof method introduced in [10].
Krebs and Straubing gave another decidable characterization of FO2m in terms
of identities of ω-terms using completely different techniques [9,26]; their proof
relies on so-called block products.
In this paper we consider the half-levels Σm 2
of the FO2 -alternation hierarchy.
A language is definable in Σm if and only if it is definable in FO2 without universal
2
178 L. Fleischer, M. Kufleitner, and A. Lauser
quantifiers and with at most m − 1 nested negations. It is easy to see that one can
avoid negations of atomic predicates. One can think of Σm 2
as those FO2 -formulas
which on every path of their parse tree have at most m quantifier blocks, and the
outermost block is existential. The main contribution of this paper are ω-terms
Um and Vm such that an FO2 -definable language is Σm 2
-definable if and only if
its ordered syntactic monoid satisfies Um Vm . For a given regular language it
2
is therefore decidable whether it is definable in Σm by first checking whether it
is FO -definable and if so, then verifying whether Um Vm holds in its ordered
2
syntactic monoid. Moreover, for every FO2 -definable language L one can compute
2
the smallest integer m such that L is definable in Σm .
The proof step from the identities to logic is a refinement of the approach
of Weil and the second author [15] which in turn uses a technique from [10,
Section IV]. While the proof method in [10] is quite general and can be applied for
solving various other problems [11,12,13,14], it relies on closure under negation.
A very specific modification is necessary in order to get the scheme working in
the current situation.
The proof for showing that Σm2
satisfies the identity Um Vm is an adaptation
of Straubing’s proof [26] to ordered monoids. Straubing’s proof relies on two-
sided semidirect products and the block product principle. We partially extend
both tools to ordered monoids. To the best of our knowledge, this extension does
not yet appear in the literature. The attribute partially is due to the fact that
only the first factor in two-sided semidirect products (as used in this paper) is
ordered while the second factor is an unordered monoid. As shown by Pin and
Weil in the case of one-sided semidirect products [20], one could use ordered
alphabets for further extending this approach. We refrain from this in order to
focus on the presentation of our main result.
2 Preliminaries
The free monoid A∗ is the set of finite words over A equipped with concatenation
and the empty word ε as neutral element. Let u = a1 · · · ak with ai ∈ A be a finite
word. The alphabet (also known as the content ) of u is alph(u) = {a1 , . . . , ak }, its
length is |u| = k, and the positions of u are 1, . . . , k. We say that i is an a-position
of u if ai = a. The word u is a (scattered) subword of w if w ∈ A∗ a1 · · · A∗ ak A∗.
First-Order Logic. We consider first-order logic FO = FO[<] over finite
words. The syntax of FO-formulas is
x = y ≡ (x < y) ∨ (y < x)
¬(x < y) ≡ (x = y) ∨ (y < x)
and a ∈ alph(u1 bu2 ) and for all |u1 b| < p, q |u1 bu2 | we have:
u, p, q |= ϕ(Yb;Xa) if and only if u2 , p − |u1 b|, q − |u1 b| |= ϕ.
Proof. Atomic formulas and Boolean combinations are straightforward. Let the
macro Yb < x < Xa stand for ¬(∃y x : λ(y) = a) ∧ ¬(∃y x : λ(y) = b). Using
this shortcut, we set ∃x ϕ(Yb;Xa) ≡ ∃x ((Yb < x < Xa ) ∧ ϕ(Yb;Xa) ).
Let h : A∗ → M be a homomorphism. The L-factorization of a word u is
the unique factorization u = s0 a1 · · · s−1 a s with si ∈ A∗ and so-called mark-
ers ai ∈ A such that h(s ) L 1 and h(si ai+1 · · · s−1 a s ) >L h(ai si · · · a s ) L
h(si−1 ai · · · s−1 a s ) for all i. Note that < |M |. Furthermore, if M ∈ DA,
then ai ∈ alph(si ). Let DL (u) consist of the positions of the markers, i.e., let
Block Products and Negation Nesting in FO2 185
ϕ ∈ Σm,n
2
.
Lemma 5. Let h : A∗ → M be a homomorphism with M ∈ DA, let m 2
and n 0 be integers, and let u, v ∈ A∗ with u fo
2
m,2|M|+n v. There exist
factorizations u = s0 a1 · · · s−1 a s and v = t0 a1 · · · t−1 a t with ai ∈ A and
si , ti ∈ A∗ such that the following properties hold for all i ∈ {1, . . . , }:
1. si fo
2
m−1,n ti ,
2. h(s0 ) R 1 and h(t0 a1 · · · ti−1 ai ) R h(t0 a1 · · · ti−1 ai si ),
3. h(s ) L 1 and h(ai si · · · a s ) L h(si−1 ai · · · a s ).
Proof. Note that in property 2. the suffix is si and not ti . We want to prove
the claim by an induction, for which we have to slightly generalize the claim.
Apart from the words u and v from the premises of the lemma we also con-
sider an additional word p which serves as a prefix for v. The proof is by
induction on |DR (pv) \ DR (p)|. The assumptions are u fo
2
m,n v, where n =
n + |DR (pv) \ DR (p)| + |DL (u)| + 1. We shall construct factorizations u =
s0 a1 · · · s−1 a s and pv = p t0 a1 · · · t−1 a t such that properties 1. and 3. hold,
but instead of 2. we have h(pt0 a1 · · · ti−1 ai ) R h(pt0 a1 · · · ti−1 ai si ) and h(ps0 ) R
h(p). We thus recover the lemma using an empty prefix p.
Let u = s0 c1 · · · s −1 c s be the L-factorization (in particular ci ∈ alph(si ))
and let v = t0 c1 · · · t −1 c t where ci ∈ alph(ti ) for all i. The factorization
of v exists because by assumption u and v agree on subwords of length . The
dual of Lemma 3 yields s0 c1 · · · c −i s −i fo
m−1,n −i t0 c1 · · · c −i t −i as well as
2
fo2
si m−1,n ti for all i.
First suppose DR (p) = DR (pv). In this case h(p) R h(pv), and therefore,
h(p) R h(px) for all x ∈ B ∗ , where B = alph(v). So in particular we have that
h(pt0 c1 · · · ti−1 ci ) R h(pt0 c1 · · · ti−1 ci si ) because alph(u) = B. Setting ai = ci ,
si = si , and ti = ti yields a factorization with the desired properties.
Suppose now DR (p) DR (pv), and let s be the longest prefix of u such that
h(p) R h(ps) >R h(psa) for some a ∈ A. Such a prefix exists as alph(u) =
alph(v). We have a ∈ alph(s) by M ∈ DA. Let t be the longest prefix of v with
a ∈ alph(t). Using Lemma 3 we see alph(t) ⊆ alph(s). Let k and k be maximal
such that s0 c1 · · · sk−1 ck is a prefix of s and such that t0 c1 · · · tk −1 ck is a prefix
of t. We claim k = k . For instance, suppose k < k . Then ack+1 · · · c is a sub-
word of u but not of v (since ck+1 tk+1 · · · c t is the shortest suffix of v with the
subword ck+1 · · · c and since there is no a-position in t0 c1 · · · tk ). Let ai = ci for
i ∈ {1, . . . , k}, let si = si and ti = ti for i ∈ {0, . . . , k − 1}. Let sk and tk such that
s = s0 c1 · · · sk−1 ck sk and t = t0 c1 · · · tk−1 ck tk . Lemma 4 yields sk fo
2
m−1,n tk .
Let u = sau and v = tav , and let p = pta. For all i ∈ {0, . . . , k} we
have h(pt0 a1 · · · ti−1 ai ) R h(pt0 a1 · · · ti−1 ai si ) because alph(t) ⊆ alph(s). Note
that h(ai+1 si+1 · · · ak sk au ) L h(si ai+1 si+1 · · · ak sk au ). Since M ∈ DA we see
186 L. Fleischer, M. Kufleitner, and A. Lauser
h(p) >R h(p ) and thus DR (p) DR (p ). Using the formulas ϕ>Xa from
Lemma 3 yields u fo
m,n −1 v . As n |DR (p v ) \ DR (p )| + |DL (u )| + 2
2
we can apply induction to obtain factorizations u = sk+1 ak+2 · · · s−1 a s and
v = tk+1 ak+2 · · · t−1 a t . Setting ak+1 = a yields the desired factorizations.
The preceding lemma enables induction on the parameter m. We start with
a homomorphism onto a monoid satisfying Um Vm and want to show that
preimages of -order ideals are unions of fo
2
m,n -order ideals for some sufficiently
large n. Intuitively, a string rewriting technique yields the largest quotient which
satisfies the identity Um−1 Vm−1 . One rewriting step corresponds to one ap-
plication of the identity Um−1 Vm−1 of level m − 1. Such rewriting steps can
be lifted to the identity Um Vm in the contexts they are applied.
Proposition 3. Let m 1 be an integer, let h : A∗ → M be a surjective homo-
morphism onto an ordered monoid M ∈ DA satisfying Um Vm . There exists
a positive integer n such that u fo ∗
m,n v implies h(u) h(v) for all u, v ∈ A .
2
Observe that (pum−1 qx)ω p = p(um−1 qxp)ω = p(um−1 xm )ω . Note that alph(t ) ⊆
alph(s). Therefore, h(u) R h(us) implies h(u) R h(ut ), and symmetrically
h(v) L h(sv) implies h(v) L h(t v). Induction yields h(ut v) h(utv) and thus
h(usv) h(utv). This completes the proof of the claim.
Let t ∼ s if t → ∗
s and s → ∗
t. Let M be the quotient A∗ /∼. The relation ∼ is
∗
a congruence on A and M is naturally equipped with a monoid structure. Let
h : A∗ → M be the canonical homomorphism mapping u ∈ A∗ to its equivalence
class modulo ∼. The preorder → ∗
on A∗ induces a partial order on M by letting
h (u) h (v) whenever v → u. Thus M forms an ordered monoid. Moreover, M
∗
Conclusion
The fragments Σm 2
of FO2 [<] are defined by restricting the number of nested
negations. They can be seen as the half levels of the alternation hierarchy FO2m
in two-variable first-order logic, and we have Σm2
⊆ FO2m ⊆ Σm+12
. It is known
that the languages definable in FOm form a strict hierarchy, see e.g. [16]. For
2
2
definable in Σm if and only if its ordered syntactic monoid is in the variety
DA and satisfies the identity Um Vm . Using this characterization one can
2
decide whether a given regular language is definable in Σm . In particular, we
have shown decidability for every level of an infinite hierarchy. Note that there is
no immediate connection between the decidability of FO2m and the decidability
2
of Σm .
The block product principle is an important tool in the proof of the direction
2
from Σm to identities. In order to be able to apply this tool, we first extended
block products to the case where the left factor is an ordered monoid and then
stated the block product principle in this context. In order to further extend
the block product M N to the case where both M and N are ordered, one
has to consider the monotone functions in N × N → M instead of M N ×N . As
in the case of the wreath product principle [20] this leads to ordered alphabets
when stating the block product principle. However, one implication in the block
product principle fails for ordered alphabets as the universal property does not
hold in this setting.
References
1. Büchi, J.R.: Weak second-order arithmetic and finite automata. Z. Math. Logik
Grundlagen Math. 6, 66–92 (1960)
2. Cohen, R.S., Brzozowski, J.A.: Dot-depth of star-free events. J. Comput. Syst.
Sci. 5(1), 1–16 (1971)
3. Diekert, V., Gastin, P., Kufleitner, M.: A survey on small fragments of first-order
logic over finite words. Int. J. Found. Comput. Sci. 19(3), 513–548 (2008)
4. Ebbinghaus, H.-D., Flum, J.: Finite Model Theory. In: Perspectives in Mathemat-
ical Logic. Springer (1995)
5. Elgot, C.C.: Decision problems of finite automata design and related arithmetics.
Trans. Amer. Math. Soc. 98, 21–51 (1961)
6. Glaßer, C., Schmitz, H.: Languages of dot-depth 3/2. Theory of Computing Sys-
tems 42(2), 256–286 (2008)
7. Kamp, J.A.W.: Tense Logic and the Theory of Linear Order. PhD thesis, University
of California (1968)
8. Knast, R.: A semigroup characterization of dot-depth one languages. RAIRO, Inf.
Théor. 17(4), 321–330 (1983)
9. Krebs, A., Straubing, H.: An effective characterization of the alternation hierarchy
in two-variable logic. In: FSTTCS 2012, Proceedings. LIPIcs, vol. 18, pp. 86–98.
Dagstuhl Publishing (2012)
10. Kufleitner, M., Lauser, A.: Languages of dot-depth one over infinite words. In:
Proceedings of LICS 2011, pp. 23–32. IEEE Computer Society (2011)
11. Kufleitner, M., Lauser, A.: Around dot-depth one. Int. J. Found. Comput.
Sci. 23(6), 1323–1339 (2012)
12. Kufleitner, M., Lauser, A.: The join levels of the trotter-weil hierarchy are decidable.
In: Rovan, B., Sassone, V., Widmayer, P. (eds.) MFCS 2012. LNCS, vol. 7464,
pp. 603–614. Springer, Heidelberg (2012)
13. Kufleitner, M., Lauser, A.: The join of the varieties of R-trivial and L-trivial
monoids via combinatorics on words. Discrete Math. & Theor. Comput. Sci. 14(1),
141–146 (2012)
Block Products and Negation Nesting in FO2 189
14. Kufleitner, M., Lauser, A.: Quantifier alternation in two-variable first-order logic
with successor is decidable. In: Proceedings of STACS 2013. LIPIcs, vol. 20,
pp. 305–316. Dagstuhl Publishing (2013)
15. Kufleitner, M., Weil, P.: The FO2 alternation hierarchy is decidable. In: Proceed-
ings of CSL 2012. LIPIcs, vol. 16, pp. 426–439. Dagstuhl Publishing (2012)
16. Kufleitner, M., Weil, P.: On logical hierarchies within FO2 -definable languages. Log.
Methods Comput. Sci. 8, 1–30 (2012)
17. McNaughton, R., Papert, S.: Counter-Free Automata. The MIT Press (1971)
18. Pin, J.-É.: A variety theorem without complementation. Russian Mathematics (Iz.
VUZ) 39, 80–90 (1995)
19. Pin, J.-É., Weil, P.: Polynomial closure and unambiguous product. Theory Comput.
Syst. 30(4), 383–422 (1997)
20. Pin, J.-É., Weil, P.: The wreath product principle for ordered semigroups. Commun.
Algebra 30(12), 5677–5713 (2002)
21. Schützenberger, M.P.: On finite monoids having only trivial subgroups. Inf. Con-
trol 8, 190–194 (1965)
22. Schwentick, T., Thérien, D., Vollmer, H.: Partially-ordered two-way automata: A
new characterization of DA. In: Kuich, W., Rozenberg, G., Salomaa, A. (eds.) DLT
2001. LNCS, vol. 2295, pp. 239–250. Springer, Heidelberg (2002)
23. Simon, I.: Piecewise testable events. In: Brakhage, H. (ed.) GI-Fachtagung 1975.
LNCS, vol. 33, pp. 214–222. Springer, Heidelberg (1975)
24. Straubing, H.: A generalization of the Schützenberger product of finite monoids.
Theor. Comput. Sci. 13, 137–150 (1981)
25. Straubing, H.: Finite Automata, Formal Logic, and Circuit Complexity. Birkhäuser
(1994)
26. Straubing, H.: Algebraic characterization of the alternation hierarchy in FO2 [ < ]
on finite words. In: Proceedings CSL 2011. LIPIcs, vol. 12, pp. 525–537. Dagstuhl
Publishing (2011)
27. Straubing, H., Thérien, D.: Weakly iterated block products of finite monoids. In:
Rajsbaum, S. (ed.) LATIN 2002. LNCS, vol. 2286, pp. 91–104. Springer, Heidelberg
(2002)
28. Tesson, P., Thérien, D.: Diamonds are forever: The variety DA. In: Proceedings of
Semigroups, Algorithms, Automata and Languages, pp. 475–500. World Scientific
(2002)
29. Thérien, D.: Classification of finite monoids: The language approach. Theor. Com-
put. Sci. 14(2), 195–208 (1981)
30. Thérien, D.: Th. Wilke. Over words, two variables are as powerful as one quantifier
alternation. In: Proceedings of STOC 1998, pp. 234–240. ACM Press (1998)
31. Thomas, W.: Classifying regular events in symbolic logic. J. Comput. Syst. Sci. 25,
360–376 (1982)
32. Trakhtenbrot, B.A.: Finite automata and logic of monadic predicates (in Russian).
Dokl. Akad. Nauk. SSSR 140, 326–329 (1961)
33. Weis, P., Immerman, N.: Structure theorem and strict alternation hierarchy for
FO2 on words. Log. Methods Comput. Sci. 5, 1–23 (2009)
Model Checking for String Problems
1 Introduction
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 190–203, 2014.
c Springer International Publishing Switzerland 2014
Model Checking for String Problems 191
Then ρ[X → S] denotes the function that maps X to the set S and agrees with
ρ on all other arguments.
[[pi ]]Tρ := {(s1 , . . . , sk ) | p ∈ λ(si )}
[[¬ϕ]]Tρ := 2S \ [[ϕ]]Tρ
k
Thus, μX.ϕ defines the least fixpoint of the function that takes a set of k-tuples
of nodes S and returns the set of all k-tuples satisfying ϕ assuming that X is
interpreted as S [14,23]. We write s |=ρ ϕ if s ∈ [[ϕ]]Tρ for a k-tuple s of nodes in
T , denoting the fact that s satisfies the property formalised by ϕ. If ϕ does not
contain any free variables we may also drop the interpretation ρ.
A prominent example of a L2μ formula is
ϕbis := νX.( p1 ↔ p2 ) ∧ [a]1 a2 X ∧ [a]2 a1 X .
p∈P a∈Σ
It expresses bisimilarity in the sense that for all pairs of two nodes (s, t) we have
(s, t) |= ϕbis iff s and t are bisimilar.
closed Lkμ formula ϕ, one can compute the set [[ϕ]]T by induction on the structure
of ϕ. Fixpoint subformulas of the form μX.ψ or νX.ψ can be handled using
Knaster-Tarski fixpoint iteration: for least fixpoint formulas one binds X to the
empty set and computes the value of ψ on T . Then X is bound to this set of
k-tuples and so on until a fixpoint is reached. For greatest fixpoints one starts
the iteration with S k instead.
The model checking problem for the polyadic μ-calculus has been investigated
before [1,16]. Essentially, there is no conceptual difference to model checking the
ordinary μ-calculus [9] which consists of all formulas of arity 1. In fact, there
is a simple reduction from model checking formulas of arity k to formulas of
arity 1 on the k-fold product of a transition system. Thus, one of the major
parameters in its complexity – besides the formula’s arity – is its alternation
depth. Intuitively, it measures the nesting depth of fixpoints of different type.
For formulas with no such nestings we set it to 1. Since alternating fixpoint
quantifiers do not play any role in tackling string problems in the next section
we omit a formal definition of alternation depth here and refer to the literature
instead [4].
The next proposition summarises the findings on the complexity of model
checking Lω μ.
we consider how the naı̈ve fixpoint iteration algorithm computes [[ϕlcst ]]TW . First
m
we observe that i=1 ii satisfies exactly those m-tuples for which each i-th com-
ponent belongs to the i-th input string. Thus, fixpoint iteration only yields tuples
of positions with exactly one for each input string. Let us call these normal.
The greatest fixpoint iteration starts with the set of all tuples, and we can
restrict our attention to all normal tuples only. This set can be seen as a rep-
resentation of all the position at which the string ε occurs. The next fixpoint
iteration forms the union of all sets of normal tuples which represent positions
such that some a-edge is possible from all of them, and the resulting tuple repre-
sents occurrences of the substring a. Thus, it computes all positions of common
substrings of length 1. In general, the j-th fixpoint iteration computes all po-
sitions (as normal m-tuples) of a common substring of length j. Clearly, this
process is monotonically decreasing and there is some j – at most n + 1 – such
that the j-th iteration returns the empty set.
Indeed we have TW |= ϕlcst for any set W of strings. Nevertheless, model
checking via fixpoint iteration computes all common substrings of W before
finding out that the formula is not satisfied. This is the basis for an algorithm
computing the longest common substring using model checking as described in
detail in the next section.
b a b a b
3,0 3,1 3,2 3,3 3,4 3,5
A greatest fixpoint iteration for ϕlcst on TW starts with X 0as the set of all
positions. In order to compute the next iteration, note that [[( i=1 ii )]]TW is the
3
set of all tuples of the form ((1, j1 ), (2, j2 ), (3, j3 )) for appropriate j1 , j2 , j3 . Every
further iteration intersects some set obtained by evaluating the modal terms
with
this set. We therefore disregard all other tuples. Under this assumption,
[[ c∈{a,b} c1 c2 c3 X]]T[XW→X 0 ] then evaluates to
X 1 := {(1, 0), (1, 1), (1, 3)} × {(2, 0), (2, 2), (2, 3)} × {(3, 1), (3, 3)}
∪ {(1, 2), (1, 4)} × {(2, 1)} × {(3, 0), (3, 2), (3, 4)}
which is exactly the set of node tuples from which all components can do an
a-edge or all components can do a b-edge.
The next iteration for the evaluation of the greatest fixpoint is obtained by
evaluating the fixpoint body again, this time under the variable interpretation
[X → X 1 ], and it yields
X 2 := {(1, 1), (1, 3)} × {(2, 0)} × {(3, 1), (3, 3)}
196 M. Hutagalung and M. Lange
which is the set of positions of ab, resp. ba, in the input strings. Note that aa
for instance is no common substring, and this is reflected by the fact that there
is no p such that ((1, 0), (2, 2), p) belongs to X 2 .
The next iteration yields X 3 := {((1, 1), (2, 0), (3, 1))} which denotes the po-
sitions of the common substring aba. Finally, we get X 4 = ∅ at which point the
fixpoint is reached, and the solution to this longest common substring instance
is obtained as the value of the last iteration beforehand, namely aba at positions
1, 0, and 1 in the three input strings.
L2μ is also capable of expressing the longest common subsequence problem in
the same sense. Let ∗i ψ abbreviate μY.ψ ∨ a∈Σ ai Y . Informally, it denotes
the set of all tuples such that the i-th component can make an arbitrary num-
ber of steps along
m any edge and some resulting tuple satisfies ψ. Now consider
ϕlcsq := νX.( i=1 ii ) ∧ a∈Σ a1 ∗1 . . . am ∗m X. Evaluating this formula on
a transition system of the form TW will compute the longest common subse-
quence of the input strings in W in the same way as above. Note that, again,
we have TW |= ϕlcsq for any W but all the solutions to this instance are being
found in the last iteration of the greatest fixpoint evaluation.
components. By the structure of TW , the iteration grows monotonically “to the
left”, i.e. it only ever adds tuples with positions further left in the input words.
Eventually – after no more than (n + 1)m iterations in the worst case – the
tuple ((1, 0), . . . , (m, 0)) is being found and the least fixpoint is being reached.
The number of iterations done to achieve this equals the length of a shortest
common superstring, and this string can easily be computed by annotating the
found tuples of positions successively.
The algorithms sketched above are rather naı̈ve and do not exploit any opti-
misation potential at all. The descriptions above are only meant to show how
model checking with fixpoint logics can in principle be used in order to solve such
computation problems. Here we focus on one particular problem, namely finding
longest common substrings, and show how partial evaluation of model checking
algorithms can be used to obtain an efficient procedure. Also note that a naı̈ve
estimation of the worst-case time complexity of these algorithms according to
Prop. 1 yields a horrendous overapproximation: in general, model checking Lkμ is
exponential in the arity k, here equalling the number of strings m in the input.
This, however, ignores the special structure of the transition systems used here
and that of the fixed formula.
Consider the algorithm that has been described in Example 1. It basically
works on a set X of common substrings, and in each iteration it extends all
elements of X to a longer common substring by considering one more letter to
the left. For m input strings of length n, the set X is represented by a set of
m-tuples, which initially contains nm tuples that represent the positions of the
empty string.
A straightforward optimisation changes the representation of the set X. In-
stead of using a set of m-tuples, we can represent a single substring w with a
set t(w) of pairs such that (i, j) ∈ t(w) iff w occurs in wi at position j. By using
this representation, initially we have nm positions instead of nm positions for
the empty string. Moreover, it is easy to check whether w is a common substring
which is true iff for every i = 1, . . . , m there is some j with (i, j) ∈ t(w).
Applying these straight-forward optimisations to the procedure described in
Ex. 1 yields Algorithm 1. It collects all non-extendable common substrings in a
set Y , and uses that for a return value.
In the following we describe further optimisations for Algorithm 1, so that it
can find longest common substrings faster and more efficiently.
for each w ∈ X that have been extended. Moreover, we should always take the
shortest w ∈ X in each iteration, to make sure that the extension of w is already
computed in the previous iteration.
Multiple Substrings Extension. Under some conditions, extending a single
w ∈ X may imply extensions of some other substrings u ∈ X. For any w ∈ X
let S(w) = {u ∈ X | u = wv, v ∈ Σ + }. If w is extendable to aw, in general we
cannot conclude that u ∈ S(w) is also extendable to au. However it is the case if
t(aw) is equal to {(i, j − 1)|(i, j) ∈ t(w)}, since this means that all occurrences of
w in the input strings are always preceded by a. In this case, we can extend w to
aw, and also every u ∈ S(w) to au. Likewise if w is not extendable to any longer
common substring, then every u ∈ S(w) is also not extendable. In this case we
can move w and all u ∈ S(w) to Y . Extending all u ∈ S(w) (resp. moving all
u ∈ S(w) to Y ) can be done in constant time by exploiting the pointers defined
before, i.e. a pointer from w = w a to w since every u are successively linked by
the pointer to w.
Multiple Letters Extension. It is also possible to extend w ∈ X with a se-
quence of letters an an−1 . . . a1 ∈ Σ n instead of only one single letter. Suppose
w = w a, and the string w was extended to a common substring an an−1 . . . a1 w
because of the previous extension policy, i.e. because t(a1 w ) = {(i, j − 1)|(i, j) ∈
t(w )}, . . . , t(an . . . a1 w ) = {(i, j − 1)|(i, j) ∈ t(an−1 . . . a1 w )}. Then if we can
extend w to a1 w, we can immediately conclude that w can be extended to
an an−1 . . . a1 w.
All of these optimisations will not make the extension of a single substring
w ∈ X harder since we store more information on each common substring,
to accommodate the optimisations. The extension policies derived from these
optimisations can cut down the number of iterations needed in Algorithm 1.
i X Y i X Y
1 g,t,c,a - 1 g,t,c,a -
2 ag,cg,t,c,a - 2 ag,cg,t,c,a -
3 ag,cg,gt,c,a - 3 ag,cg,gt,c,a -
4 ag,cg,gt,ac,a - 4 ag,cg,gt,ac,a -
5 ag,cg,gt,ac,ta - 5 ag,cg,gt,ac,gta -
6 cg,gt,ac,ta ag 6 cg,gt,ac,gta ag
7 acg,gt,ac,ta ag 7 acg,gt,ac,gta ag
8 acg,cgt,ac,ta ag 8 acg,cgt,ac,cgta ag
9 acg,cgt,ta ag,ac 9 acg,cgt,cgta ag,ac
.. .. .. 10 cgt,cgta ag,ac,acg
. . . 11 - ag,ac,acg,cgt,cgta
(a) without optimisation (b) with optimisation
computation with optimisation which finds the longest common substring cgta
after 11 iterations.
Note that in Fig.1 (b), we apply the optimisation in the 4th, 7th, and 10th
iteration. In the 4th iteration it is found that a can be extended to ta and we
have t(gt) = {(i, j − 1) | (i, j) ∈ t(t)} from the previous iteration, so a can be
extended directly to gta. In the 7th iteration, by extending gt to cgt we also
extend gta to cgta since gta ∈ S(gt). In the 10th iteration cgt is not extendable
so we conclude that cgta are not either.
Theorem 1. For input strings w1 , . . . , wm each of length n, the number of it-
erations needed by the optimised algorithm is at most n + n + m(n − 1).
Proof. In each iteration i, we pick the shortest common substring w ∈ X i to be
extended, which satisfies one of these properties, either:
1. w cannot be extended to the left anymore, or
2. w can be extended to aw and t(aw) = {(i, j − 1)|(i, j) ∈ t(w)}, i.e. w allows
multiple substring extension as described previously, or
3. none of these two conditions apply to w.
Let L1 , L2 , L3 be the set of common substring of w1 , . . . , wn , such that w ∈ Li
iff w satisfies the i-th property.
|L1 | ≤ n, since we have a one-to-one mapping from L1 to the set of prefixes of
w1 . Note that each v ∈ L1 is a substring of w1 (resp. w2 , . . . , wn ), and it can be
mapped to a prefix uv of w1 . Every two different v1 , v2 ∈ L1 are mapped to two
different prefixes of w1 , for otherwise one of them would be a suffix of the other,
and thus could be extended to the left which would contradict v1 , v2 ∈ L1 .
|L3 | ≤ m(n − 1), since if v ∈ L3 then v occurs on all input strings, and there
exists an input string wi such that v occurs more than once on wi . If |L3 | = k,
then |w1 | + . . . + |wm | is at least m + k. However, the added lengths of all input
strings is bounded by mn, so |L3 | ≤ mn − m.
200 M. Hutagalung and M. Lange
The literature describes two algorithms for solving the longest common substring
problem: dynamic programming [13] and the suffix tree algorithm [12]. However,
it is known that the speed and versatility of the suffix tree algorithm is better
than dynamic programming. It is therefore the state-of-the-art and standard
algorithm used for the longest common substring problem.
A suffix tree of W is a tree storing all suffixes of strings in W . It has many
applications in biological sequence data analysis [3], especially for searching pat-
terns in DNA or protein sequences. For a more detailed explanation of suffix trees
see [12]. We compare the optimised Algorithm 1 with the suffix tree algorithm
empirically on a biological data set, and also conceptually.
suffix tree data structure2 . The experiments have been run on a machine with
16 Intel Xeon cores running at 1.87GHz and 256GB of memory.
The result suggests that the optimised Algorithm 1 is comparable to the suffix
tree algorithm. The time needed is often even less than the suffix tree algorithm,
except on the data set with 5.7 mb, where the optimised Algorithm 1 was 3min
slower than the suffix tree algorithm. However, in general we can conclude that
the optimised Algorithm 1 performed well compared to the suffix tree algorithm.
Conceptual Comparison. The suffix tree algorithm builds the tree first and
then searches for the deepest node that represents the longest common substring
of all input strings. The usual approaches to building the tree are incremental
with respect to the number of the input strings [12]. For example, to build
a suffix tree of W = {w1 , . . . , wn }, one starts with a suffix tree of w1 , then
gradually modifies the tree to include the suffixes of w2 , and so on. This has the
disadvantage of not being able to see the common substrings of all w1 , . . . , wm
during the tree construction. The whole tree has to be constructed first before
searching for any common substring of w1 , . . . , wm . What can be recorded during
the tree construction is only the common substring for the first m-input strings.
Now suppose that the input data is large such that despite the linear time com-
plexity an entire run of the algorithm would still take, say, days to terminate. In
such a case it would be great if the algorithm was able to report the finding of long
common substrings on-the-fly, i.e. incrementally produce longer and longer com-
mon substrings. The suffix tree algorithm is not able to do this, because it needs to
process all input strings before finding even the shortest common substring. How-
ever it is not the case for Algorithm 1. We have seen that the algorithm always
maintains the currently longest common substring found in each iteration, and it
is able to incrementally report longer and longer common substrings rather than
finding them only at the very end of the entire computation.
References
1. Andersen, H.R.: A polyadic modal μ-calculus. Technical Report ID-TR: 1994-195,
Dept. of Computer Science, Technical University of Denmark, Copenhagen (1994)
2. Axelsson, R., Lange, M.: Model checking the first-order fragment of higher-order
fixpoint logic. In: Dershowitz, N., Voronkov, A. (eds.) LPAR 2007. LNCS (LNAI),
vol. 4790, pp. 62–76. Springer, Heidelberg (2007)
3. Bieganski, P., Riedl, J., Cartis, J.V., Retzel, E.F.: Generalized suffix trees for bio-
logical sequence data: applications and implementation. In: Proc. 27th Hawaii Int.
Conf. on System Sciences, vol. 5, pp. 35–44 (January 1994)
4. Bradfield, J., Stirling, C.: Modal mu-calculi. In: Blackburn, P., van Benthem, J.,
Wolter, F. (eds.) Handbook of Modal Logic: Studies in Logic and Practical Rea-
soning, vol. 3, pp. 721–756. Elsevier (2007)
5. Campos, R.A.C., Martı́nez, F.J.Z.: Batch source-code plagiarism detection using
an algorithm for the bounded longest common subsequence problem. In: Proc.
9th Int. IEEE Conf. on Electrical Engineering, Computing Science and Automatic
Control, CCE 2012, pp. 1–4. IEEE (2012)
6. Emerson, E.A., Clarke, E.M.: Characterizing correctness properties of parallel pro-
grams as fixpoints. In: de Bakker, J.W., van Leeuwen, J. (eds.) ICALP 1980. LNCS,
vol. 85, pp. 169–181. Springer, Heidelberg (1980)
7. Emerson, E.A., Clarke, E.M.: Using branching time temporal logic to synthesize
synchronization skeletons. Science of Computer Programming 2(3), 241–266 (1982)
8. Emerson, E.A., Halpern, J.Y.: “Sometimes” and “not never” revisited: On branch-
ing versus linear time temporal logic. Journal of the ACM 33(1), 151–178 (1986)
Model Checking for String Problems 203
9. Emerson, E.A., Jutla, C.S., Sistla, A.P.: On model checking for the μ-calculus and
its fragments. TCS 258(1-3), 491–522 (2001)
10. Fagin, R.: Generalized first-order spectra and polynomial-time recognizable sets.
Complexity and Computation 7, 43–73 (1974)
11. Gipp, B., Meuschke, N.: Citation pattern matching algorithms for citation-
based plagiarism detection: greedy citation tiling, citation chunking and longest
common citation sequence. In: Proc. 2011 ACM Symp. on Document Engineering,
pp. 249–258. ACM (2011)
12. Gusfield, D.: Algorithms on Strings, Trees, and Sequences: Computer Science and
Computational Biology. Cambridge University Press (1997)
13. Hirschberg, D.: A linear space algorithm for computing maximal common subse-
quences. Commun. ACM 18(6), 341–343 (1975)
14. Knaster, B.: Un théorèm sur les fonctions d’ensembles. Annals Soc. Pol. Math. 6,
133–134 (1928)
15. Kozen, D.: Results on the propositional μ-calculus. TCS 27, 333–354 (1983)
16. Lange, M., Lozes, E.: Model checking the higher-dimensional modal μ-calculus. In:
Proc. 8th Workshop on Fixpoints in Comp. Science, FICS 2012. Electr. Proc. in
Theor. Comp. Sc., vol. 77, pp. 39–46 (2012)
17. Oetsch, J., Pührer, J., Schwengerer, M., Tompits, H.: The system Kato: Detecting
cases of plagiarism for answer-set programs. Theory and Practice of Logic Pro-
gramming 10(4-6), 759–775 (2010)
18. Otto, M.: Bisimulation-invariant PTIME and higher-dimensional μ-calculus.
Theor. Comput. Sci. 224(1–2), 237–265 (1999)
19. Pnueli, A.: The temporal logic of programs. In: Proc. 18th Symp. on Foundations
of Comp. Science, FOCS 1977, Providence, RI, USA, pp. 46–57. IEEE (1977)
20. Queille, J.P., Sifakis, J.: Specification and verification of concurrent systems in CE-
SAR. In: Dezani-Ciancaglini, M., Montanari, U. (eds.) Programming 1982. LNCS,
vol. 137, pp. 337–371. Springer, Heidelberg (1982)
21. Storer, J.A.: Data Compression: Methods and Theory. Comp. Sci. Press (1988)
22. Sung, W.-K.: Algorithms in Bioinformatics: A Practical Approach. CRC Press
(2009)
23. Tarski, A.: A lattice-theoretical fixpoint theorem and its application. Pacific Jour-
nal of Mathematics 5, 285–309 (1955)
24. Xiao, Y., Luk, R.W.P., Wong, K.F., Kwok, K.L.: Using longest common subse-
quence matching for chinese information retrieval. Journal of Chinese Language
and Computing 15(1), 45–51 (2010)
Semiautomatic Structures
1 Introduction
General Background. An important topic in computer science and mathemat-
ics is concerned with classifying structures that can be presented in a way that
certain operations linked to the structures are computed with low computational
complexity. Automatic functions and relations can, in some sense, be considered
S. Jain was supported in part by NUS grants C252-000-087-001, R146-000-181-112
and R252-000-420-112.
B. Khoussainov is partially supported by Marsden Fund grant of the Royal Society
of New Zealand. The paper was written while B. Khoussainov was on sabbatical
leave to the National University of Singapore.
F. Stephan was supported in part by NUS grants R146-000-181-112 and R252-000-
420-112.
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 204–217, 2014.
c Springer International Publishing Switzerland 2014
Semiautomatic Structures 205
to have low complexity. The first work in this field centered on the question
which sets are regular (that is, recognised by finite automata) and how one can
transform the various descriptions of regular sets into each other. Later math-
ematicians applied the concept also to structures: Thurston automatic groups
[3] are one of the pioneering works combining automata theory with structures.
Here one has (a) a regular set of representatives A consisting of words over a
finite alphabet of generators, (b) an automatic equivalence relation representing
equality and (c) for every fixed group member y, an automatic mapping fy from
A to A such that fy (x) is a representative of the group member x ◦ y. Here a
function is automatic iff its graph can be recognised by a finite automaton or,
equivalently, iff it is computed in linear time by a one-tape Turing machine which
replaces the input by the output on the tape, starting with the same position
[1]. These concepts have been generalised to Cayley automatic groups [7,10] and
to automatic structures in general.
For automatic structures, one has to define how to represent the input to
functions that have several inputs. This is now explained in more detail. If Σ is
the alphabet used in the regular domain A ⊆ Σ ∗ of the structure, one defines
the convolution of two strings a0 a1 . . . an and b0 b1 . . . bm to consist of combined
characters c0 c1 . . . cmax{m,n} where
if k min{m, n} then ck = abkk else if m < k n then ck = a#k else
ck = b#k .
Often one identifies the rationals with the set of all pairs written as a/b with a ∈ Z
and b ∈ {1, 2, . . .}; so one identifies “one half” with each of 1/2, 2/4, 3/6, . . . and
consider all of these to be equal. Similarly, in the case that the distinction is not
relevant, the represented structure is often identified with its automatic or semi-
automatic presentation and one denotes representatives in the automatic domain
by their natural representation or vice versa and denotes the automatic functions
realising these operations with the usual notation for operations of the structure
represented.
Contributions of the Paper. First, the paper proposes the class of semiau-
tomatic structures that can be defined in terms of finite automata. This class
contains all automatic structures. Under the effectiveness condition put on semi-
automaticity, (1) these structures have finite presentations, (2) natural fragments
of their first order theories are decidable and (3) the class is wide enough to
208 S. Jain et al.
contain structures with undecidable theories. The paper provides many exam-
ples of semiautomatic structures, see Section 2.
Second, the paper provides several results of a general character. For exam-
ple, purely relational structures, countable ordinals and permutation algebras
all have semi-automatic presentations. This provides a large class of semiauto-
matic structures and showcases the power of finite automata in representation
of algebraic structures. Note that for these results, no effectivity constraints on
the semiautomaticity are made. See Section 3.
Third, the paper proves semiautomaticity for many of the classical algebraic
structures which are groups, rings and vector spaces. The main reason for this
study is that most of these structures lack automatic presentations (such as
(Q, +), (Z; , +, ·, ) and infinite fields). Therefore, it is natural to ask which of
these structures admit semiautomaticity. Many of these structures and in par-
ticular all concretely given examples are also semiautomatic
√ with the effectivity
condition. For instance, the ordered field (Q( n); +, ·, <, =) is semiautomatic
for every natural number n. There are also several counterexamples which are
not semiautomatic. These examples and counterexamples are presented in Sec-
tions 4, 5 and 6.
A full version with the omitted proofs and results is available as Research
Report 457 of the Centre for Discrete Mathematics and Theretical Computer
Science (CDMICS), The Univerity of Auckland.
The first result is a simple and general decidability result about semiautomatic
structures without relational symbols. So, let A = (A, f1 , . . . , fn ) be a semiau-
tomatic structure where each fi is an operation. An algebraic polynomial is a
unary operation g of the form f (a1 , . . . , ak , x, ak+2 , . . . , an ), where f is a basic
operation of A, and a1 , . . . , ak , ak+2 , . . . , an are parameters from A. Consider the
structure A = (A; g0 , g1 , . . .), where g0 , g1 , . . . are a complete list of all algebraic
polynomials obtained from f1 , . . . , fn . There is a close relationship between A
and A in terms of congruence relations (that is equivalence relations respected
by the basic operations):
The next examples illustrate that there are many semiautomatic structures
which are not automatic.
Example 4. Let S be the set of square numbers. Then (N, S, <, =; +) is semi-
automatic. This structure is obtained by first using a default automatic rep-
resentation (A, +, <, =) of the additive monoid of the natural numbers and
then to let B = {conv(a, b) : a, b ∈ A ∧ b a + a} be the desired struc-
ture. Here conv(a, b) represents a2 + b. One has now conv(a, b) < conv(a , b )
iff a < a ∨ (a = a ∧ b < b ). Furthermore, conv(a, b) + 1 = conv(a , b ) iff
(a = a ∧ b = b + 1 a + a) ∨ (a = a + 1 ∧ b = a + a ∧ b = 0). Iterated
addition with 1 defines the addition with any fixed natural number. Note that
(N, S, +, <, =) is not automatic.
The term algebra of a binary function f over a constant a consist of the term a
and all terms f (x, y) formed from previous terms x and y; for example f (a, a),
f (a, f (a, a)) and f (f (a, a), f (a, a)) are terms. Let T denote the set of all terms
formed using the constant a and binary function f .
represents a term y, then 012k w denotes lef tk (y) and 012k+1 w denotes rightk (y).
Note that each term starts with a 0 and thus, for each w ∈ (01∗ )∗ 0, there is a
unique term represented by w.
For the above representation, the functions lef tk and rightk are clearly au-
tomatic, as each of them just inserts the prefix 012k or 012k+1 in front of the
input. Thus, f is semiautomatic.
Let depth(a) = 0 and depth(f (x, y)) = 1+max{depth(x), depth(y)}. Now each
term y has only finitely many representations, as it can only have representations
which have at most depth(y) + 1 zeros and each lef tk or rightk used in the
representation must be a sub-term of y. Thus, = is semiautomatic.
Now, B(n) can be decided by first computing f n (w) and then checking if
M (f n (w)) accepts. This can be done in time polynomial in n and thus expo-
nential in the length of the binary representation of n. This is a contradiction,
as B was chosen not to be exponential time computable. Thus, the structure
(N, B, Succ; =) cannot be semiautomatic. Note that if the structure contains
only one of B and f , then it has to be automatic, as they are a predicate (char-
acteristic function of set) and a function with only one input variable and the
proof does not even use whether = is automatic or semiautomatic at all.
Question 10. Is there an automatic presentation of the integers such that ad-
dition and equality are automatic while the set of positive integers is not regular,
that is, the ordering of the integers is not semiautomatic?
Definition 11. A group (G, ◦) is a structure with a neutral element e such that
for all x, y, z ∈ G there is a u ∈ G satisfying x◦e = e◦x = x, x◦(y◦z) = (x◦y)◦z,
u ◦ x = e and x ◦ u = e. Such a structure without the last statements on the
existence of the inverse is called a monoid. An ordered group (G, ◦, <) satisfies
that < is transitive, antisymmetric and that all x, y, z ∈ G with x < y satisfy
x ◦ z < y ◦ z and z ◦ x < z ◦ y. If the preservation of the order holds only for
operations with z from one side, then one calls the corresponding group right-
ordered or left-ordered, respectively.
Proof. Note that there are now several members of the presentation G of the
group which are equal, for ease of notation one just writes still x ∈ G in this
case.
Semiautomatic Structures 213
Proof. Let an automatic ordered group (G, ◦, <, =) be given, as the equality
is automatic, one can without loss of generality assume that every element of
the group is given by a unique representative in G. Nies and Thomas [12,13]
showed that due to the automaticity every finitely generated subgroup (F, ◦) of
G satisfies that it is Abelian by finite. In particular every two elements v, w of F
satisfy that there is a power n with v n ◦ wn = wn ◦ v n . Now, following arguments
of Neumann [11] and Fuchs [4, page 38, Proposition 10], one argues that the
group is Abelian.
In the case that v ◦ wn = wn ◦ v, consider the element wn ◦ v ◦ w−n ◦ v −1
which is different from e; without loss of generality wn ◦ v ◦ w−n ◦ v −1 < e. By
multiplying from both sides inductively with wn ◦ v ◦ w−n and v −1 , respectively,
one gets inductively the relation (wn ◦ v ◦ w−n )m+1 ◦ v −(m+1) < (wn ◦ v ◦ w−n )m ◦
v −m < e for m = 1, 2, . . . , n and by associativity and cancellation the relation
wn ◦ v n ◦ w−n ◦ v −n < e can be derived. This contradicts the assumption that
v n and wn commute and therefore wn ◦ v n ◦ w−n ◦ v −n = e.
In the case that v ◦ wn = wn ◦ v, one again assumes that v ◦ w ◦ v −1 ◦ w−1 < e
and derives that v ◦ wn ◦ v −1 ◦ w−n < e contradicting the assumption that v
and wn commute. Hence one can derive that any two given elements v, w in G
commute and (G, ◦) is an Abelian group.
that i is odd. Thus the group is automatic. The ordering on the pairs is the
lexicographic ordering, that is, ai bj < ai bj iff i < i or i = i ∧ j < j . Using
some case distinction, one can show that ai bj < ai bj iff a ◦ ai bj < a ◦ ai bj
iff b ◦ ai bj < b ◦ ai bj and deduce from these basic relations that the group is
left-ordered.
A central motivation of Question 10 is the connection between definability and
automaticity of the order in groups. The next example shows that for some semi-
automatic groups, the order can be first-order defined from the group operation
(which is not the case with the integers). In the example one cannot have that
◦ is automatic, as the group is not commutative.
Theorem 15. There is a semiautomatic noncommutative ordered group (G, <,
=; ◦) such that the ordering is first-order definable from the group operation.
Theorem 16. The additive ordered subgroup ({n · 6m : n, m ∈ Z}, +, <) of the
rationals has a presentation in which the addition and equality are automatic
while the ordering is not semiautomatic.
Proof. The idea is to represent group elements as conv(a, b, c) representing a +
b+c where a ∈ Z, b = b1 b2 . . . bn ∈ {0}∪{0, 1}∗ ·{1} represents b1 /2+b2 /4+. . .+
bn /2n and c1 c2 . . . cm ∈ {0}∪{0, 1, 2}∗ ·{1, 2} represents c1 /3+c2/9+. . .+cm /3m .
The representation of Z is chosen such that addition is automatic. Furthermore,
now one adds conv(a, b, c) and conv(a , b , c ) by choosing conv(a , b , c ) such
that the represented values satisfy a = a + a + (b + b − b ) + (c + c − c )
and b ∈ {b + b , b + b − 1} and c ∈ {c + c , c + c − 1} and 0 b < 1 and
0 c < 1. It can be easily seen that the resulting operation is automatic.
Assume now by way of contradiction that one could compare the fractional
parts b and c of a number in order, that is, the relation {(b, c) : conv(0, b, 0) <
conv(0, 0, c)} would be automatic. Then one could first-order define a function
f which maps every ternary string c to the length-lexicographic shortest binary
string b satisfying conv(0, 0, c1) < conv(0, b, 0) < conv(0, 0, c2). There are 3n · 2
ternary strings c of length n + 1 not ending with a 0 representing different values
between 0 and 1 and f maps these to 3n · 2 different binary strings representing
values between 0 and 1; as the resulting strings are binary, some of these values
f (c) must have the length at least n · log(3)/ log(2). However, this contradicts
the fact the length of f (c) is at most a constant longer than c for all inputs
c from the domain of f (as f is first-order defined from an automatic relation
and thus automatic). Thus the function f cannot be automatic and therefore
the ordering can also not be automatic. It follows from Proposition 12 that the
order is not even semiautomatic.
Tsankov [14] showed that the structure (Q, +, =) is not automatic. However, one
can still get the following weaker representation.
Theorem 17. The ordered group (Q, <, =; +) of rationals is semiautomatic.
Theorem 18. Let G be a Baumslag Solitar group, that is, be a finitely generated
group with generators a, b and the defining relation bn a = abm for some m, n ∈
Z − {0}. Then the group (G; ◦, =) is semiautomatic.
Semiautomatic Structures 215
5 Rings
The ring of integers (Z, +, <, =; ·) is semiautomatic, the semiautomaticity of the
multiplication stems from the fact that multiplication with fixed constants can
be implemented by repeated adding or subtracting the input from 0 a fixed
number of times. One can, however, augment the ring of integers with a root of
a natural number and still preserve that addition and order are automatic and
multiplication is semiautomatic.
√
Theorem 19. The ring (Z( n), +, <, =; ·) has for every positive natural num-
ber n a semiautomatic presentation.
The next result deals with noncommutative rings where the multiplication is not
commutative and where a 1 does not need to exist.
Theorem 20. There is a ring (R, +, =, ·) such that (R, +, =) is an automatic
group and the family of functions {y → y · x : x ∈ R} is semiautomatic while
every function y → x · y with x ∈ R fixed is either constant 0 or not automatic
(independent of the automatic representation chosen for the ring).
Question 24. (a) Are the structures (Q, <, =; +, ·) or (Q, =; +, ·) semiauto-
matic? In other words, is it really needed, as done in the above default rep-
resentations, that the equality and the order are not automatic?
(b) Is the polynomial ring (Q[x]; +, ·, =) semiautomatic?
(c) Is there a transcendental field extension of the rationals which is semiauto-
matic?
The counterpart of Questions 24 (b) and (c) for finite fields has a positive answer.
Theorem 25. Let (F, +, ·) be a finite field. Then the following structures are
semiautomatic:
– Every (possibly infinite) algebraic extension (G, +, =; ·) of the field;
– The polynomial rings (F [x], +, =; ·) in one variable and (F [x, y]; +, ·, =) in
two or more variables;
– The field of fractions ({ ab : a, b ∈ F [x] ∧ b = 0}; +, ·, =) over the polynomial
ring with one variable.
7 Conclusion
The present work gives an overview on initial results on semiautomatic structures
and shows that many prominent structures (countable ordinals with addition,
the ordered fields of rationals extended perhaps by one root of an integer, al-
gebraic extensions of finite fields) are semiautomatic and investigates to which
degree one can still have that some of the involved operators and relations are
automatic. Several concrete questions are still open, in particular the following
ones: Is there an automatic presentation of the integers such that addition and
equality are automatic while the ordering of the integers is not semiautomatic?
Are the structures (Q, <, =; +, ·) or (Q, =; +, ·) semiautomatic, that is, can in the
semiautomatic field of rationals the order and the equality be made automatic?
The corresponding is possible for the additive group of rationals.
Additional questions might relate to the question of effectivity. For example,
for a given function f in some given structure, can one effectively find from the
parameter y an automaton for x → f (x, y)? While this is impossible for the most
general results in Section 3, the concrete structures in Sections 4, 5 and 6 permit
that one obtains the automata from the representatives by recursive functions.
The complexity of these functions might be investigated in subsequent work for
various structures.
Semiautomatic Structures 217
References
1. Case, J., Jain, S., Seah, S., Stephan, F.: Automatic Functions, Linear Time and
Learning. In: Cooper, S.B., Dawar, A., Löwe, B. (eds.) CiE 2012. LNCS, vol. 7318,
pp. 96–106. Springer, Heidelberg (2012)
2. Delhommé, C.: Automaticité des ordinaux et des graphes homogènes. Comptes
Rendus Mathematique 339(1), 5–10 (2004)
3. Epstein, D.B.A., Cannon, J.W., Holt, D.F., Levy, S.V.F., Paterson, M.S., Thurston,
W.P.: Word Processing in Groups. Jones and Bartlett Publishers, Boston (1992)
4. Fuchs, L.: Partially Ordered Algebraic Systems. Pergamon Press (1963)
5. Hodgson, B.R.: Décidabilité par automate fini. Annales des Sciences
Mathématiques du Québec 7(1), 39–57 (1983)
6. Hopcroft, J.E., Motwani, R., Ullman, J.D.: Introduction to Automata Theory, Lan-
guages and Computation, 3rd edn. Addison-Wesley (2007)
7. Kharlampovich, O., Khoussainov, B., Miasnikov, A.: From automatic structures to
automatic groups. CoRR abs/1107.3645 (2011)
8. Khoussainov, B., Nerode, A.: Automatic presentations of structures. In: Leivant,
D. (ed.) LCC 1994. LNCS, vol. 960, pp. 367–392. Springer, Heidelberg (1995)
9. Khoussainov, B., Rubin, S., Stephan, F.: Definability and Regularity in Automatic
Structures. In: Diekert, V., Habib, M. (eds.) STACS 2004. LNCS, vol. 2996, pp.
440–451. Springer, Heidelberg (2004)
10. Miasnikov, A., Šunić, Z.: Cayley graph automatic groups are not necessarily Cayley
graph biautomatic. In: Dediu, A.-H., Martı́n-Vide, C. (eds.) LATA 2012. LNCS,
vol. 7183, pp. 401–407. Springer, Heidelberg (2012)
11. Neumann, B.H.: On ordered groups. American Journal of Mathematics 71, 1–18
(1949)
12. Nies, A.: Describing Groups. The Bulletin of Symbolic Logic 13(3), 305–339 (2007)
13. Nies, A., Thomas, R.: FA-presentable groups and rings. Journal of Algebra 320,
569–585 (2008)
14. Tsankov, T.: The additive group of the rationals does not have an automatic pre-
sentation. The Journal of Symbolic Logic 76(4), 1341–1351 (2011)
The Query Complexity of Witness Finding
1 Introduction
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 218–231, 2014.
c Springer International Publishing Switzerland 2014
The Query Complexity of Witness Finding 219
The present paper started out as an investigation into the question whether
O(n2 ) is a tight upper bound on m(Intersection). This question arose from work of
Dell, Kabanets, van Melkebeek and Watanabe [7], who showed that the Valiant-
Vazirani Isolation Lemma is optimal among so-called black-box isolation proce-
dures:
Theorem 1 ([7]). For every distribution X on subsets of {0, 1}n , there exists
nonempty W ⊆ {0, 1}n such that P[|X ∩ W | = 1] = O(1/n).
Borrowing an idea from the proof of Theorem 1 (namely, a particular distribu-
tion on subsets of {0, 1}n), we were able to show m(Intersection) = Ω(n2 ). (Note
that Theorem 1 can be derived from this lower bound, as any black-box isolation
procedure with success probability o(1/n) would show that m(Intersection) =
o(n2 ) by the argument sketched above.) As a natural next step, we consid-
ered the class of monotone queries, that is, Q : ℘({0, 1}n) → {+, ⊥} such that
Q(W ) = + ⇒ Q(W ) = + for all W ⊆ W ⊆ {0, 1}n. Note that intersec-
tion queries are monotone, hence n ≤ m(Monotone) ≤ m(Intersection) = Θ(n2 ).
Generalizing our lower bound for intersection queries, we were able to prove the
stronger result:
Theorem 2. The monotone query complexity of witness finding, m(Monotone),
is Ω(n2 ).
We present the proof of Theorem 2 in §2. The proof uses an entropy argument,
which hinges on the threshold behavior of monotone queries (in particular, the
theorem of Bollobás and Thomason [4]).
1.2 NP Queries
Another motivation for studying Question 1 comes from a question concerning
search-to-decision reductions. In the context of SAT, a search-to-decision reduc-
tion is an algorithm which, given a boolean function ϕ(x1 , . . . , xn ), constructs a
satisfying assignment x ∈ {0, 1}n for ϕ (if one exists) using an oracle for the SAT
decision problem. The standard PNP search-to-decision reduction uses n adap-
tive deterministic queries. In the setting of nonadaptive randomized queries,
Ben-David, Chor, Goldreich and Luby [3] (using the Valiant-Vazirani Isolation
Lemma) gave a BPPNP 2
|| search-to-decision reduction with O(n ) queries. (BPP||
NP
Theorem 3 (follows from [3]). There is a BPPNP || algorithm which solves the
black-box satisfiability search problem with O(n2 ) queries.
Motivated by this connection to complexity theory, we next set our sights on
the question whether O(n2 ) is tight in Theorem 3. To fit the question into the
framework of Question 1, we define the class of NP queries as follows.
Definition 1. Informally, an NP query is a query Q given by an NP machine
M with an oracle to W where Q(W ) = M W (1n ) (i.e. Q(W ) = + ⇔ M W has
an accepting computation on input 1n ). Formally, an NP query is a sequence
Q = (Q1 , Q2 , . . . ) of queries Qn : ℘({0, 1}n) → {+, ⊥}) such that there exists a
single NP machine M () (with an unspecified oracle) where Qn (W ) = M W (1n )
for every W ⊆ {0, 1}n. An ensemble of NP queries is a sequence (Q1 , . . . , Qm )
of NP queries given by NP machines M1 , . . . , Mm which have a common upper
bound t(n) = nO(1) on their running time.
The NP query complexity of witness finding, m(NP), gives a lower bound on
the query complexity of BPPNP|| algorithms solving the black-box satisfiability
search problem. Note that NP queries and monotone queries are incomparable:
NP queries clearly need not be monotone, while it can be shown that the mono-
tone “majority” query (defined by Qmaj (W ) = + iff |W | ≥ 2n−1 ) is not an NP
query.2 Nevertheless, we show that every NP query can be well-approximated by
a monotone query (Lemma 7). Using this result together with our lower bound
for m(Monotone), we show:
Theorem 4. The NP query complexity of witness finding, m(NP), is Ω(n2 ).
Theorem 4 thus establishes the optimality of the search-to-decision reduction
of Ben-David et al. in the black-box setting. The proof is presented in §3.
The proof is presented in §4. Along the way, we show that every monotone
property defined by an intersection query has an exponentially sharp thresh-
old in the lattice of affine subspaces of {0, 1}n (Theorem 6). This raises the
question whether all monotone properties have an exponentially sharp threshold
in the affine lattice (Question 2); we note that a positive answer would imply
maffine (Monotone) = Ω(n2 ).
We now define a particular random subset W of {0, 1}n. For all 0 ≤ k ≤ n, let
Wk be the random subset of {0, 1}n containing each x ∈ {0, 1}n independently
with probability nk−n . Let k be uniformly distributed in {1, . . . , n/2}.3 Finally,
let W := Wk . (A similar distribution was considered by Dell et al. [7] in proving
3
For convenience, we assume n/2 is an integer (or an abbreviation for
n/2). For
purposes of §2, k could just as well be monotone in {1, . . . , n}. For purposes of §3, we
merely require that k be uniformly distributed in {1, . . . , n } where n ≤ n−logω(1) n.
The Query Complexity of Witness Finding 223
Using Lemma 2(3), we prove a sharp bound on the relative entropy Q(W | k)
all monotone queries Q.
n/2
H(Q(W) | k) = P[k = k] · H(Q(Wk ))
k=0
∞
2 2 |θ − k| + 1 4 i+1
n/2 n/2
24
= H(pk ) ≤ |θ−k|−1
≤ ≤ .
n n 2 n i=0 2i−1 n
k=1 k=1
Lemma 4. For every random variable z on {0, 1}n (not necessarily independent
of W),
4 1
P[z ∈ W] ≤ H(z) + n/4 .
n 2
Proof. Define S ⊆ {0, 1}n by S := {x ∈ {0, 1}n : P[z = x] ≥ 2−n/4 }. Note that
P[z ∈ W] ≤ P[z ∈
/ S] + P[S ∩ W = ∅].
(Here we used x ∈/ S ⇒ P[z = x] < 2−n/4 ⇒ log(1/P[z = x]) > n/4.) Finally,
noting that |S| ≤ 2n/4 and P[x ∈ W] < 2−n/2 for all x ∈ {0, 1}n, we have
1
P[W ∩ S = ∅] ≤ P[x ∈ W] < n/4 .
x∈S
2
i=1
where this last inequality is justified by the fact that events {(Ai ⊆ W) ∧
i−1
j=1 (Ai W)} are mutually exclusive over i ∈ {1, . . . , s}.
Now fix i which maximizes (4). We claim that
i−1
(5) P Bi ∩ W = ∅ (Ai ⊆ W) ∧ (Ai W) ≤ P[Bi ∩ W = ∅].
j=1
Stringing together (4), (5) and (6), we conclude that P[Q(W) = Q+ (W)] =
2−Ω(n) .
Using this approximation of NP queries by monotone queries, we prove:
Theorem 4. (restated) The NP query complexity of witness finding, m(NP), is
Ω(n2 ).
Proof. Let m = m(NP). By Lemma 1, there exist NP queries Q1 , . . . , Qm and a
function f : {+, ⊥}m → {0, 1}n such that
P[f (Q1 (W), . . . , Qm (W)) ∈ W | W = ∅] > 1/2.
Let Q+ +
1 , . . . , Qm be monotone queries approximating Q1 , . . . , Qm as in Lemma
7. We have
1 (W), . . . , Qm (W)) ∈ W]
P[f (Q+ +
m
≥ P[f (Q1 (W), . . . , Qm (W)) ∈ W] − P[Qi (W) = Q+
i (W)]
i=1
m
= Ω(1) − .
2Ω(n)
On the other hand, by Lemma 5,
P[f (Q+
1 (W), . . . , Qm (W)) ∈ W] ≤ O(m/n ) + o(1).
+ 2
Remark 1. We can ask a similar question with respect to the lattice Ln of linear
subspaces of {0, 1}n (we suspect that the answer is the same). Writing Pn (resp.
P2n ) for the lattice of subsets of [n] (resp. {0, 1}n), note that Ln has an ambigu-
ous status in relation to Pn and P2n : on the one hand, Ln is the “q-analogue” of
Pn ; on the other hand, Ln is a subset (in fact, a sub-meet-semilattice) of P2n . Us-
ing a q-analogue of the Kruskal-Katona Theorem due to Chowdhury and Patkos
[5], we can show that pk ≤ 2−Ω(θ/k) for all k < θ and 1 − pk ≤ 2−Ω((n−θ)/(n−k))
for all k > θ. This shows that the threshold behavior of monotone properties in
Ln scales at least like monotone properties in Pn . The linear version of Ques-
tion 2 asks whether the threshold behavior of monotone properties in Ln in fact
scales like monotone properties in P2n .
Proof. The case where k ≤ τ follows from a simple union bound. Let a1 , . . . , a2k
enumerate the elements of Ak in any order. Then
k k
2 2
|S|
pk = P[Ak ∩ S = ∅] ≤ P[ai ∈ S] = = 2−(τ −k) .
i=1 i=1
2n
The case k > τ requires a more careful argument. Let H be a uniform random
affine hyperplane (i.e. (n − 1)-dimensional subspace) in {0, 1}n. (That is, H =
An−1 .)
1
Claim 1. For all λ > 0, P |S ∩ H| ≤ ( 12 − λ)|S| ≤ 2 .
4λ |S|
Proof (Proof of Claim 1). Let Z := |S ∩ H|. We have E[Z] = |S|/2 and
E[Z2 ] = P[x ∈ H] + P[x, y ∈ H]
x∈S x,y∈S : x=y
|S| 2n−1 − 1 1
= + |S|(|S| − 1) ≤ (|S| + |S|2 ).
2 2(2 − 1)
n 4
By Chebyshev’s inequality,
Var(Z) E[Z2 ] − E[Z]2 1
P Z ≤ ( 12 − λ)|S| ≤ P |Z − E[Z]| ≤ λ|S| ≤ 2 2 = ≤ 2 .
λ |S| λ2 |S|2 4λ |S|
Claim
Claim 2. Let S ⊆ {0, 1}n, let B = An−j be a uniform random affine subspace
of {0, 1}n of co-dimension j, and let b = 2−1/4 . Then
2
+···+bj )
2j+4(1+b+b
P[B ∩ S = ∅] ≤ .
|S|
= 2(j+4)/2 + .
1 − (bj /2) |S|
2 j−1
2j+4(1+b+b +···+b ) 2
+···+bj−1 )+bj
2(j+4)/2 + ≤ 2(j+4)/2 + 2j+4(1+b+b
1 − (bj /2)
(1 + 2−(j+4)/2 )
2
+···+bj−1 )+bj
≤ 2j+4(1+b+b
2
+···+bj−1 )+bj 2−(j+4)/2
≤ 2j+4(1+b+b e
2 j−1 j
≤ 2j+4(1+b+b +···+b +b )
.
The proof is completed by combining the above inequalities. Claim
Returning to the proof of Theorem 6, we now show the case k > τ using Claim
2 as follows:
n−k
2n−k+4(1+b+···+b ) ∞
1 − pk = P[Ak ∩ S = ∅] ≤ ≤ 2τ −k+4 j=0 bj
≤ 2−(k−τ )+26 .
|S|
Therefore, max{pk , 1 − pk } ≤ 2−|τ −k|+O(1) , which completes the proof of the
theorem.
As a corollary of Theorem 6, we get:
Theorem 5. (restated) The intersection query complexity of affine witness find-
ing, maffine (Intersection), is Ω(n2 ).
Proof. We use the same information-theoretic argument as the proof of Theorem
2 in §2, except A plays the role of W and Theorem 6 plays the role of Lemma
2(3) (in particular, we require the bound H(pk ) ≤ (|τ − k| + O(1))/2|τ −k|−O(1) ,
which follows from Theorem 6).
5 Conclusion
We initiated the study of the information-theoretic witness finding problem.
For three natural classes of queries (intersection queries, monotone queries, NP
230 A. Kawachi, B. Rossman, and O. Watanabe
References
1. Alon, N., Spencer, J.: The Probablistic Method, 3rd edn. Wiley (2008)
2. Bellare, M., Goldwasser, S.: The complexity of decision versus search. SIAM Journal
on Computing 23, 97–119 (1994)
3. Ben-David, S., Chor, B., Goldreich, O., Luby, M.: On the theory of average-case
complexity. Journal of Computer and System Sciences 44(2), 193–219 (1992)
4. Bollobás, B., Thomason, A.G.: Threshold functions. Combinatorica 7(1), 35–38
(1987)
5. Chowdhury, A., Patkos, B.: Shadows and intersections in vector spaces. J. of Com-
binatorial Theory, Ser. A 117, 1095–1106 (2010)
6. Cover, T., Thomas, J.: Elements of Information Theory. Wiley Interscience, New
York (1991)
7. Dell, H., Kabanets, V., van Melkebeek, D., Watanabe, O.: Is the Valiant-Vazirani
isolation lemma improvable? In: Proc. 27th Conference on Computational Complex-
ity, pp. 10–20 (2012)
8. Valiant, L., Vazirani, V.: NP is as easy as detecting unique solutions. Theoretical
Computer Science 47, 85–93 (1986)
9. Yao, A.C.: Probabilistic computations: toward a unified measure of complexity. In:
Proc. of the 18th IEEE Sympos. on Foundations of Comput. Sci., pp. 222–227. IEEE
(1977)
The Query Complexity of Witness Finding 231
A Proof of Lemma 1
In order to apply Yao’s minimax principle [9], we express m(W, Q) in terms of
a particular matrix M . Let F be the set of functions {+, ⊥}m → {0, 1}n. Let
A := Qm × F (representing the set of deterministic witness finding algorithms).
Let W0 := W \ {∅}. Finally, let M be the A × W0 -matrix defined by
1 if f (Q1 (W ), . . . , Qm (W )) ∈ W,
M(Q1 ,...,Qm ;f ),W :=
0 otherwise.
In this context, Yao’s minimax principle states that for all random variables
W on W0 and (Q1 , . . . , Qm ; f ) on A,
min E[M(Q1 ,...,Qm ;f ),W ] ≤ max E[M(Q1 ,...,Qm ;f ),W ].
(Q1 ,...,Qm ;f )∈A W ∈W0
B Proof of Lemma 2
For inequality (1), let Y1 , . . . , Y2i be independent copies of Wθ−i . Note that
i
P[x ∈ (Y1 ∪ · · · ∪ Y2i )] = 1 − (1 − 2θ−i−n )2 < 2θ−n = P[w ∈ Wθ ]
independently for all x ∈ {0, 1}n. Therefore, by monotonicity,
P[Q(Y1 ) ∨ · · · ∨ Q(Y2i )] ≤ P[Q(Y1 ∪ · · · ∪ Y2i )] ≤ P[Q(Wθ )].
Using independence of Y1 , . . . , Y2i , we have
2i i i
1/2 ≥ P[Q(Wθ )] ≥ P[ j=1 Q(Yj )] = 1 − P[¬Q(Wθ−i )]2 = 1 − (1 − pθ−i )2 .
i
Therefore, pθ−i ≤ 1 − (1/2)1/2 < (ln 2)/2i .
For inequality (2), let Z1 , . . . , Z2i be independent copies of Wθ+1 . By a similar
argument, we have
i i 1
pθ+i+1 = P[Q(Wθ+i+1 )] ≥ P[ 2j=1 Q(Zj )] = 1 − P[¬Q(Wθ+1 )]2 > 1 − 2i .
2
Finally, for inequality (3), note that for all p, q ∈ [0, 1],
0 ≤ min(p, 1 − p) ≤ q ≤ 1/2 =⇒ H(p) ≤ H(q) ≤ 2q log(1/q).
By this observation, together with (1) and (2), we have
ln 2 2i+1 i+2 1 i 1
H(pθ−i−1 ) ≤ 2 log( )< , H(pθ+i+1 ) ≤ 2 log(22 ) = 2i −i−1 .
2 i+1 ln 2 2i 22i 2
From these two inequalities, it follows that H(pk ) ≤ (|θ − k| + 1)/2|θ−k|−1 .
Primal Implication as Encryption
Vladimir N. Krupski
1 Introduction
Primal Infon Logic ([1], [2], [3], [4], [5]) formalizes the concept of infon, i.e.
a message as a piece of information. The corresponding derivability statement
Γ / ϕ means that the principal can get (by herself, without any communication)
the information ϕ provided she already has all infons ψ ∈ Γ .
Primal implication (→p ) that is used in Primal Infon Logic to represent the
conditional information is a restricted form of intuitionistic implication defined
by the following inference rules:
Γ /ψ Γ / ϕ Γ / ϕ →p ψ
(→p I) , (→p E) .
Γ / ϕ →p ψ Γ /ψ
These rules admit cryptographic interpretation of primal implication ϕ →p ψ
as some kind of digital envelop: it is an infon, containing the information ψ
encrypted by a symmetric key (generated from) ϕ. Indeed, the introduction
rule (→p I) allows to encrypt any available message by any key. Similarly, the
elimination rule (→p E) allows to extract the information from the ciphertext
provided the key is also available. So the infon logic incorporated into commu-
nication protocols ([1], [2]) is a natural tool for manipulating with commitment
schemes (see [7]) without detailed analysis of the scheme itself.
Example. (cf. [8]). Alice and Bob live in different places and communicate via a
telephone line or by e-mail. They wish to play the following game distantly. Each
of them picks a bit, randomly or somehow else. If the bits coincide then Alice
wins; otherwise Bob wins. Both of them decide to play fair but don’t believe
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 232–244, 2014.
c Springer International Publishing Switzerland 2014
Primal Implication as Encryption 233
in the fairness of the opponent. To play fair means that they honestly declare
their choice of a bit, independently of what the other player said. So they use
cryptography.
We discuss the symmetric version of the coin flipping protocol from [8] in
order to make the policies of both players the same. Consider the policy of one
player, say Alice. Her initial state can be represented by the context
Γ = {A said ma , A said ka , A IsTrustedOn ma , A IsTrustedOn ka },
where infons ma and ka represent the chosen bit and the key Alice intends to
use for encryption. Her choice is recorded by infons A said ma and A said ka
where A said is the quotation modality governed by the modal logic K.1 Alice
simply says, to herself, the infons ma and ka .
The remaining two members of Γ reflect the decision to play fair. The infon
X IsTrustedOn y abbreviates (X said y) →p y. It provides the ability to obtain
the actual value of y from the declaration X said y, so Alice can deduce the
actual ma and ka she has spoken about.
The commit phase. Alice derives ma and ka →p ma from her context by rules
(→p E), (→p I) and sends the infon ka →p ma to Bob. Bob acts similarly, so
Alice will receive a message from him and her context will be extended to
Γ = Γ ∪ {B said (kb →p mb )}.
The reveal phase. After updating the context Alice obtains ka by rule (→p E)
and sends it to Bob. He does the same, so Alice’s context will be
Γ = Γ ∪ { B said kb }.
Now by reasoning in K Alice deduces B said mb . She also has A said ma , so it
is clear to her who wins. Alice simply compares these infons with the patterns
B said 0, B said 1 and A said 0, A said 1 respectively.
The standard analysis of the protocol shows that Bob will come to the same
conclusion. Moreover, Alice can be sure that she is not cheated provided she
successively follows her policy up to the end.2 The same with Bob.
Note that infon logic is used here as a part of the protocol. It is one of the
tools that provide the correctness. But it does not prove the correctness. In order
to formalize and prove the correctness of protocols one should use much more
powerful formal systems.
In Section 2 this is done for the system P which is the {+, ∧, →p }-fragment
of infon logic. We also show that the quasi-boolean semantics for P (see [4]) is
essentially a special case of our semantics.
In Section 3 we show that ⊥ can be used to reflect some backdoor construc-
tions. Two variants are considered: system P[⊥] from [4] with the usual elimi-
nation rule for ⊥ and a new system P[⊥w ] with a weak form of elimination rule
for ⊥. The first one treats ⊥ as a root password, and the second one — as a
universal key for decryption. For almost all propositional primal infon logics the
derivability problem has linear time complexity. We prove the same complexity
bound for P[⊥w ] in Section 4.
Finally we consider a system P[∨p ] which is the modal-free fragment of Basic
Propositional Primal Infon Logic PPIL from [5]. The primal disjunction ∨p in
P[∨p ] has usual introduction rules and no elimination rules. We treat it as a
group-key constructor and provide a linear time reduction of P[⊥w ] to P[∨p ]. It
thus gives another proof of linear time complexity bound for P[⊥w ].
binary strings,
l(π(x, y)) = x, r(π(x, y)) = y, (1)
and two functions enc, dec : (Σ ∗ )2 → Σ ∗ such that enc is total and
Γ /ϕ Γ / ϕ1 Γ, ϕ1 / ϕ2
(Weakening) (Cut )
/+ ϕ/ϕ Γ, Δ / ϕ Γ / ϕ2
Γ / ϕ1 Γ / ϕ2 Γ / ϕ1 ∧ ϕ2
(∧I) (∧Ei ) (i = 1, 2)
Γ / ϕ1 ∧ ϕ2 Γ / ϕi
Γ / ϕ2 Γ / ϕ1 Γ / ϕ1 →p ϕ2
(→p I) (→p E) .
Γ / ϕ1 →p ϕ2 Γ / ϕ2
Here ϕ, ϕ1 , ϕ2 are infons, i.e. the expressions constructed from the set At of
atomic infons by the grammar
ϕ ::= + | At | (ϕ ∧ ϕ) | (ϕ →p ϕ),
v(Γ ) = {v(ϕ) | ϕ ∈ Γ }.
A model is a pair I, M where I is an interpretation and M ⊆ Σ ∗ is a closed
set.
In the paper [4] it is established that P is sound and complete with respect
to quasi-boolean semantics. A quasi-boolean model is a validity relation |= that
enjoys the following properties:
– |= +,
– |= ϕ1 ∧ ϕ2 ⇔ |= ϕ1 and |= ϕ2 ,
– |= ϕ2 ⇒ |= ϕ1 →p ϕ2 ,
– |= ϕ1 →p ϕ2 ⇒ |= ϕ1 or |= ϕ2 .
π(x, y) = ( x ∧ y ) , enc(x, y) = ( x →p y ) , E = {+}. (3)
Projections and the decryption function can be found from (1) and (2). Note
that for this interpretation the equality v(ϕ) = ϕ holds for every infon ϕ.
Consider a quasi-boolean model |=. Let M be the closure of the set M0 =
{ϕ ||= ϕ}, i.e. the least closed extension of M0 .
Lemma 3. |= ϕ iff v(ϕ) ∈ M .
Proof. It is sufficient to prove that the set M \ M0 does not contain words of
the form v(ϕ). Any element b ∈ M \ M0 can be obtained from some elements of
M0 by a finite sequence of steps 1,2,3 that correspond to closure conditions:
Proof. The theorem states that the infon logic P is sound and complete with
respect to the class of models introduced by Definition 2. The soundness can be
proven by straightforward induction on the derivation of ϕ from Γ . The com-
pleteness follows from Lemma 3 and the completeness result for quasi-boolean
models (see [4]).
Theorem 6. Let the interpretation I = A, v be plain. For any context Γ there
exists a model I, M with v(Γ ) ⊆ M such that Γ / ϕ implies v(ϕ) ∈ M for all
infons ϕ.
Proof. Let M be the closure of the set M0 = {v(ψ) | Γ / ψ}. Then v(Γ ) ⊆ M .
The set M0 is deductively closed, so M \ M0 does not contain strings of the form
v(ψ). Suppose Γ / ϕ. Then v(ϕ) ∈ M0 because the interpretation is injective.
Thus v(ϕ) ∈ M .
238 V.N. Krupski
⊥ as Universal Key
The root password provides the direct access to all the information in the system
including private information of any agent that was never sent to anybody else.
It is also natural to consider a restricted form of superuser permissions that
protect the privacy of agents but provide the ability to decrypt any available
ciphertext. It can be simulated by infon logic P[⊥w ] with constant ⊥ treated as
a universal key. The corresponding inference rule is a weak form of (⊥E) rule,
Γ /⊥ Γ / ϕ →p ψ
(⊥Ew ),
Γ /ψ
that has an additional premise Γ / ϕ →p ψ. So the owner of ⊥ can get an infon
only if she already has the same information as a ciphertext. The rule (⊥Ew ) is
really weaker than (⊥E) because ψ →p ψ is not derivable in P.
All definitions concerning models for P[⊥w ] are similar to the case of P[⊥]
with closure condition 4 replaced by
4 . f , enc(a, b) ∈ M ⇒ b ∈ M .
Essentially we extend the signature of infon algebras by additional (partial)
operation crack (x, y) that satisfies the equality
crack (f , enc(a, b)) = b (4)
and allow any agent to use it, so her local state satisfies the closure condition 4 .
Primal Implication as Encryption 239
Lemma 7. There exist plain interpretations for P[⊥] and for P[⊥w ].
It satisfies the condition (4), so the interpretation for P[⊥w ] is defined. One can
prove in a similar way that the interpretation is plain (w.r.t. P[⊥w ] ).
The completeness results from Section 2 hold for logics P[⊥] and P[⊥w ] too.
The proofs are essentially the same with one difference: the quasi-boolean se-
mantics from [4] does not cover the case of P[⊥w ]. Let L be one of the logics
P[⊥] or P[⊥w ].
Definition 10. (Positive atoms.) In what follows we assume that the language
of P also contains ⊥, but it is an ordinary member of At without any specific
inference rule for it. Let
At+ (ϕ) = {ϕ} for ϕ ∈ At ∪ {+, ⊥},
At+ (ϕ ∧ ψ) = At+ (ϕ) ∪ At+ (ψ),
At+ (ϕ →p ψ) = At+ (ψ).
For a context Γ set At+ (Γ ) = ϕ∈Γ At+ (ϕ).
The decision algorithm for P[⊥w ] consists of the following three steps:
1. Test whether Γ / ϕ in P. If yes, then Γ / ϕ in P[⊥w ] too. Else go to step 2.
2. Test whether Γ / ⊥ in P. If yes, then Γ / ϕ in P[⊥w ] by Lemma 12. Else
go to step 3.
3. We have Γ / ⊥ in P, so it is also true in P[⊥w ]. Test the condition At+ (ϕ) ⊆
At+ (Γ ). If it is fulfilled then Γ / ϕ in P[⊥w ]; otherwise Γ / ϕ in P[⊥w ]
(Lemma 11).
Primal Implication as Encryption 241
Linear time complexity bounds for steps 1,2 follow from the linear bound for
P. In order to prove the same bound for step 3 we use the preprocessing stage
of the linear time decision algorithm from [5]. It deals with sequents Γ / ϕ in a
language that extends the language of P[⊥w ]. The preprocessing stage is purely
syntactic, so it does not depend on the logic involved and can be used for P[⊥w ]
as well.
The algorithm constructs the parse tree for the sequent. Two nodes are
called homonyms if they represent two occurrences of the same infon. For every
homonymy class, the algorithm chooses a single element of it, the homonymy
leader, and labels all nodes with pointers that provide a constant time access
from a node to its homonymy leader. All this can be done in linear time (see
[5]).
Now it takes a single walk through the parse tree to mark by a special flag
all homonymy leaders that correspond to infons ψ ∈ At+ (Γ ). One more walk is
required to test whether all homonymy leaders that correspond to ψ ∈ At+ (ϕ)
already have this flag. Thus we have a linear time test for the inclusion At+ (ϕ) ⊆
At+ (Γ ).
Theorem 13. The derivability problem for infon logic P[⊥w ] is linear time de-
cidable.
Primal infon logic with disjunction P[∨] was studied in [4]. It is defined by all
rules of P and usual introduction and elimination rules for disjunction. P[∨]
can emulate the classical propositional logic, so the derivability problem for it is
co-NP-complete.
Here we consider the logic P[∨p ], an efficient variant of P[∨]. It was mentioned
in [4] and later was incorporated into Basic Propositional Primal Infon Logic
PPIL [5] as its purely propositional fragment without modalities. In P[∨p ] the
standard disjunction is replaced by a “primal” disjunction ∨p with introduction
rules
Γ / ϕi
(∨p Ii ) (i = 1, 2)
Γ / ϕ1 ∨p ϕ2
and without elimination rules. It results in a linear-time complexity bound for
P[∨p ] (and for PPIL too, see [4],[5]).
When the primal implication is treated as encryption, the primal disjunction
can be used as a method to construct group keys. An infon of the form
(ϕ1 ∨p ϕ2 ) →p ψ (5)
represents a ciphertext that can be decrypted by anyone who has at least one of
the keys ϕ1 or ϕ2 . In P the same effect can be produced by the infon
P[⊥w ] is linear-time reducible to P[∨p ], so P[∨p ] and PPIL can emulate the
backdoor based on a universal key. The reduction also gives another proof for
Theorem 13.
Remember that in the language of P[∨p ] symbol ⊥ denotes some regular
atomic infon. Consider the following translation:
Proof. Part “only if” can be proved by straightforward induction on the deriva-
tion of ϕ from assumptions Γ in P[⊥w ]. For any inference rule of P[⊥w ], its
translation is derivable in P[∨p ]. For example, consider the elimination rules for
→p and ⊥:
ϕ∗ ⊥
⊥ ∨p ϕ ∗
⊥ ∨p ϕ ∗
→p ψ ∗
⊥ ∨p ϕ∗ ⊥ ∨p ϕ∗ →p ψ ∗
, .
ψ∗ ψ∗
Part “if”. Let Γ ∗ / ϕ∗ in P[∨p ]. Note that P[∨p ] is the modal-free fragment
of PPIL and the shortest derivation of ϕ∗ from assumptions Γ ∗ in PPIL is also
a derivation in P[∨p ]. Let D be this derivation.
It is proved in [5] that any shortest derivation is local. For the case of P[∨p ]
it means that all formulas from D are subformulas of Γ ∗ , ϕ∗ . In particular, ∨p
occurs in D only in subformulas of the form ⊥ ∨p θ∗ .
Case 1. Suppose that the (∨p I1 ) rule is never used in D. Remove part “⊥∨p ”
from every subformula of the form ⊥ ∨p ψ that occurs in D. This transformation
Primal Implication as Encryption 243
eliminates ∨p and makes all steps correspondent to (∨p I2 ) rule trivial. The result
will be a derivation of ϕ from assumptions Γ in P. So Γ / ϕ in P[⊥w ] too.
Case 2. Suppose that the (∨p I1 ) rule is used in D. It has the form
⊥
, (7)
⊥ ∨p θ∗
so At+ (ψ) is defined for every ψ in the language of P[∨p ]. Moreover, At+ (ϕ∗ ) =
At+ (ϕ) and At+ (Γ ∗ ) = At+ (Γ ). We claim that At+ (ϕ∗ ) ⊆ At+ (Γ ∗ ).
Indeed, consider D as a proof tree and its node ψ with At+ (ψ) ⊆ At+ (Γ ∗ )
whereas At+ (ψ ) ⊆ At+ (Γ ∗ ) holds for all predecessors ψ . The only rule that
can produce this effect is (7), so ψ = ⊥ ∨p θ∗ for some θ where all occurrences
of “new” atoms q ∈ At+ (ψ) \ At+ (Γ ∗ ) are inside θ∗ .
Consider the path from the node ψ to the root node ϕ∗ and the trace of ψ
along it. There is no elimination rule for ∨p , so ψ cannot be broken into pieces.
All occurrences of positive atoms in θ∗ will be positive in all formulas along the
trace. But ∨p occurs in ϕ∗ only in the premise of primal implication, so the trace
does not reach the root node. Thus, at some step the formula containing ψ will
be eliminated and “new” atoms from θ∗ will never appear in At+ (ϕ∗ ):
⊥
⊥ ∨p θ∗
· ·
· ·
· ·
η1 [⊥ ∨p θ∗ ] η1 [⊥ ∨p θ∗ ] →p η2
η2
References
1. Gurevich, Y., Neeman, I.: DKAL: Distributed-Knowledge Authorization Language.
In: Proc. of CSF 2008, pp. 149–162. IEEE Computer Society (2008)
2. Gurevich, Y., Neeman, I.: DKAL 2 — A Simplified and Improved Authorization
Language. Technical Report MSR-TR-2009-11, Microsoft Research (February 2009)
3. Gurevich, Y., Neeman, I.: Logic of infons: the propositional case. ACM Transactions
on Computational Logic 12(2) (2011)
4. Beklemishev, L., Gurevich, Y.: Propositional primal logic with disjunction. J. of
Logic and Computation 22, 26 pages (2012)
5. Cotrini, C., Gurevich, Y.: Basic primal infon logic. Microsoft Research Technical
Report MSR-TR-2012-88, Microsoft Research (August 2012)
6. Troelstra, A., Schwichtenberg, H.: Basic proof theory. Cambridge Tracts in Theo-
retical Computer Science, vol. 43. Cambridge University Press, Cambridge (1996)
7. Goldreich, O.: Foundations of Cryptography: Volume 1, Basic Tools. Cambridge
University Press, Cambridge (2001)
8. Blum, M.: Coin Flipping by Telephone. In: Proceedings of CRYPTO, pp. 11–15
(1981)
Processing Succinct Matrices and Vectors
1 Introduction
Algorithms that work on a succinct representation of certain objects can nowadays be
found in many areas of computer science. A paradigmatic example is the use of OBDDs
(ordered binary decision diagrams) in hardware verification [5,21]. OBDDs are a suc-
cinct representation of Boolean functions. Consider a boolean function f (x1 , . . . , xn )
in n input variables. One can represent f by its decision tree, which is a full binary tree
of height n with {0, 1}-labelled leaves. The leaf that is reached from the root via the
path (a1 , . . . , an ) ∈ {0, 1}n (where ai = 0 means that we descend to the left child
in the i-th step, and ai = 1 means that we descend to the right child in the i-th step)
is labelled with the bit f (a1 , . . . , an ). This decision tree can be folded into a directed
acyclic graph by eliminating repeated occurrences of isomorphic subtrees. The result is
the OBDD for f with respect to the variable ordering x1 , . . . , xn .1 Bryant was the first
who realized that OBDDs are an adequate tool in order to handle the state explosion
problem in hardware verification [5].
OBDDs can be also used for storing large graphs. A graph G with 2n nodes and ad-
jacency matrix MG can be represented by the boolean function fG (x1 , y1 , . . . , xn , yn ),
where fG (a1 , b1 , . . . , an , bn ) is the entry of MG at position (a, b); here a1 · · · an (resp.,
The first (second) author is supported by the DFG grant LO 748/8-2 (SCHM 986/9-2).
1
Here, we are cheating a bit: In OBDDs a second elimination rule is applied that removes
nodes for which the left and right child are identical. On the other hand, it is known that
asymptotically the compression achieved by this elimination rule is negligible [31].
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 245–258, 2014.
c Springer International Publishing Switzerland 2014
246 M. Lohrey and M. Schmidt-Schauß
b1 · · · bn ) is the binary representation of the index a (resp. b). Note that we use the so
called interleaved variable ordering here, where the bits of the two coordinates a and
b are bitwise interleaved. This ordering turned out to be convenient in the context of
OBDD-based graph representation, see e.g. [10].
Classical graph problems (like reachability, alternating reachability, existence of a
Hamiltonian cycle) have been studied for OBDD-represented graphs in [9,30]. It turned
out that these problems are exponentially harder for OBDD-represented graphs than for
explicitly given graphs. In [30] an upgrading theorem for OBDD-represented graphs
was shown. It roughly states that completeness of a problem A for a complexity class
C under quantifier free reductions implies completeness of the OBDD-variant of A for
the exponentially harder version of C under polynomial time reductions.
In the same way as OBDDs represent boolean mappings, functions from {0, 1}n to
any set S can be represented. One simply has to label the leaves of the decision tree
with elements from S. This yields multi-terminal decision diagrams (MTDDs) [11]. Of
particular interest is the case, where S is a semiring, e.g. N or Z. In the same way as
an adjacency matrix (i.e., a boolean matrix) of dimension 2n can be represented by an
OBDD, a matrix of dimension 2n over any semiring can be represented by an MTDD.
As for OBDDs, we assume that the bits of the two coordinates a and b are interleaved
in the order a1 , b1 , . . . , an , bn . This implies that an MTDD can be viewed as a set of
rules of the form
A1,1 A1,2
A→ or B → a with a ∈ S. (1)
A2,1 A2,2
where A, A1,1 , A1,2 , A2,1 , and A2,2 are variables that correspond to certain nodes of
the MTDD (namely those nodes that have even distance from the root node). Every
variable produces a matrix of dimension 2h for some h ≥ 0, which we call the height
of the variable. The variables Ai,j in (1) must have the same height h, and A has height
h + 1. The variable B has height 0. We assume that the additive monoid of the semiring
S is finitely generated, hence every a ∈ S has a finite representation.
MTDDs yield very compact representations of sparse matrices. It was shown that
an (n × n)-matrix with m nonzero entries can be represented by an MTDD of size
O(m log n) [11, Thm. 3.2], which is better than standard succinct representations for
sparse matrices. Moreover, MTDDs can also yield very compact representations of non-
sparse matrices. For instance, the Walsh matrix of dimension 2n can be represented by
an MTDD of size O(n), see [11]. In fact, the usual definition of the n-th Walsh matrix
is exactly an MTDD. Matrix algorithms for MTDDs are studied in [11] as well, but no
precise complexity analysis is carried out. In fact, the straightforward matrix multiplica-
tion algorithm for multi-terminal decision diagrams from [11] has an exponential worst
case running time, and this is unavoidable: The smallest MTDD that produces the prod-
uct of two MTDD-represented matrices may be of exponential size in the two MTDDs,
see Thm. 2. The first main contribution of this paper is a generalization of MTDDs that
overcomes this deficiency: An MTDD+ consists of rules of the form (1) together with
addition rules of the form A → B + C, where “+” refers to matrix addition over the un-
derlying semiring. Here, A, B, and C must have the same height, i.e., produce matrices
of the same dimension. We show that an MTDD+ for the product of two MTDD+ -
represented matrices can be computed in polynomial time (Thm. 3). In Sec. 4.1 we also
Processing Succinct Matrices and Vectors 247
present efficient (polynomial time) algorithms for several other important matrix prob-
lems on MTDD+ -represented input matrices: computation of a specific matrix entry,
computation of the trace, matrix transposition, tensor and Hadamard product. Sec. 5
deals with equality checking. It turns out that equality of MTDD+ -represented matri-
ces can be checked in polynomial time, if the additive monoid is cancellative, in all
other cases equality checking is coNP-complete.
To the knowledge of the authors, complexity results similar to those from [9,30] for
OBDDs do not exist in the literature on MTDDs. Our second main contribution fills this
gap. We prove that already for MTDDs over Z it is PSPACE-complete to check whether
the determinant of the generated matrix is zero (Thm. 6). This result is shown by lifting
a classical construction of Toda [27] (showing that computing the determinant of an ex-
plicitly given integer matrix is complete for the counting class GapL) to configuration
graphs of polynomial space bounded Turing machines, which are of exponential size.
It turns out that the adjacency matrix of the configuration graph of a polynomial space
bounded Turing machine can be produced by a small MTDD. Thm. 6 sharpens a recent
result from [14] stating that it is PSPACE-complete to check whether the determinant of
a matrix that is represented by a boolean circuit (see Sec. 4.2) vanishes. We also prove
several hardness results for counting classes. For instance, computing a specific entry
of a matrix power An , where A is given by an MTDD over N is #P-complete (resp.
#PSPACE-complete) if n is given unary (resp. binary). Here, #P (resp. #PSPACE) is
the class of functions counting the number of accepting computations of a nondetermin-
istic polynomial time Turing machine [29] (resp., a nondeterministic polynomial space
Turing machine [15]). An example of a natural #PSPACE-complete counting problem
is counting the number of strings not accepted by a given NFA [15].
2 Related Work
Sparse Matrices and Quad-Trees. To the knowledge of the authors, most of the litera-
ture on matrix compression deals with sparse matrices, where most of the matrix entries
are zero. There are several succinct representations of sparse matrices. One of which are
quad-trees, used in computer graphics for the representation of large constant areas in
2-dimensional pictures, see for example [24,8]. Actually, an MTDD can be seen as a
quad-tree that is folded into a dag by merging identical subtrees.
pictures if they have the same height) and vertical composition (which is defined for
two pictures if they have the same width). This formalism does not share all the nice al-
gorithmic properties of (1-dimensional) SLPs [3]: Testing whether two 2SLPs produce
the same picture is only known to be in coRP (co-randomized polynomial time). More-
over, checking whether an explicitly given (resp., 2SLP-represented) picture appears
within a 2SLP-represented picture is NP-complete (resp., Σ2P -complete). Related hard-
ness results in this direction concern the convolution of two SLP-represented strings
of the same length (which can be seen as a picture of height 2). The convolution of
strings u = a1 · · · an and v = b1 · · · bn is the string (a1 , b1 ) · · · (an , bn ). By a result
from [4] (which is stated in terms of the related operation of literal shuffle), the size
of a shortest SLP for the convolution of two strings that are given by SLPs G and H
may be exponential in the size of G and H. Moreover, it is PSPACE-complete to check
for two SLP-represented strings u and v and an NFA T operating on strings of pairs of
symbols, whether T accepts the convolution of u and v [17].
MTDDs restrict 2SLPs by forbidding unbalanced derivation trees. The derivation
tree of an MTDD results from unfolding the rules in (1); it is a tree, where every non-
leaf node has exactly four children and every root-leaf path has the same length.
Tensor Circuits. In [2,7], the authors investigated the problems of evaluating tensor
formulas and tensor circuits. Let us restrict to the latter. A tensor circuit is a circuit
where the gates evaluate to matrices over a semiring and the following operations are
used: matrix addition, matrix multiplication, and tensor product. Recall that the tensor
product of two matrices A = (ai,j )1≤i≤m,1≤i≤m and B is the matrix
⎛ ⎞
a1,1 B · · · a1,m B
⎜ .. ⎟
A ⊗ B = ⎝ ... . ⎠
an,1 B · · · an,m B
It is a (mk × nl)-matrix if B is a (k × l)-matrix. In [2] it is shown among other results
that computing the output value of a scalar tensor circuit (i.e., a tensor circuit that yields
a (1 × 1)-matrix) over the natural numbers is complete for the counting class #EXP.
An MTDD+ over Z can be seen as a tensor circuit that (i) does not use matrix multi-
plication and (ii) where for every tensor product the left factor is a (2 × 2)-matrix. To
see the correspondence, note that
A1,1 A1,2 10 01 00 00
= ⊗A1,1 + ⊗A1,2 + ⊗A2,1 + ⊗A2,2
A2,1 A2,2 00 00 10 01
a1,1 a1,2 a1,1 B a1,2 B
⊗B =
a2,1 a2,2 a2,1 B a2,2 B
Each of the matrices ai,j B can be generated from B and −B using log |ai,j | many
additions (here we use the fact that the underlying semiring is Z).
3 Preliminaries
We consider matrices over a semiring (S, +, ·) with (S, +) a finitely generated commu-
tative monoid with unit 0. The unit of the monoid (S, ·) is 1. We assume that 0 · a =
Processing Succinct Matrices and Vectors 249
a·0 = 0 for all a ∈ S. Hence, if |S| > 1, then 1 = 0 (0 = 1 implies a = 1·a = 0·a = 0
for all a ∈ S). With S n×n we denote the set of all (n × n)-matrices over S.
All time bounds in this paper implicitly refer to the RAM model of computation with
a logarithmic cost measure for arithmetical operations on integers, where arithmetic
operations on n-bit numbers need time O(n). For a number n ∈ Z let us denote with
bin(n) its binary encoding.
We assume that the reader has some basic background in complexity theory, in par-
ticular we assume that the reader is familiar with the classes NP, coNP, and PSPACE. A
function f : {0, 1}∗ → {0, 1}∗ belongs to the class FSPACE(s(n)) (resp. FTIME(s(n)))
if f can be computed on a deterministic Turing machine in space (resp., time) s(n).2 As
usual, only the space on the working tapes is counted. Moreover, the output is written
from left to right on the output tape, i.e., in each step the machine either outputs a new
symbol on the output tape, in which case the output head moves one cell to the right,
or the machine does not output a new symbol in which case the output head does not
move. Let FP = k≥1 FTIME(nk ) and FPSPACE = k≥1 FSPACE(nk ). Note that
for a function f ∈ FPSPACE we have |f (w)| ≤ 2|w|
O(1)
for every input.
The counting class #P consists of all functions f : {0, 1}∗ → N for which there
exists a nondeterministic polynomial time Turing machine M with input alphabet Σ
such that for all x ∈ Σ ∗ , f (x) is the number of accepting computation paths of M for
input x. If we replace nondeterministic polynomial time Turing machines by nonde-
terministic polynomial space Turing machines (resp. nondeterministic logspace Turing
machines), we obtain the class #PSPACE [15] (resp. #L [1]). Note that for a map-
ping f ∈ #PSPACE, the number f (x) may grow doubly exponential in |x|, whereas
for f ∈ #P, the number f (x) is bounded singly exponential in |x|. Ladner [15] has
shown that a mapping f : Σ ∗ → N belongs to #PSPACE if and only if the map-
ping x → bin(f (x)) belongs to FPSPACE. One cannot expect a corresponding re-
sult for the class #P: If for every function f ∈ #P the mapping x → bin(f (x))
belongs to FP, then by Toda’s theorem [28] the polynomial time hierarchy collapses
down to P. For f ∈ #L, the mapping x → bin(f (x)) belongs to NC2 and hence to
FP∩FSPACE(log2 (n)) [1, Thm. 4.1]. The class GapL (resp., GapP, GapPSPACE) con-
sists of all differences of two functions in #L (resp., #P, #PSPACE). From Ladner’s
result [15] it follows easily that a function f : {0, 1}∗ → Z belongs to GapPSPACE if
and only if the mapping x → bin(f (x)) belongs to FPSPACE, see also [12, Thm. 6].
Logspace reductions between functions can be defined analogously to the language
case: If f, g : {0, 1}∗ → X with X ∈ {N, Z}, then f is logspace reducible to g if there
exists a function h ∈ FSPACE(log n) such that f (x) = g(h(x)) for all x. Toda [27] has
shown that computing the determinant of a given integer matrix is GapL-complete.
Fix a semiring (S, +, ·) with (S, +) a finitely generated commutative monoid, and let
Γ ⊆ S be afinite generating set for (S, +). Thus, every element of S can be written as a
finite sum a∈Γ na a with na ∈ N. A multi-terminal decision diagram G with addition
(MTDD+ ) of height h is a triple (N, P, A0 ), where N is a finite set of variables which
is partitioned into non-empty sets Ni (0 ≤ i ≤ h), Nh = {A0 } (A0 is called the start
variable), and P is a set of rules of the following three forms:
A1,1 A1,2
– A → with A ∈ Ni and A1,1 , A1,2 , A2,1 , A2,2 ∈ Ni−1 for some
A2,1 A2,2
1≤i≤h
– A → A1 + A2 with A, A1 , A2 ∈ Ni for some 0 ≤ i ≤ h
– A → a with A ∈ N0 and a ∈ Γ ∪ {0}
Moreover, for every variable A ∈ N there is exactly one rule with left-hand side A,
and the relation {(A, B) ∈ N × N | B occurs in the right-hand side for A} is acyclic.
If A ∈ Ni then we say that A has height i. The MTDD+ G is called an MTDD if for
every addition rule (A → A1 + A2 ) ∈ P we have A, A1 , A2 ∈ N0 . In other words,
only scalars are allowed to be added. Since we assume that (S, +) is generated by Γ ,
this allows to produce arbitrary elements of S as matrix entries. For every A ∈ Ni
we define a square matrix val(A) of dimension 2i in the obvious way by unfolding
the rules. Moreover, let val(G) = val(A0 ) for the start variable A0 of G. This is a
(2h × 2h )-matrix. The size of a rule A → a with a ∈ Γ ∪ {0} is 1, all other rules
have size log |N |. The size |G| of the MTDD+ G is the sum of the sizes of its rules;
this is up to constant factors the length of the binary coding of G. An MTDD+ G of
size n log n can represent a (2n × 2n )-matrix. Note that only square matrices whose
dimension is a power of 2 can be represented. Matrices not fitting this format can be
filled up appropriately, depending on the purpose.
An MTDD, where all rules have the form A → a ∈ Γ ∪{0} or A → B +C generates
an element of the semiring S. Such an MTDD is an arithmetic circuit in which only
input gates and addition gates are used, and is called a +-circuit in the following. In
case the underlying semiring is Z, a +-circuit with n variables can produce a number of
size 2n , and the binary encoding of this number can be computed in time O(n2 ) from
the +-circuit (since, we need n additions of numbers with at most n bits). In general, for
a +-circuitover the semiring S, we can compute in quadratic time numbers na (a ∈ Γ )
such that a∈Γ na · a is the semiring element to which the +-circuit evaluates to.
Note that the notion of an MTDD+ makes sense for commutative monoids, since
we only used the addition of the underlying semiring. But soon, we want to multiply
matrices, for which we need a semiring. Moreover, the notion of an MTDD+ makes
sense in any dimension, here we only defined the 2-dimensional case.
(the start variable is An here). In a similar way, one can produce the lower triangular
(2n × 2n )-matrix, where entries on the diagonal and below are 1. To produce the (2n ×
2n )-matrix over Z, where all entries in the k-th row are k, we need the following rules:
Ej−1 + Ej−1 Ej−1 + Ej−1
E0 → 1, Ej → (1 ≤ j ≤ n)
Ej−1 + Ej−1 Ej−1 + Ej−1
Cj−1 Cj−1
C0 → 1, Cj → (1 ≤ j ≤ n).
Cj−1 + Ej−1 Cj−1 + Ej−1
Here, we are bit more liberal with respect to the format of rules, but the above rules can
be easily brought into the form from the general definition of an MTDD+ . Note that
Ej generates the (2j × 2j )-matrix with all entries equal to 2j , and that Cn generates the
desired matrix.
Note that the matrix from the last example cannot be produced by an MTDD of poly-
nomial size, since it contains an exponential number of different matrix entries (for
the same reason it cannot be produced by an 2SLP [3]). This holds for any non-trivial
semiring.
Theorem 1. For any semiring with at least two elements, MTDD+ are exponentially
more succinct than MTDDs.
Proof. For simplicity we argue with MTDDs in dimension 1 (which generate vectors).
We must have 1 = 0 in S. Let m, d > 0 be such that m = 2d . For 0 ≤ i ≤ m − 1 let
Ai such that val(Ai ) has length m, the i-th entry is 1 (the first entry is the 0-th entry)
and all other entries are 0. Moreover, let Bi such that val(Bi ) is the concatenation of
2i copies of val(Ai ). Let C0 produce the 0-vector of length m = 2d , and for 0 ≤ i ≤
m − 1 let Ci+1 → (Ci , Ci + Bi ). Then val(Cm ) is of length 2d+m and consists of
the concatenation of all binary strings of length m. This MTDD+ for this vector is of
size O(m2 log m), whereas an equivalent MTDD must have size at least 2m , since for
every binary string of length m there must exist a nonterminal.
The following result shows that the matrix product of two MTDD-represented matrices
may be incompressible with MTDDs.
Theorem 2. For any semiring with at least two elements there exist MTDDs Gn and
Hn of the same height n and size O(n2 log n) such that val(Gn ) · val(Hn ) can only be
represented by an MTDD of size at least 2n .
On the other hand, the product of two MTDD+ -represented matrices can be represented
by a polynomially sized MTDD+ :
Theorem 3. For MTDD+ G1 and G2 of the same height one can compute in time
O(|G1 | · |G2 |) an MTDD+ G of size O(|G1 | · |G2 |) with val(G) = val(G1 ) · val(G2 ).
For the proof, we compute from G1 and G2 a new MTDD+ G that contains for
all variables A of G1 and B of G2 of the same height a variable (A, B) such that
valG (A, B) = valG1 (A) · valG2 (B).
The following proposition presents several further matrix operations that can be eas-
ily implemented in polynomial time for an MTDD+ -represented input matrix.
252 M. Lohrey and M. Schmidt-Schauß
(1) An MTDD+ for the transposition of val(G) can be computed in time O(n).
(2) +-circuits for the sum of all entries of val(G) and the trace of val(G) can be com-
puted in time O(n).
(3) A +-circuit for the matrix entry val(G)i,j can be computed in time O(n).
(4) MTDD+ of size O(n · m) for the tensor product val(G) ⊗ val(H) (which includes
the scalar product) and the element-wise (Hadamard) product val(G) ◦ val(H)
(assuming height(G) = height(H)) can be computed in time O(n · m).
Another well-studied succinct representation are boolean circuits [13]. A boolean cir-
cuit with n inputs represents a binary string of length 2n , namely the string of output
values for the 2n many input assignments (concatenated in lexicographic order). In a
similar way, we can use circuits to encode large matrices. We propose two alternatives:
A boolean circuit C(x, y, z) with |x| = m and |y| = |z| = n encodes a (2n × 2n )-
m
matrix MC,2 with integer entries bounded by 22 that is defined as follows: For all
a ∈ {0, 1}m and b, c ∈ {0, 1}n, the a-th bit (in lexicographic order) of the matrix entry
at position (b, c) in MC is 1 if and only if C(a, b, c) = 1.
Note that in contrast to MTDD+ , the size of an entry in MC,2 can be doubly ex-
ponential in the size of the representation C (this is the reason for the index 2 in
MC,2 ). The following alternative is closer to MTDD+ : A boolean circuit C(x, y) with
|x| = |y| = n and m output gates encodes a (2n × 2n )-matrix MC,1 with integer entries
bounded by 2m that is defined as follows: For all a, b ∈ {0, 1}n, C(a, b) is the binary
encoding of the entry at position (a, b) in MC .
Circuit representations for matrices are at least as succinct as MTDD+ . More pre-
cisely, from a given MTDD+ G one can compute in logspace a Boolean circuit C such
that MC,1 = val(G). This is a direct corollary of Proposition 1(3) (stating that a given
entry of an MTDD+ -represented matrix can be computed in polynomial time) and the
fact that polynomial time computations can be simulated by boolean circuits. Recently,
it was shown that checking whether for a given circuit C the determinant of the ma-
trix MC,1 vanishes is PSPACE-complete [14]. An algebraic version of this result for
the algebraic complexity class VPSPACE is shown in [20]. Thm. 6 from Sec. 6 will
strengthen the result from [14] to MTDD-represented matrices.
5 Testing Equality
Step 3. If a variable A of height h occurs in the equations, and the rule for A has the
form A → A1 + A2 , then replace every occurrence of A in the equations by A1 + A2 .
Step 4. If none of steps 1–3 applies to the equations, then only rules of the form
A1,1 A1,2
A→ (2)
A2,1 A2,2
are applicable to a variable A (of height h) occurring in the equations. Applying all
possible rules of this form for the current height results in a set of equations where all
254 M. Lohrey and M. Schmidt-Schauß
variables are (2 × 2)-matrices over variables of height h − 1 (like the right-hand side
of (2)). Hence, every equation can be decomposed into 4 equations, where all variables
are variables of height h − 1.
If the height of all variables is finally 0, then only rules of the form A → a are
applicable. In this case, replace all variables by the corresponding integers, and check
whether all resulting equations are valid or not. If all equations hold, then the input
equation holds, i.e., val(A1 ) = val(A2 ). Otherwise, if at least one equation is not valid,
then val(A1 ) = val(A2 ).
The number of variables in the equations is bounded by the number of variables of
G. An upper bound on the absolute value of the coefficients in the equations is 2|G| ,
since only iterated addition can be performed to increase the coefficients. Lemma 1
shows that the number of equations after step 2 above is at most |G|, (the bound for the
number of different variables).
For the case S = Zk the same procedure works, we only have to use Lemma 2
instead of Lemma 1.
Corollary 1. Let M be a finitely generated cancellative commutative monoid. Given
an MTDD+ G over M and two variables A1 and A2 of G, one can check val(A1 ) =
val(A2 ) in time polynomial in |G|.
Proof. A cancellative commutative monoid M embeds into its Grothendieck group A,
which is the quotient of M ×M by the congruence defined by (a, b) ≡ (c, d) if and only
if a + d = c + b in M . This is an abelian group, which is moreover finitely generated if
M is finitely generated. Hence, the result follows from Thm. 1.
Let us now consider non-cancellative commutative monoids:
Theorem 5. Let M be a non-cancellative finitely generated commutative monoid. It is
coNP-complete to check val(A1 ) = val(A2 ) for a given MTDD+ G over M and two
variables A1 and A2 of G.
Proof. We start with the upper bound. Let {a1 , . . . , ak } be a finite generating set of M .
Let G be an MTDD+ over M and let A1 and A2 two variables of G. Assume that A1
and A2 have the same height h. It suffices to check in polynomial time for two given
indices 1 ≤ i, j ≤ 2h whether val(A1 )i,j = val(A2 )i,j . From 1 ≤ i, j ≤ 2h we can
compute +-circuits for the matrix entries val(A1 )i,j and val(A2 )i,j . From these circuits
we can compute numbers n1 , . . . , nk , m1 , . . . , mk ∈ N in binary representation such
that val(A1 )i,j = n1 a1 +· · ·+nk ak and val(A2 )i,j = m1 a1 +· · ·+mk ak . Now we can
use the following result from [26]: There is a semilinear subset S ⊆ N2k (depending
only on our fixed monoid M ) such that for all x1 , . . . , xk , y1 , . . . , yk ∈ N we have:
x1 a1 + · · · + xk ak = y1 a1 + · · · + yk ak if and only if (x1 , . . . , xk , y1 , . . . , yk ) ∈ S.
Hence, we have to check, whether v =: (n1 , . . . , nk , m1 , . . . , mk ) ∈ S. The semilinear
set S is a finite union of linear sets. Hence, we can assume that S is linear itself. Let
S = {v0 + λ1 v1 + · · · + λl vl | λ1 , . . . , λl ∈ N},
where v0 , . . . , vl ∈ N2k . Hence, we have to check, whether there exist λ1 , . . . , λl ∈ N
such that v = v0 + λ1 v1 + · · · λl vl . This is an instance of integer programming in the
fixed dimension 2k, which can be solved in polynomial time [16].
Processing Succinct Matrices and Vectors 255
For the lower bound we take elements x, y, z ∈ M such that x = y but x+z = y +z.
These elements exist since M is not mcancellative. We use an encoding of 3SAT from
[3]. Take a 3CNF formula C = i=1 Ci over n propositional variables x1 , . . . , xn ,
and let Ci = (αj1 ∨ αj2 ∨ αj3 ), where 1 ≤ j1 < j2 < j3 ≤ n and every αjk is
either xjk or ¬xjk . For every 1 ≤ i ≤ m we define an MTDD Gi as follows: The
variables are A0 , . . . , An , and B0 , . . . , Bn−1 , where Bi produces the vector of length
2i with all entries equal to 0 (which corresponds to the truth value true, whereas z ∈ M
corresponds to the truth value false). For the variables A0 , . . . , An we add the following
rules: For every 1 ≤ j ≤ n with j ∈ {j1 , j2 , j3 } we take the rule Aj → (Aj−1 , Aj−1 ).
For every j ∈ {j1 , j2 , j3 } such that αj = xj (resp. αj = ¬xj ) we take the rule
Finally add the rule A0 → z and let An be the start variable of Gi . Moreover, let
G (resp. H) be the 1-dimensional MTDD that produces the vector consisting of 2n
many x-entries (resp. y-entries). Then, val(G) + val(G1 ) + · · · + val(Gm ) = val(H) +
val(G1 ) + · · · + val(Gm ) if and only if C is unsatisfiable.
It is worth noting that in the above proof for coNP-hardness, we use addition only at
the top level in a non-nested way.
Theorem 6. The following holds for every ring S ∈ {Z} ∪ {Zn | n ≥ 2}:
(1) The set {G | G is an MTDD over S, det(val(G)) = 0} is PSPACE-complete.
(2) The function G → det(val(G)) with G an MTDD over Z is GapPSPACE-complete.
To prove this result we use a reduction of Toda showing that computing the determinant
of an explicitly given integer matrix is GapL-complete [27]. We apply this reduction
to configuration graphs of polynomial space bounded Turing machines, which are of
exponential size. It turns out that the adjacency matrix of the configuration graph of a
polynomial space bounded machine can be produced by a small MTDD (with terminal
entries 0 and 1). This was also shown in [9, proof of Thm. 7] in the context of OBDDs.
256 M. Lohrey and M. Schmidt-Schauß
Note that the determinant of a diagonal matrix is zero if and only if there is a zero-
entry on the diagonal. This can be easily checked in polynomial time for a diagonal
matrix produced by an MTDD. For MTDD+ (actually, for a sum of several MTDD-
represented matrices) we can show NP-completeness of this problem:
Our NP-hardness proof uses again the 3SAT encoding from [3] that we applied in the
proof of Thm. 5.
Let us now discuss the complexity of iterated multiplication and powering. Comput-
ing a specific entry, say at position (1, 1), of the product of n explicitly given matrices
over Z (resp., N) is known to be complete for GapL (resp., #L) [27]. Corresponding
results hold for the computation of the (1, 1)-entry of a matrix power An , where n is
given in unary notation. As usual, these problems become exponentially harder for ma-
trices that are encoded by boolean circuits (see Sec. 4.2). Let us briefly discuss two
scenarios (recall the matrices MC,1 and MC,2 defined from a circuit in Sec. 4.2).
Lemma 3. The function C → (MC )1,1 , where every matrix MCi ,1 is over N (resp., Z),
belongs to #P (resp., GapP).
Definition 2. A boolean circuit C(w, x, y, z) with k = |w|, m = |x|, and n = |y| = |z|
encodes a sequence of 2k many (2n × 2n )-matrices: For every bit vector a ∈ {0, 1}k ,
define
the circuit Ca = C(a, x, y, z) and the matrix Ma = MCa ,2 . Finally, let MC =
a∈{0,1}k Ma be the product of all these matrices.
Lemmas 3 and 4 yield the upper complexity bounds in the following theorem. For the
lower bounds we use again succinct versions of Toda’s techniques from [27], similar to
the proof of Thm. 6.
(1) The function (G, n) → (val(G)n )1,1 with G an MTDD over N (resp. Z) and n a
unary encoded number is complete for #P (resp., GapP).
(2) The function (G, n) → (val(G)n )1,1 with G an MTDD over N (resp. Z) and n a
binary encoded number is #PSPACE-complete (resp., GapPSPACE-complete).
By Thm. 8, there is no polynomial time algorithm that computes for a given MTDD G
and a unary number n a boolean circuit (or even an MTDD+ ) for the power val(G)n ,
unless #P = FP.
By [27] and Thm. 8, the complexity of computing a specific entry of a matrix power
An covers three different counting classes, depending on the representation of the ma-
trix A and the exponent n (let us assume that A is a matrix over N):
Processing Succinct Matrices and Vectors 257
References
1. Àlvarez, C., Jenner, B.: A very hard log-space counting class. Theor. Comput. Sci. 107, 3–30
(1993)
2. Beaudry, M., Holzer, M.: The complexity of tensor circuit evaluation. Computational Com-
plexity 16(1), 60–111 (2007)
3. Berman, P., Karpinski, M., Larmore, L.L., Plandowski, W., Rytter, W.: On the complexity
of pattern matching for highly compressed two-dimensional texts. J. Comput. Syst. Sci. 65,
332–350 (2002)
4. Bertoni, A., Choffrut, C., Radicioni, R.: Literal shuffle of compressed words. In: Ausiello,
G., Karhumäki, J., Mauri, G., Ong, L. (eds.) TCS 2008. IFIP, vol. 273, pp. 87–100. Springer,
Heidelberg (2008)
5. Bryant, R.E.: Graph-based algorithms for boolean function manipulation. IEEE Trans. Com-
puters 35(8), 677–691 (1986)
6. Caussinus, H., McKenzie, P., Thérien, D., Vollmer, H.: Nondeterministic NC1 computation.
Journal of Computer and System Sciences 57(2), 200–212 (1998)
7. Damm, C., Holzer, M., McKenzie, P.: The complexity of tensor calculus. Computational
Complexity 11(1-2), 54–89 (2002)
258 M. Lohrey and M. Schmidt-Schauß
8. Eppstein, D., Goodrich, M.T., Sun, J.Z.: Skip quadtrees: Dynamic data structures for multi-
dimensional point sets. Int. J. Comput. Geometry Appl. 18, 131–160 (2008)
9. Feigenbaum, J., Kannan, S., Vardi, M.Y., Viswanathan, M.: The complexity of problems on
graphs represented as obdds. Chicago J. Theor. Comput. Sci. (1999)
10. Fujii, H., Ootomo, G., Hori, C.: Interleaving based variable ordering methods for ordered
binary decision diagrams. In: Proc. ICCAD 1993, pp. 38–41. IEEE Computer Society (1993)
11. Fujita, M., McGeer, P.C., Yang, J.C.-Y.: Multi-terminal binary decision diagrams: An effi-
cient data structure for matrix representation. Formal Methods in System Design 10(2/3),
149–169 (1997)
12. Galota, M., Vollmer, H.: Functions computable in polynomial space. Inf. Comput. 198(1),
56–70 (2005)
13. Galperin, H., Wigderson, A.: Succinct representations of graphs. Inform. and Control 56,
183–198 (1983)
14. Grenet, B., Koiran, P., Portier, N.: On the complexity of the multivariate resultant. J. Com-
plexity 29(2), 142–157 (2013)
15. Ladner, R.E.: Polynomial space counting problems. SIAM J. Comput. 18, 1087–1097 (1989)
16. Lenstra, H.: Integer programming with a fixed number of variables. Mathematics of Opera-
tions Research 8, 538–548 (1983)
17. Lohrey, M.: Leaf languages and string compression. Inf. Comput. 209, 951–965 (2011)
18. Lohrey, M.: Algorithmics on SLP-compressed strings: a survey. Groups Complex. Cryptol. 4,
241–299 (2012)
19. Lohrey, M., Schmidt-Schauß, M.: Processing Succinct Matrices and Vectors. arXiv (2014),
http://arxiv.org/abs/1402.3452
20. Malod, G.: Succinct algebraic branching programs characterizing non-uniform complexity
classes. In: Owe, O., Steffen, M., Telle, J.A. (eds.) FCT 2011. LNCS, vol. 6914, pp. 205–
216. Springer, Heidelberg (2011)
21. Meinel, C., Theobald, T.: Algorithms and Data Structures in VLSI Design: OBDD - Foun-
dations and Applications. Springer (1998)
22. Mereghetti, C., Palano, B.: Threshold circuits for iterated matrix product and powering.
ITA 34(1), 39–46 (2000)
23. Plandowski, W.: Testing equivalence of morphisms in context-free languages. In: van
Leeuwen, J. (ed.) ESA 1994. LNCS, vol. 855, pp. 460–470. Springer, Heidelberg (1994)
24. Samet, H.: The Design and Analysis of Spatial Data Structures. Addison-Wesley (1990)
25. Storjohann, A., Mulders, T.: Fast algorithms for linear algebra modulo N . In: Bilardi, G.,
Pietracaprina, A., Italiano, G.F., Pucci, G. (eds.) ESA 1998. LNCS, vol. 1461, pp. 139–150.
Springer, Heidelberg (1998)
26. Taĭclin, M.A.: Algorithmic problems for commutative semigroups. Dokl. Akda. Nauk SSSR
9(1), 201–204 (1968)
27. Toda, S.: Counting problems computationally equivalent to computing the determinant.
Technical Report CSIM 91-07, Tokyo University of Electro-Communications (1991)
28. Toda, S.: PP is as hard as the polynomial-time hierarchy. SIAM J. Comput. 20, 865–877
(1991)
29. Valiant, L.G.: Completeness classes in algebra. In: Proc. STOC 1979, pp. 249–261. ACM
(1979)
30. Veith, H.: How to encode a logical structure by an OBDD. In: Proc. 13th Annual IEEE
Conference on Computational Complexity, pp. 122–131. IEEE Computer Society (1998)
31. Wegener, I.: The size of reduced OBDD’s and optimal read-once branching programs for
almost all boolean functions. IEEE Trans. Computers 43(11), 1262–1269 (1994)
Constraint Satisfaction
with Counting Quantifiers 2
1 Introduction
The constraint satisfaction problem CSP(B), much studied in artificial intelli-
gence, is known to admit several equivalent formulations, two of the best known
of which are the query evaluation of primitive positive (pp) sentences – those
involving only existential quantification and conjunction – on B, and the homo-
morphism problem to B (see, e.g., [9]). The problem CSP(B) is NP-complete in
general, and a great deal of effort has been expended in classifying its complexity
for certain restricted cases. Notably it is conjectured [7,4] that for all fixed B,
the problem CSP(B) is in P or NP-complete. While this has not been settled
in general, a number of partial results are known – e.g. over structures of size
The author was supported by EPSRC grant EP/L005654/1.
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 259–272, 2014.
c Springer International Publishing Switzerland 2014
260 B. Martin and J. Stacho
at most three [13,3] and over smooth digraphs [8,1]. A popular generalization
of the CSP involves considering the query evaluation problem for positive Horn
logic – involving only the two quantifiers, ∃ and ∀, together with conjunction.
The resulting quantified constraint satisfaction problems QCSP(B) allow for a
broader class, used in artificial intelligence to capture non-monotonic reasoning,
whose complexities rise to PSPACE-completeness.
In this paper, we continue the project begun in [11] to study counting quanti-
fiers of the form ∃≥j , which allow one to assert the existence of at least j elements
such that the ensuing property holds. Thus on a structure B with domain of size
n, the quantifiers ∃≥1 and ∃≥n are precisely ∃ and ∀, respectively.
We study variants of CSP(B) in which the input sentence to be evaluated
on B (of size |B|) remains positive conjunctive in its quantifier-free part, but is
quantified by various counting quantifiers.
For X ⊆ {1, . . . , |B|}, X = ∅, the X-CSP(B) takes as input a sentence given
by a conjunction of atoms quantified by quantifiers of the form ∃≥j for j ∈ X.
It then asks whether this sentence is true on B.
In [11], it was shown that X-CSP(B) exhibits trichotomy as B ranges over
undirected, irreflexive cycles, with each problem being in either L, NP-complete
or PSPACE-complete. The following classification was given for cliques.
Theorem 1. [11] For n ∈ N and X ⊆ {1, . . . , n}:
& '
(i) X-CSP(Kn ) is in L if n ≤ 2 or X ∩ 1, . . . , %n/2& = ∅.
(ii) X-CSP(Kn ) is NP-complete if n > 2 and X = {1}.
(iii) X-CSP(Kn ) is PSPACE-complete
& if n '> 2 and either j ∈ X for 1 < j <
n/2 or {1, j} ⊆ X for j ∈ n/2, . . . , n .
Precisely the cases {j}-CSP(K2j ) are left open here. Of course, {1}-CSP(K2)
is graph 2-colorability and is in L, but for j > 1 the situation was very unclear,
and the referees noted specifically this lacuna.
In this paper we settle this question, and find the surprising situation that
{2}-CSP(K4) is in P while {j}-CSP(K2j ) is PSPACE-complete for j ≥ 3. The
algorithm for the case {2}-CSP(K4) is specialized and non-trivial, and consists
in iteratively constructing a collection of forcing triples where we proceed to look
for a contradiction.
As a second focus of the paper, we continue the study of {1, 2}-CSP(H).
In particular, we focus on finite undirected graphs for which a dichotomy was
proposed in [11]. As a fundamental step towards this, we first investigate the
complexity of {1, 2}-CSP(P∞), where P∞ denotes the infinite undirected path.
We find tractability here in describing a particular unique obstruction, which
takes the form of a special walk, whose presence or absence yields the answer to
the problem. Again the algorithm is specialized and non-trivial, and in carefully
augmenting it, we construct another polynomial-time algorithm, this time for
all finite paths. This then proves the following theorem.
Combined with the results from [8,11], this allows us to observe a dichotomy
for {1, 2}-CSP(H) as H ranges over undirected graphs, each problem being either
in P or NP-hard, in turn settling a conjecture proposed in [11].
In [11], the main preoccupation was in the distinction between P and NP-
hard. Here we concentrate our observations to show situations in which we have
sharp dichotomies between P and PSPACE-complete. In particular, for bipar-
tite graphs, we are able to strengthen the above results in the following manner.
Note that this cannot be strengthened further for non-bipartite graphs, since
there are NP-complete cases (for instance when H is the octahedron K2,2,2 )
and the situation regarding the NP-complete cases is less clear.
Taken together, our work seems to indicate a rich and largely uncharted com-
plexity landscape that these types of problems constitute. The associated com-
binatorics to this landscape appears quite complex and the absence of a simple
algebraic approach is telling. We will return to the question of algebra in the
final remarks of the paper.
The paper is structured as follows. In §2, we describe a characterization and a
polynomial time algorithm for {2}-CSP(K4). In §3, we show PSPACE-hardness
for {n}-CSP(K2n) for n ≥ 3. In §4, we characterize {1, 2}-CSP for the infinite
path P∞ and describe the resulting polynomial algorithm. Then, in §5, we gen-
eralize this to finite paths and prove Theorem 2 and associated corollaries. Sub-
sequently, in §6, we discuss the P/PSPACE-complete dichotomy of bipartite
graphs, under {1, 2}-CSP. Finally in §7, we illustrate some situations in which the
intermediate NP-completeness arises by discussing cases with loops on vertices.
We conclude the paper in §8 by giving some final thoughts.
1.1 Preliminaries
Our proofs use the game characterization and structural interpretation from [11].
For completeness, we summarize it here. This is as follows.
Given an input Ψ for X-CSP(B), we define the following game G (Ψ, B):
The template K4 has vertices {1, 2, 3, 4} and all possible edges between distinct
vertices. Consider the instance Ψ of {2}-CSP(K4) as a graph G = Dψ together
with a linear ordering ≺ on V (G) (see Definition 2).
We iteratively construct the following three sets: R+ , R− , and F . The set F
will be a collection of unordered pairs of vertices of G, while R+ and R− will
consist of unordered triples of vertices. (For simplicity we write xy ∈ F in place
of {x, y} ∈ F , and write xyz ∈ R+ or R− in place of {x, y, z} ∈ R+ or R− .)
The meaning of these sets is as follows. A pair xy ∈ F where x ≺ y indicates
that Prover in order to win must offer values so that the value f (x) chosen by
Adversary for x is different from the value f (y) chosen for y. A triple xyz ∈ R+
where x ≺ y ≺ z indicates that if Adversary chose f (x) = f (y), then Prover
must offer one (or both) of f (x), f (y) for z. A triple xyz ∈ R− where x ≺ y ≺ z
tells us that Prover must offer values different from f (x), f (y) if f (x) = f (y).
With this, we describe how to iteratively compute the three sets F , R+ , R− .
We start by initializing the sets as follows: F = E(G) and R+ = R− = ∅. Then
we perform the following rules as long as possible:
(X1) If there are x, y, z ∈ V (G) such that {x, y} ≺ z where xz, yz ∈ F , then
add xyz into R− .
(X2) If there are vertices x, y, w, z ∈ V (G) such that {x, y, w} ≺ z with wz ∈ F
and xyz ∈ R− , then add xyw into R+ .
(X3) If there are x, y, w, z ∈ V (G) such that {x, y, w} ≺ z with wz ∈ F and
xyz ∈ R+ , then if {x, y} ≺ w, then add xyw into R−
else add xw and yw into F .
(X4) If there are vertices x, y, w, z ∈ V (G) such that {x, w} ≺ y ≺ z with
xyz ∈ R+ and wyz ∈ R− , then add xw into F , and add xwy into R+ .
(X5) If there are vertices x, y, w, z ∈ V (G) such that {x, y, w} ≺ z where either
xyz, wyz ∈ R+ , or xyz, wyz ∈ R− , then add xyw into R+ .
Constraint Satisfaction with Counting Quantifiers 2 263
≺ = left-to-right order
x y z x y z w x y z xy ∈ F
x y
y xyz ∈ R+
x z
y
y y xyz ∈ R−
x z x w z x z
w
The template K2n consists of vertices {1, 2, . . . , 2n} and all possible edges
between distinct vertices. We shall call these vertices colours. We describe a re-
duction from the PSPACE-complete [2] problem QCSP(Kn )={1, n}-CSP(Kn)
to {n}-CSP(K2n). Consider an instance of QCSP(Kn ), namely a formula Ψ where
Ψ = ∃≥b1 v1 ∃≥b2 v2 . . . ∃≥bN vN ψ
where each bi ∈ {1, n}. As usual (see Definition 2), let G denote the graph Dψ
with vertex set {v1 , . . . , vN } and edge set {vi vj | E(vi , vj ) appears in ψ}.
We construct an instance Φ of {n}-CSP(K2n ) with the property that Ψ is a
yes-instance of QCSP(Kn ) if and only if Φ is a yes-instance of {n}-CSP(K2n).
In short, we shall model the n-colouring using 2n − 1 colours, n − 1 of which
will treated as don’t care colours (vertices coloured using any of such colours will
be ignored). We make sure that the colourings where no vertex is assigned a
don’t-care colour precisely model all colourings that we need to check to verify
that Ψ is a yes-instance.
We describe Φ by giving a graph H together with a total order of its vertices
with the usual interpretation that the vertices are the variables of Φ, the total
order is the order of quantification of the variables, and the edges of H define
the conjunction of predicates E(·, ·) which forms the quantifier-free part φ of Φ.
x y w q z a b c
...
un u4 u3 u2 u1
where xi xi+1 ∈ E(G) for all i ∈ {1, . . . , r − 1}. A walk x1 , . . . , xr is a closed walk
if x1 = xr . Write |Q| to denote the length of the walk Q (number of edges on Q).
Definition
( 5. For vertices u, v ∈ V (G), define δ(u, v) to be the following: )
min λ(Q) Q = x1 , . . . , xr is a looping walk of G where x1 = u and xr = v .
If no looping walk between u and v exists, define δ(u, v) = ∞.
In other words, δ(u, v) denotes the smallest λ-value of a looping walk between
u and v. Note that δ(u, v) = δ(v, u), since the definition of a looping walk does
not prescribe the order of the endpoints of the walk.
The main structural obstruction in our characterization of is the following.
4.1 Characterization
Theorem 7. Suppose that G is a bipartite graph. Then the following statements
are equivalent.
(I) P∞ |= Ψ
(II) Prover has a winning strategy in G (Ψ, P∞ ).
(III) Prover can play G (Ψ, P∞ ) so that in every instance of the game, the result-
ing mapping f satisfies the following for all u, v ∈ V (G) with δ(u, v) < ∞:
|f (u) − f (v)| ≤ δ(u, v) , ( )
f (u) + f (v) + δ(u, v) is an even number . ())
(IV) There are no u, v ∈ V (G) where u ≺ v such that δ(u, v) ≤ β(v) − 2 .
(V) There is no bad walk in G.
Constraint Satisfaction with Counting Quantifiers 2 267
v1 v2 v3 v4 v5 v6 v7 v8 v9
β: ∃ ∃≥2 ∃≥2 ∃≥2 ∃ ∃≥2 ∃ ∃ ∃≥2
Example looping walks:
Q∗ = v1 , v9 , v8 , v7 , v2 |Q∗ | = 4 λ(Q∗ ) = 4 − 2 · 1 = 2
Q = v1 , v9 , v8 , v7 , v6 , v5 , v4 , v3 , v4 , v5 , v6 , v7 , v2 |Q| = 12
{v1 , v2 } ≺ {v3 , . . . , v9 } λ(Q) = 12 − 2 · 6 = 0
We decompose Q into looping walks:
Q1 = v1 , v9 , v8 , v7 , v6 , v5 , v4 , v3 λ(Q1 ) = 7 − 2 · 3 = 1
Q2 = v2 , v7 , v6 , v5 , v4 , v3 λ(Q2 ) = 5 − 2 · 2 = 1
{v1 , v2 } ≺ v3 ≺ {v4 , . . . , v9 }
Note that Q is a bad walk, while neither Q∗ nor Q1 nor Q2 is.
We conclude this section by remarking that the values δ(u, v) can be easily
computed in polynomial time by dynamic programming. This allows us to test
conditions of the above theorem and thus decide {1, 2}-CSP(P∞) in polytime.
We now expand this lemma to the general case of {1, 2}-CSP(Pn) as follows.
Recall that we proved that P∞ |= Ψ if and only if Prover can play G (Ψ, P∞ )
so that in every instance of the game, the resulting mapping f satisfies ( ) and
()). In fact the proof of (III)⇒(II) from Theorem 7 shows that every winning
strategy of Prover has this property. We use this fact in the subsequent text.
The following value γ(v) will allow us to keep track of the distance of f (v)
from the center of the (finite) path.
Definition 7. For each vertex v we define γ(v) recursively as follows:
γ(v) = 0 if v is firstin the ordering ≺
*
else γ(v) = β(v) − 1 + max 0, max γ(u) − δ(u, v) + β(v) − 1
u≺v
Lemma 5. Let M be a real number. Suppose that P∞ |= Ψ and that Prover plays
a winning strategy in the game G (Ψ, P∞ ). Then Adversary can play so that the
resulting mapping f satisfies |f (v) − M | ≥ γ(v) for every vertex v ∈ V (Dψ ).
Lemma 6. Let M be a real number. Suppose that P∞ |= Ψ . Then there exists a
winning strategy for Prover such that in every instance of the game the resulting
mapping f satisfies |f (v) − M | ≤ γ(v) + 1 for every v ∈ V (Dψ ).
With these tools, we can now prove a characterization of the case of even n.
Theorem 8. Let n ≥ 4 be even. Assume that P∞ |= Ψ . Then TFAE.
(I) Pn |= Ψ .
(II) Prover has a winning strategy in the game G (Ψ, Pn ).
(III) There is no vertex v with γ(v) ≥ n2 .
Proof. Note first that since n is even, we may assume, without loss of generality,
the first vertex in the ordering is quantified ∃≥1 . If not, we can freely change its
quantifier to ∃≥1 without affecting the satisfiability of the intance.
(I)⇔(II) is by Lemma 1. For (II)⇒(III), assume there is v with γ(v) ≥ n2
and Prover has a winning strategy in G (Ψ, Pn ). This is also a winning strategy
in G (Ψ, P∞ ). This allows us to apply Lemma 5 for M = n+1 2 to conclude that
Adversary can play against Prover so that |f (v)− n+1 2 | = |f (v)−M | ≥ γ(v) ≥ n2 .
Thus either f (v) ≥ 2 > n or f (v) ≤ 2 < 1. But then f (v) ∈ {1, . . . , n}
2n+1 1
This generalizes to odd n with a subtle twist. Define γ (v) using same recursion
as γ(v) except set γ (v) = β(v) − 1 if v is first in ≺. Note that γ (v) ≥ γ(v).
Now to derive Theorem 2, it remains to observe that the values γ(v) and γ (v)
can be calculated using dynamic programming in polynomial time.
j−2
...
x v2j−1 v0
... ... • •
... v2j−2 • v1
... •
..
...
.. .. • v2
. ... . .
... ... • • v3
y v4
3j copies of C2j
Fig. 4. The gadget for the case when H contains a cycle C2j
6 Proof of Theorem 3
In this section, we prove the P / PSPACE dichotomy for {1, 2}-CSP(H) for
bipartite graphs H as stated in Theorem 3. We have already discussed the poly-
nomial cases in the previous section. It remains to discuss the hardness.
Proof. We reuse the reduction from [11] used to prove Theorem 1. We briefly
discuss the key steps. The reduction is from QCSP(Kj ). Let Ψ be an input
formula for QCSP(Kj ). We begin by considering the graph Dψ to which we add a
disjoint copy W = {w1 , . . . , w2j } of C2j . Then we replace every edge (x, y) ∈ Dψ
with a gadget shown in Figure 4, where the black vertices are identified with W .
Finally, for ∀ variables v of Ψ , we add a new path z1 , z2 , . . . , zj where zj = v.
The resulting graph defines the quantifier-free part of θ of our desired formula
Θ. The quantification in Θ is as follows. The outermost quantifiers are ∃≥2 for
variables w1 , . . . , w2j . Then we move inwards through the quantifier order of Ψ ;
when we encounter an existential variable v, we apply ∃≥1 to it in Θ. When we
encounter a ∀ variable v, we apply ∃≥2 to the path z1 , z2 , . . . , zj constructed for
v, in that order. All the remaining variables are then quantified ∃≥1 .
As proved in [11], the cycle C2j models Θ if and only if Kj models Ψ . We now
adjust this to the bipartite graph H. There are three difficulties arising from
simply using the above construction as it is.
Firstly, assume the variables w1 , . . . , w2j are mapped to a fixed copy C of C2j
in H. We need to ensure that variables x, y derived from the original instance Ψ
are also mapped to C. For y variables in our gadget one can check this must be
true – the successive cycles in the edge gadget may never deviate from C, since
H contains no 4-cycle. For x variables off on the pendant this might not be true.
To fix this, we insist that Ψ contains an atom E(x, y) iff it also contains E(y, x);
QCSP(Kj ) remains PSPACE-complete on such instances [2].
Secondly, we need to check that Adversary has freedom to assign any value
from C to each ∀ variable v. Consider z1 , . . . , zj , the path associated with v. As
long as Prover offers values for z1 , . . . , zj from C, Adversary has freedom to chose
any value for v = zj . If on the other hand Prover offers for one of z1 , . . . , zj , say
for zi , a value not on C, then Adversary can choose all subsequent zi+1 , . . . , zj to
Constraint Satisfaction with Counting Quantifiers 2 271
also be mapped outside C, since H has no cycle shorter than C2j . Thus v = zj
is mapped outside C, but we already ensured that this does not happen.
Finally, we discuss how to ensure that W is mapped to a copy of C2j . Since
each vertex in W is quantified ∃≥2 , Adversary can force this by always choosing
a value not seen already when going through each of w1 , . . . , w2j in turn. If this
is not possible (both offered values have been seen), this gives rise to a cycle in
H shorter than C2j . In conclusion, if Adversary maps W to a cycle, then Prover
must play exclusively on this cycle, thus solving QCSP(Kj ). If Adversary maps
W to a subpath of C2j , then Prover can play to win (regardless whether Φ is a
yes- or no- instance). So the situation is just like with {1, 2}-CSP(C2j ).
8 Final Remarks
In this paper we have settled the major questions left open in [11] and it might
reasonably be said we have now concluded our preliminary investigations into
constraint satisfaction with counting quantifiers. Of course there is still a wide
vista of work remaining, not the least of which is to improve our P/ NP-
hard dichotomy for {1, 2}-CSP on undirected graphs to a P/ NP-complete /
PSPACE-complete trichotomy (if indeed the latter exists). The absence of a
similar trichotomy for QCSP, together with our reliance on [8], suggests this
could be a challenging task. Some more approachable questions include lower
bounds for {2}-CSP(K4) and {1, 2}-CSP(P∞). For example, intutition suggests
272 B. Martin and J. Stacho
these might be NL-hard (even P-hard for the former). Another question would
be to study X-CSP(P∞ ), for {1, 2} ⊆ / X ⊂ N.
Since we initiated our work on constraint satisfaction with counting quanti-
fiers, a possible algebraic approach has been published in [5,6]. It is clear reading
our expositions that the combinatorics associated with our counting quantifiers
is complex, and unfortunately the same seems to be the case on the algebraic
side (where the relevant “expanding” polymorphisms have not previously been
studied in their own right). At present, no simple algebraic method, generalizing
results from [2], is known for counting quantifiers with majority operations. This
would be significant as it might help simplify our tractability result of Theorem 2.
So far, only the Mal’tsev case shows promise in this direction.
References
1. Barto, L., Kozik, M., Niven, T.: The CSP dichotomy holds for digraphs with no
sources and no sinks (a positive answer to a conjecture of Bang-Jensen and Hell).
SIAM Journal on Computing 38(5), 1782–1802 (2009)
2. Börner, F., Bulatov, A.A., Chen, H., Jeavons, P., Krokhin, A.A.: The complexity
of constraint satisfaction games and QCSP. Inf. Comput. 207(9), 923–944 (2009)
3. Bulatov, A.: A dichotomy theorem for constraint satisfaction problems on a 3-
element set. J. ACM 53(1), 66–120 (2006)
4. Bulatov, A., Krokhin, A., Jeavons, P.G.: Classifying the complexity of constraints
using finite algebras. SIAM Journal on Computing 34, 720–742 (2005)
5. Bulatov, A.A., Hedayaty, A.: Counting predicates, subset surjective functions, and
counting csps. In: 42nd IEEE International Symposium on Multiple-Valued Logic,
ISMVL 2012, pp. 331–336 (2012)
6. Bulatov, A.A., Hedayaty, A.: Galois correspondence for counting quantifiers. CoRR
abs/1210.3344 (2012)
7. Feder, T., Vardi, M.: The computational structure of monotone monadic SNP and
constraint satisfaction: A study through Datalog and group theory. SIAM Journal
on Computing 28, 57–104 (1999)
8. Hell, P., Nešetřil, J.: On the complexity of H-coloring. Journal of Combinatorial
Theory, Series B 48, 92–110 (1990)
9. Kolaitis, P.G., Vardi, M.Y.: A logical Approach to Constraint Satisfaction. In:
Finite Model Theory and Its Applications. Texts in Theoretical Computer Science.
An EATCS Series. Springer-Verlag New York, Inc. (2005)
10. Madelaine, F., Martin, B.: QCSP on Partially Reflexive Cycles – The Wavy Line
of Tractability. In: Bulatov, A.A., Shur, A.M. (eds.) CSR 2013. LNCS, vol. 7913,
pp. 322–333. Springer, Heidelberg (2013)
11. Madelaine, F., Martin, B., Stacho, J.: Constraint Satisfaction with Counting Quan-
tifiers. In: Hirsch, E.A., Karhumäki, J., Lepistö, A., Prilutskii, M. (eds.) CSR 2012.
LNCS, vol. 7353, pp. 253–265. Springer, Heidelberg (2012)
12. Martin, B.: QCSP on partially reflexive forests. In: Lee, J. (ed.) CP 2011. LNCS,
vol. 6876, pp. 546–560. Springer, Heidelberg (2011)
13. Schaefer, T.J.: The complexity of satisfiability problems. In: Proceedings of STOC
1978, pp. 216–226 (1978)
Dynamic Complexity of Planar 3-Connected
Graph Isomorphism
Jenish C. Mehta
jenishc@gmail.com
1 Introduction
Consider the problem lis(A) of finding the longest increasing subsequence of a
sequence (or array) of n numbers A. The “template” dynamic programming poly-
nomial time solution proceeds by subsequently finding and storing lis(A[1:i]) -
the longest increasing subsequence of numbers from 1 to i that necessarily ends
with the i’th number. lis(A[1:i + 1]) is found, given lis(A[1:1]) to lis(A[1:i]),
by simply finding the maximum sequence formed by possibly appending A[i + 1]
to the largest subsequence from lis(A[1:1]) to lis(A[1:i]).
This work was done while the author was interning at Chennai Mathematical Insti-
tute in May-June, 2010
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 273–286, 2014.
c Springer International Publishing Switzerland 2014
274 J.C. Mehta
1
By polynomial information, we mean information that has been generated in poly-
nomial time, and after the insertion of an edge, it can be regenerated (in polynomial
time) so as to allow insertion of another edge, and so on ad infinitum.
276 J.C. Mehta
Hesse [8] showed that Directed Reachablity lies in DynTC0 . Also, Dong and Su
[6] further showed that Directed Rechability for acyclic graphs lies in DynFO.
The Graph Isomorphism problem (of finding a bijection between the vertex
sets of two graphs such that the adjacencies are preserved) has so far been elusive
to algorithmic efforts and has not yet yielded a better than subexponential (2o(n) )
time static algorithm. The general problem is in NP, and also in SPP (Arvind
and Kurur [1]). Thus, various special cases have been considered, one important
case being restriction to planar graphs. Hopcroft and Wong [10] showed that
Planar Graph Isomorphism can be decided in linear time. In a series of works,
it was further shown that Tree Isomorphism is in L (Lindell [12]), 3-connected
Planar Graph Isomorphism is in L (Datta et. al. [3]) and finally, Planar Graph
Isomorphism is in L (Datta et. al. [4]).
Etessami considered the problem of isomorphism in the dynamic setting. It
was shown in [7] that Tree Isomorphism can be decided in DynFO.
In this work, we consider a natural extension and show that isomorphism
for Planar 3-connected graphs can be decided in DynFO (with some polynomial
precomputation). Our method of showing this is different from that in [7]. The
main technical tool we employ is that of Canonical Breadth-First Search trees
(abbreviated CBFS tree), which were used by Thierauf and Wagner [16] to show
that 3-connected Planar Graph Isomorphism lies in UL. We also introduce a
novel method for finding the canon of a 3-connected Planar graph from Canonical
Breadth-First Search trees in First-Order Logic (FOL). We finally compare the
canons of the two graphs to decide on isomorphism.
Our main results are:
1. Breadth-First Search for undirected graphs is in DynFO
2. Isomorphism for Planar 3-connected graphs is in DynFO+
DynFO+ is exactly same as DynFO, except that it allows some polynomial pre-
computation, which is necessary until enough edges are inserted so that the
graph becomes 3-connected. Note that this is the best one can hope for, due to
the requirement of 3-connectivity.
In Section 3, we prove Result 1. In Section 4, we prove Result 2. In Section 5,
we introduce a novel method of canonizing a planar 3-connected graph in FOL
from Canonical Breadth-First Search trees. Finally, we conclude with open prob-
lems and scope for future work. All the proofs, diagrams, detailed preliminaries,
and First-Order queries can be found in the extended version of the paper [13].
2 Preliminaries
The reader is referred to [5] for the graph-theoretic definitions, to [11] for the
definitions on Finite-Model Theory, and to [11] or [14] for definitions on Dynamic
Complexity.
Let Ev be the set of edges incident to v. A permutation πv on Ev that has
only one cycle is called a rotation. A rotation scheme for a graph G is a set
Dynamic Complexity of Planar 3-Connected Graph Isomorphism 277
Definition 1. For any static complexity class C, we define its dynamic version,
DynC as follows: Let ρ = R1a1 , ..., Rsas , c1 , ..., ct , be any vocabulary and S ⊆
ST RU C(ρ) be any problem.
Let Rn,ρ = {ins(i, a ), del(i, a ), set(j, a) | 1 ≤ i ≤ s, a ∈ {0, ..., n − 1}ai ,
1 ≤ j ≤ t} be the request to insert/delete tuple a into/from the relation Ri , or
set constant cj to a.
∗
Let evaln,ρ : Rn,ρ → ST RU C(ρ) be the evaluation of a sequence or stream
of requests. Define S ∈ DynC iff there exists another problem T ⊂ ST RU C(τ )
(over some vocabulary τ ) such that T ∈ C and there exist maps f and g:
∗
f : Rn,ρ → ST RU C(τ ), g : ST RU C(τ ) × Rn,ρ → ST RU C(τ )
Our main aim is to define the update function g (over some vocabulary τ ). If
condition (4) is relaxed, to the extent that the initializing function f may be
polynomially computable (before any insertion or deletion of tuples begin), the
resulting class is DynC+ , that is DynC with polynomial precomputation.
3 Breadth-First-Search in DynFO
In this section, we shall show that Breadth-First-Search (abbreviated BFS) for
any arbitrary undirected graph lies in DynFO. More specifically, we shall show
that there exists a set of relations, such that using those relations, finding the
minimum distance between any two points in a graph can be done through FOL,
and the set of all the points at a particular distance from a given point can
be retrieved through a FO query, in any arbitrary undirected graph. Also, the
modification of the relations can be carried out using FOL, during insertion or
deletion of edges.
278 J.C. Mehta
The definitions and terminologies regarding BFS can be found in any standard
textbook on algorithms, like [2].
The main idea is to maintain the BFS tree from each vertex in the graph. This
idea is important, because it will be extended in the next section. To achieve
this, we shall maintain the following relations:
– Level(v, x, l), implying that the vertex x is at level l in the BFS tree of
vertex v (A vertex x is said to be at level l in the BFS tree of v if the
distance between x and v is l);
– BF SEdge(v, x, y), meaning that the edge (x, y) of the graph is in the BFS
tree rooted at v;
– P ath(v, x, y, z), meaning that vertex z is on the path from x to y, in BFS
tree of v. Also
– Edge(x, y) will denote all the edges present in the entire graph.
Note that it is sufficient to maintain the Level relation to query the length of the
shortest path between any two vertices. We maintain the BF SEdge and P ath
relations only if we want the actual shortest path between any two vertices.
These relations form the vocabulary τ as in Definition 1.
insert(a, b). Due to the insertion of edge {a, b}, various paths in many BFS
trees will change. We will show that many of the paths do not change, and these
can be used to update the shortest paths that do change.
We shall see how to modify level of some vertex x in the BFS tree of some
vertex v. But before we proceed, we’ll need the following important lemma:
Lemma 1. After the insertion of an edge {a, b}, the level of a vertex x cannot
change both in the BFS trees of a and b.
Dynamic Complexity of Planar 3-Connected Graph Isomorphism 279
Since the level of vertex x remains invariant in atleast one BFS tree, this fact
can be used to modify the level of (and subsequently even the paths to) x using
this invariant. This fact will be crucial in the queries that we write next.
To update the BF SEdge and P ath relations, since we will create the new
shortest path by joining together two different paths, we need to ensure that
these paths are disjoint.
Without loss of generality, let |pathb (b, x)| ≤ |patha (a, x)|.
Lemma 2. If any vertex t is on pathb (b, x) and on pathv (v, a), then the shortest
path from v to x does not change after insertion of the edge {a, b}
The proofs of the above lemmas and the corresponding queries can be found
in the extended version of the paper.
delete(a, b). Consider now the deletion of some edge {a, b} from the graph. If
it is present in the BFS tree of some vertex v, the removal of the edge splits the
tree into two different trees. Let R1 = {u | v, u are connected in VG \{a, b}}, and
R2 = {u | u ∈ / R1 }. We find the set P R = {(p, r) | p ∈ R1 ∧ r ∈ R2 ∧ Edge(p, r)},
where P R is the set of edges in the graph that connect the trees R1 and R2 .
The new path to x will be a path from v to p in the BFS-tree of v, edge {p, r},
and path from r to x in the BFS-tree of r; and {p, r} will be chosen to yield the
shortest such path, and we will choose {p, r} to be the lexicographically smallest
amongst all such edges that yield the shortest path.
The only thing we need to address is the fact that the path from r to x in the
BFS tree of r does not pass through the edge {a, b}.
Lemma 3. When an edge {a, b} separates a set of vertices R2 from the BFS
tree of v, and r and x are vertices belonging to R2 , then pathr (r, x) cannot pass
through edge {a, b}
Remark 1. An important observation is that the above lemma holds only for the
“undirected” case. It fails for the directed case, implying that the same relations
cannot be used for BFS in directed graphs. To see a simple counter-example, note
that there can be a directed edge from r to a in the directed case, and in that
case, the shortest path from r to x can pass through (a, b).
Also note that for every vertex x in R1 , the shortest path from v to x remains
the same, since removal of an edge cannot decrease the shortest distance.
Remark 2. Note that although we pick the new paths for every vertex in the set
R2 in parallel, we need to ensure that the paths picked are consistent, i.e. the
paths form a tree and no cycle is formed. This is straightforward to see, since if
a cycle is formed, it is possible to pick another path for some vertex that came
earlier in the lexicographic ordering. Hence, our queries are consistent.
The ideas and the techniques hitherto developed were for general undirected
graphs. Now onwards, our relations would no longer hold for general graphs,
and we restrict ourselves to 3-connected and planar graphs.
We shall now show how to maintain a canonical description of a 3-connected
planar graph in DynFO. To achieve this end, we shall maintain Canonical Breadth-
First Search (abbreviated CBFS) trees similar to the ones used by Thierauf and
Wagner [16].
We shall now see how to maintain the CBFS trees [v, ve ]. We maintain the
following relations:
– F ace(f, x, y, z), meaning that the vertex z is in the anti-clockwise path from
vertex x to vertex y, around the face labelled f .
Note that since the number of faces in a planar graph with n vertices can
be more than n, we should label the face with a 2-tuple instead of a single
symbol; but we do not do this since it adds unnecessary technicality without
adding any new insight. If required, all the queries can be maintained for
the faces labelled as two tuples f = (f1 , f2 ).
– Level(v, x, l), meaning that the vertex x is at level l in the BFS tree of v.
This is exactly as in the general case.
– CBF SEdges(v, ve , s, t), where (s, t) is an edge in the CBFS tree [v, ve ].
– CP ath(v, ve , x, y, z) denoting that z is on the path from x to y in [v, ve ].
insert(a, b). Any edge {a, b} that is inserted lies on a particular face, say
f . Consider the edges from vertex a. Since a lies on the face f , exactly two
edges from a will lie on the boundary of f . Let these two edges, considered anti-
clockwise be e1 and e2 , having the embedded numbering n1 and n2 , respectively.
Note that n2 = (n1 + 1) mod da , where da is the degree of a. This is because if
this was not so, there would be some other edge in the anti-clockwise direction
between e1 and e2 , which would mean either we have selected a wrong face or
the wrong edges e1 and e2 .
Hence, when we insert the new edge {a, b}, we can give {a, b} the embedded
number n2 , and all the other edges around a which have an embedded number
more than n2 , can be incremented by 1. Similarly we do this for b.
delete(a, b). Note that since we expect the graph to be 3-connected and planar
once the edge (a, b) is removed, by the converse of Lemma 4 above, exactly two
faces will get merged. As such, our queries now will be the exact opposite to
those for insertion.
282 J.C. Mehta
Rotating and Flipping the Embedding. We will show how to rotate or flip
the embedding of the graph in FOL if required, as it will be necessary for further
sections.
The type of rotation that we will accomplish in this section is as follows: In
any given CBFS tree [v, ve ], for every vertex x, we rotate the embedding around
x until its parent gets the least embedding number, number 0 (that is the 0’th
number in the ordering). For the root vertex v which has no parent, we give ve
the least embedding number.
This scheme is like a ’normal’ form for ordering the edges around any vertex,
or ’normalizing’ the embedding. We show in this section that this can be done in
FOL. Also, flipping the ordering from anti-clockwise to clockwise is (very easily)
in FOL.
We shall create the following relation: Embp (v, ve , t, x, nx ), which will mean
that in the CBFS tree [v, ve ], for some vertex t, if the parent of t is tp , and if
the edge (t, tp ) (or the vertex tp ) is given the embedded number 0, then the edge
(t, x) (or the vertex x) gets the embedded number nx .
Note that our relation Emb was independent of any particular CBFS tree,
since it depended only on the structure of the 3-connected planar graph and
not on any CBFS tree we chose. But Embp depends on the chosen CBFS tree.
Another thing to note is that we do not maintain the relation Embp in our
vocabulary τ , since it can be easily created in FOL from the rest of the relations
whenever required.
We create the relation Embp in the following manner. In every CBFS tree
[v, ve ], for every vertex t, we find the degree (dt ) and the parent (tp ) of t, and
the embedded number np of tp . Then for every vertex x in the neighbourhood
of t with embedded numbering nx , we do nx = (nx − np ) mod dt .
We also create the relation Embf which will contain the flipped or the clock-
wise embedding π c .
A note said throughout in the manuscript is necessary to repeat here. Though
the parent of v is null in [v, ve ], we allow the parent of v to be ve , so as to keep
the queries neater. If this convention is not required, then the special case of the
parent of v can be handled easily by modifying the queries.
This shows that the embedding can be flipped and normalized in FOL. We
conclude the following:
Theorem 3. The embedding of a 3-connected planar graph can be maintained,
normalized and flipped in DynFO.
In this section, we show how to maintain the final two relations via insertions
and deletions of tuples that will help us to decide the isomorphism of two graphs.
The relations are almost completely similar to the ones used for Breadth-First
Search in the previous section. The only difference which arises is due to the
uniqueness of the paths in Canonical Breadth-First Search Trees. We do not
rewrite the Level(v, x, l) since it will be exactly similar to the general BFS case.
Dynamic Complexity of Planar 3-Connected Graph Isomorphism 283
insert(a, b). The CBFS tree is unique if the path to every vertex x from
the root vertex v is uniquely defined. How shall we choose the unique path?
First, we consider the paths with the shortest length. This is exactly same as
in Breadth-First Search seen in the previous section. But unlike BFS, where
we chose the shortest path arbitrarily (that is by lexicographic ordering during
insertion/deletion), we will very precisely choose one of the paths from the set of
shortest paths, by Definition 2. Intuitively, Definition 2 chooses the path based
on its orientation according to the embedding π.
An important observation from Definition 2 is the following: Distance has
preference over Orientation. This means that if there are two paths P1 and P2
from v to x in [v, ve ] (due to the insertion of an edge which created a cycle in
the tree [v, ve ]), though P2 <c P1 , the path P1 will be chosen if |P1 | < |P2 |
irrespective of the canonical ordering <c .
Consider some [v, ve ]. During insertion of {a, b}, let the old path (from v
to some x) be P1 and assume that the new path P2 passes through (a, b). If
|P1 | < |P2 | or |P1 | = |P2 | ∧ P1 <c P2 , the path to x does not change, and all
the edges and tuples to x in the old relations will belong to the new relations.
If |P2 | < |P1 | or |P1 | = |P2 | ∧ P2 <c P1 , the path to x changes. In this case, the
new path will be from v to a in [v, ve ], the edge {a, b} (from a to b), and the
path from b to x in [b, be ]. The way we choose be is as follows: We find the set
of vertices C that are adjacent to b and are at levelv (b) + 1. Since a will be the
parent of b in [v, ve ] , we rotate the embedding around b until a gets the value 0,
and the choose be to be the vertex in C that gets the least embedding number.
To check for the condition P1 <c P2 , we do the following: We create the set
Embp so that the parent of each vertex has the least embedding number. Let the
path Pa denote the path from v to a, which will be a subset of P2 . We choose
the vertex which is the least common ancestor of a and x, say d = lcaa,x , and
normalize the embedding so that dp , the parent of d, gets the embedding number
0. Existence of lcaa,x is guaranteed since v lies on both P1 and Pa . Now consider
the edge e1 = (lcaa,x , d1 ) on P1 and e2 = (lcaa,x , d2 ) on P2 . Since the embedding
is normalized, we see which edge gets the smaller embedding number around the
vertex lcaa,x. The path on which that edge lies will be the lesser ordered path
according to <c . It is nice to pause here for a moment and observe that this was
possible since the embedding was ’normalized’, otherwise it would not have been
possible.
One more thing needs to be shown. In Lemma 1, we proved that for any vertex
x, its level cannot change both in the BFS trees of a and b. In the previous case
of BFS, as per our algorithm, the level not being changed implied the path not
being changed. But that is not the case in CBFS trees. In CBFS trees, the level
not changing may still imply that the path changes (due to the <c ordering on
paths). Hence, it may be possible that though the level of the vertex x changes
in only one of the CBFS trees, its actual path changes in both the CBFS trees.
We need to show that this is not possible. And the reason this is necessary is
because (just like the previous case) the updation of the path will depend on
one specific path to vertex x in the CBFS tree of a or b which has not changed.
284 J.C. Mehta
Lemma 5. After the insertion of edge {a, b}, the path to any vertex x, cannot
change in both the CBFS trees [a, ae ] and [b, be ] for all ae , be .
delete(a, b). For the deletion operation, we choose the edge from P Rmin based
on the <c relation. Note that when some edge {a, b} is deleted, the path to some
vertex x in [v, ve ] cannot change if {a, b} does not lie on the path. Other things
remain exactly similar to the general case.
Lemma 6. For any CBFS tree [v, ve ], for any two vertices x and y, x = y ⇔
Canon(x) = Canon(y)
It is now easy to canonize each of the CBFS trees in FOL. Once each vertex
has a canon, each edge is also uniquely numbered. The main idea is this: A
canon will in itself encode all the necessary properties of the vertex, and the set
of canons of all vertices become the signature of the graph, preserving edges. The
main advantage of Definition 3 is that the canon of the graph can be generated
in FOL. It’s worthwhile to observe how this neatly beats the otherwise inevitable
computation of transitive closure (Theorem 1) to canonize the graph.
Hence, two 3-connected planar graphs G and H are isomorphic if and only if
for some CBFS tree [g, ge ] of G, there is a CBFS tree [h, he ], such that:
Dynamic Complexity of Planar 3-Connected Graph Isomorphism 285
Acknowledgments. The author sincerely thanks Samir Datta for fruitful dis-
cussions and critical comments on all topics ranging from the problem statement
to the preparation of the final manuscript.
References
1. Arvind, V., Kurur, P.P.: Graph isomorphism is in SPP. In: Proceedings of the
Forty-Third Annual IEEE Symposium on Foundations of Computer Science,
pp. 743–750. IEEE (2002)
2. Cormen, T.H., Stein, C., Rivest, R.L., Leiserson, C.E.: Introduction to Algorithms,
2nd edn. McGraw-Hill Higher Education (2001)
3. Datta, S., Limaye, N., Nimbhorkar, P.: 3-connected Planar Graph Isomorphism is
in Logspace. arXiv:0806.1041 (2008)
4. Datta, S., Limaye, N., Nimbhorkar, P., Thierauf, T., Wagner, F.: Planar Graph
Isomorphism is in Logspace. In: Proceedings of the Twenty-Fourth Annual IEEE
Conference on Computational Complexity, pp. 203–214. IEEE (2009)
5. Diestel, R.: Graph Theory. Springer (2005)
6. Dong, G.Z., Su, J.W.: Incremental and Decremental evaluation of Transitive Clo-
sure by First-Order queries. Information and Computation 120(1), 101–106 (1995)
7. Etessami, K.: Dynamic Tree Isomorphism via First-Order Updates to a Relational
Database. In: Proceedings of the Seventeenth ACM SIGACT-SIGMOD-SIGART
Symposium on Principles of Database Systems, pp. 235–243. ACM (1998)
286 J.C. Mehta
Victor Y. Pan
Abstract. The papers [18], [9], [29], and [28] combine the techniques of
the Fast Multipole Method of [15], [8] with the transformations of matrix
structures, traced back to [19]. The resulting numerically stable algo-
rithms approximate the solutions of Toeplitz, Hankel, Toeplitz-like, and
Hankel-like linear systems of equations in nearly linear arithmetic time,
versus the classical cubic time and the quadratic time of the previous
advanced algorithms. We extend this progress to decrease the arithmetic
time of the known numerical algorithms from quadratic to nearly linear
for computations with matrices that have structure of Cauchy or Van-
dermonde type and for the evaluation and interpolation of polynomials
and rational functions. We detail and analyze the new algorithms, and
in [21] we extend them further.
1 Introduction
The numerically stable algorithms of [18], [9], [29], and [28] approximate the
solution of Toeplitz, Hankel, Toeplitz-like, and Hankel-like linear systems of
equations in nearly linear arithmetic time versus the classical cubic time and
the previous record quadratic time of [14]. All five cited papers first transform
the matrix structures of Toeplitz and Hankel types into the structure of Cauchy
type, which is a special case of the general technique proposed in [19]. Then
[14] exploits the invariance of the Cauchy matrix structure in row and column
interchange, whereas the other four papers apply numerically stable FMM to op-
erate efficiently with HSS approximation of the basic Cauchy matrix. “HSS” and
“FMM” are the acronyms for “Hierarchically Semiseparable” and “Fast Multi-
pole Method”, respectively. “Historically HSS representation is just a special
case of the representations commonly exploited in the FMM literature” [7].
Some preliminary results of this paper have been presented at CASC 2013. Our
research has been supported by the NSF Grant CC 1116736 and the PSC CUNY
Awards 64512–0042 and 65792–0043.
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 287–299, 2014.
c Springer International Publishing Switzerland 2014
288 V.Y. Pan
Our present paper extends the algorithms of [18], [9], [29], and [28] to com-
putations with Cauchy and Vandermonde matrices, namely to approximation of
their products by a vector and of the solution of linear systems of equations with
these matrices, which also covers approximate multipoint polynomial and ratio-
nal evaluation and interpolation. The arithmetic time of the known numerical
approximation algorithms for all these tasks is quadratic [4], [3], and we decrease
it to nearly linear.
As in the papers [18], [9], [29], and [28], we approximate Cauchy matrices by
HSS matrices and exploit the HSS matrix structure. As in these papers our ba-
sic computational blocks are the numerically stable FFT and FMM algorithms,
which have been efficiently implemented on both serial and parallel comput-
ers [16], [1], [6]. Unlike the cited papers, however, we treat a large subclass of
Cauchy matrices C = ( si −t 1
)n−1 (we call them CV matrices because they are
j i,j=0
linked to Vandermonde matrices via FFT-based unitary transformations) rather
than just the single CV matrix involved in the fast Toeplitz solvers. For that
matrix, {s0 , . . . , sn−1 } is the set of the nth roots of unity, and {t0 , . . . , tn−1 }
is the set of the other (2n)-th roots of unity, but for a CV matrix C only the
knots {t0 , . . . , tn−1 } are assumed to be equally spaced on the unit circle, whereas
{s0 , . . . , sn−1 } is an unrestricted set of n knots. We still yield the desired HSS
approximation of CV matrices by exploiting a proper partition of the complex
plane into congruent sectors sharing the origin 0. To decrease the cost of com-
puting this approximation and of subsequent computations with HSS matrices,
we handle the harder and so far untreated case where the diagonal blocks are
rectangular and have row indices that pairwise overlap. We detail and analyze
our algorithms. In [21] we extend them to other classes of structured matrices.
We refer the reader to the papers and books [11], [13], [18], [7], [9], [25], [26],
[29], [27], [28], [2], [6], [15], [10], [8], [17], [23], and the bibliography therein on
FMM, HSS, and Matrix Compression (e.g., Nested Dissection) algorithms.
We organize our paper as follows. In the next section we recall some basic
results on computations with general matrices. In Section 3 we study polynomial
and rational evaluation and interpolation as computations with Vandermonde
and Cauchy matrices. In Sections 4 and 5 we extend the known results on HSS
matrix computations. in Section 6 we apply these results to treat CV matrices. In
Section 7 we discuss extensions and implementation. In Section 8 we summarize
our study. Because of the space limitation we leave to [22] COLORED FIGURES,
demonstrations by examples, proofs, details, and comments.
solutions of Problems 1 and 2 by using O(n log(n)) ops, and this solution can
be extended to Problems 3 and 4 (cf. [5, Sections 1.2 and √ 3.4], [20, Sections
2.2, 2.3, and Problem 2.4.2]). Now write t = (f ω j )n−1
j=0 , Vt = nΩ diag(f j )n−1
j=0 ,
−1 1 −j n−1 H 1 n−1
Vt = √n diag(f )j=0 Ω , and Cs,f = Cs,t = ( si −f ωj )i,j=0 and obtain from
[20, equations (3.6.5)–(3.6.7)] that
√ f n−1
m−1
Cs,f = n diag n Vs diag(f −j )n−1 H
j=0 Ω diag(ω
−j n−1
)j=0 , (3)
si − f n i=0
f 1−n
m−1
Vs = √ diag sni − f n Cs,f diag(ω j )n−1 j n−1
j=0 Ω diag(f )j=0 , (4)
n i=0
√ f n−1
n−1
−j n−1 −1
Vs−1 = n diag(f −j )n−1 Ω H
diag(ω ) C
j=0 s,f diag for m = n.
j=0
sni − f n i=0
(5)
These equations link Vandermonde matrices Vs and their inverses to the
Cauchy matrices with the knot set S = {si = f ω i , i = 0, . . . , n − 1} (for f = 0),
which we call CV matrices and denote Cs,f . The equations also link Problems 1
and 2 to Problems 3 and 4.
By means of the transposition of these equations and the substitution of the
vectors t → s, we link the transposed Vandermonde matrices VtT to the matrices
i,j=0 , for f = 0, which we call the CV matrices.
Cf,t = ( f ωi1−tj )n−1 T
4 HSS Matrices
Definition 1. (Cf. Figure 1.) Let M = (M0 | . . . | Mk−1 ) be a 1×k block matrix
with k block columns Mq , each partitioned into a diagonal block Σq and a basic
neutered block column Nq , q = 0, . . . , k − 1 (cf. [18, Section 1]). A matrix given
with its diagonal blocks is basically ρ-neutered (resp. basically (, ρ)-neutered) if
all its basic neutered block columns have ranks (resp. -ranks) at most ρ.
Definition 2. (Cf. Figure 1.) Fix two positive integers l and q such that l + q ≤
k and merge the l basic block columns Mq , . . . , Mq+l−1 , the l diagonal blocks
Σq , . . . , Σq+l−1 , and the l basic neutered block columns Nq , . . . , Nq+l−1 into their
union Mq,l = M (., ∪l−1 j=0 C(Σq+j )), their diagonal union Σq,l , and their neutered
union Nq,l , respectively, such that R(Σq,l ) = ∪l−1 j=0 R(Σq+j ) and the block column
Mq,l is partitioned into the diagonal union Σq,l and the neutered union Nq,l .
Define recursive merging of all diagonal blocks Σ0 , . . . , Σk−1 by a binary tree
whose leaves are associated to these blocks and whose every internal vertex
is the union of its two children. For every vertex v define the sets L(v) and
R(v) of its left and right descendants, respectively. A binary tree is balanced
if 0 ≤ |L(v)| − |R(v)| ≤ 1 for all its vertices v. Such a tree identifies balanced
merging of its leaves, in our case the diagonal blocks. We can uniquely define a
balanced tree with n leaves by removing the 2l(n) − n rightmost leaves of the
complete binary tree that has 2l(n) leaves for l(n) = log2 (n). All leaves of the
resulting heap structure with n leaves lie in its two lowest levels.
292 V.Y. Pan
Lemma 1. (See [24] and [9, equation (2.8)].) Suppose two complex values s and
t are (θ, c)-separated from one another for 0 ≤ θ < 1 and a complex center c and
t−c
write q = s−c , |q| ≤ θ. Then for every positive integer ρ we have
1 (t − c)h
ρ−1
1 qρ |q|ρ θρ
= + where |qρ | = ≤ . (8)
s−t s−c (s − c)h s−c 1 − |q| 1−θ
h=0
∞ h ρ−1 h qρ
Proof. 1
s−t = 1 1 1
s−c 1−q , 1−q = ( ρ−1 h
h=0 q + h=ρ q ) = ( h=0 q + 1−q ).
Theorem 5. (Cf. [9, Section 2.2] and [2].) Suppose two sets of 2n distinct com-
plex numbers S = {s0 , . . . , sm−1 } and T = {t0 , . . . , tn−1 } are (θ, c)-separated
from one another for 0 < θ < 1 and a global complex center c. Define the
Cauchy matrix C = ( si −t 1
)m−1,n−1 and write δ = δc,S = minm−1
j i,j=0 i=0 |si − c|
(cf. Definition 4). Fix a positive integer ρ and define the m × ρ matrix F =
(1/(si − c)ν+1 )m−1,ρ−1
i,ν=0 and the n × ρ matrix G = ((tj − c)ν )n−1,ρ−1j,ν=0 . (We can
compute these matrices by using (m + n)ρ + m arithmetic operations.) Then
θρ
C = F GT + E, |E| ≤ . (9)
(1 − θ)δ
Proof. Apply (8) for s = si , t = tj , and all pairs (i, j) to deduce (9).
294 V.Y. Pan
Generally neither CV matrix nor its submatrices of a large size have global
separation centers. So we approximate a CV matrix by an extended balanced
ρ-HSS matrix for a bounded integer ρ rather than by a low-rank matrix. We
first fix a reasonably large integer k and then partition the complex plane into
k congruent sectors sharing the origin 0 to induce a uniform k-partition of the
knot sets S and T and thus a block partition of the associated Cauchy matrix.
In the next subsection we specialize such partitions to the case of a CV matrix.
√
Definition 5. A(φ, φ ) = {z = exp(ψ −1) : 0 ≤ φ ≤ ψ < φ ≤ 2π}
is the semi-open arc of the unit√ circle {z : |z = 1|} √ having length φ − φ
and the√endpoints τ = exp(φ −1) and τ = exp(φ −1). Γ (φ, φ ) = {z =
r exp(ψ −1) : r ≥ 0, 0 ≤ φ ≤ ψ < φ ≤ 2π} is the semi-open sector bounded
by the two rays from the origin to the two endpoints of the arc. Γ̄ (φ, φ ) denotes
the exterior (that is the complement) of this sector.
Fix a positive integer l+ , write k = 2l+ , φq = 2qπ/k, and φq = φq+1 mod k ,
partition the unit circle {z : |z = 1|} by k equally spaced points φ0 , . . . , φk−1
into k semi-open arcs Aq = A(φq , φq ), each of the length 2π/k, and define the
semi-open sectors Γq = Γ (φq , φq ) for q = 0, . . . , k − 1. Now assume the polar
√ √
representation si = |si | exp(μi −1) and tj = |tj | exp(νj −1), and reenumer-
ate the knots in the counter-clockwise order of the angles μi and νj beginning
with the sector Γ (φ0 , φ0 ) and breaking ties arbitrarily. Induce the block par-
tition of a Cauchy matrix C = (Cp,q )k−1 p,q=0 and its partition into basic block
j
si ∈Γp ,tj ∈Γq
1
si −tj for p, q = 0, . . . , k − 1. Now for every q define the diag-
si ∈{0,...,n−1},tj ∈Γq
onal block Σq = Cq,q , its two neighboring blocks Cq−1 mod k,q and Cq+1 mod k,q ,
Fast Approximate Computations 295
(c)
the tridiagonal block Σq (made up of the block Cq and its two neighbors), and
(c) (c)
the admissible block Nq , which complements the tridiagonal block Σq in its
basic block column Cq .
Combine Corollary 2 with this theorem applied for k = 2l+ of order n/ log(n),
for ρ and log(1/) of order log(n), and for l < l+ such that the integer l+ − l is
reasonably large (verify that the assumptions of the corollary are satisfied), and
obtain the following result.
Because of the dual role of the rows and columns in our constructions we can
readily extend all our results from CV matrices C to CVT matrices C T .
Theorem 9. Suppose that we are given two positive integers m and n, a positive
, and a vector s = (si )m−1 i=0 defining an m × n Vandermonde matrix V = Vs .
Write s+ = maxm−1 i=0 |s i | and let log(1/) = O(log(m + n) + n log(s+ )).
(i) Then α (V ) + α (V T ) = O((m + n)(log2 (m + n) + n log(s+ )).
(ii) Suppose that in addition m = n and for some complex f , |f | = 1, the
matrix Cs,f of equation (3) is approximated by an extended balanced (, ρ)-HSS
matrix satisfying certain nondegeneration assumptions. Then β (V ) + β (V T ) =
O(n log3 (n)).
(iii) The latter bounds on α (V ) and β (V ) can be applied also to the solution
of Problems 1 and 2 of Section 3, respectively.
The term n log(s+ ) is dominated and can be removed from the bounds on
2
log(1/) and α (V ) + α (V T ) when s+ = 1 + O( log (m+n)
n ).
Various extensions to computations with the more general class of Cauchy-like
matrices and with rational functions are covered in [21] and [22], whereas the
recipes in [9], [26], [29], and [28] simplify the implementation of the proposed
Fast Approximate Computations 297
8 Conclusions
The papers [18], [9], [29], and [28] combine the advanced FMM/HSS techniques
with a transformation of matrix structures (traced back to [19]) to devise numer-
ically stable algorithms that compute approximate solution of Toeplitz, Hankel,
Toeplitz-like, and Hankel-like linear systems of equations in nearly linear arith-
metic time (versus cubic time of the classical numerical algorithms). We yield
similar results for multiplication of Vandermonde and Cauchy matrices by a
vector and the solution of linear systems of equations with these matrices (with
the extensions to polynomial and rational evaluation and interpolation). The
resulting decrease of the running time of the known approximation algorithms is
by order of magnitude, from quadratic to nearly linear. Our study provides new
insight into the subject and the background for further advances in [21], which
include the extension of our results to Cauchy-like matrices and further accel-
eration of the known approximation algorithms in the case of Toeplitz inputs.
The FMM can help decrease similarly our cost bound (6) (cf. [2]).
In Figures 1 and 2 we mark by black color the diagonal blocks and by dark grey
color the basic neutered block columns.
In Figure 1 the pairs of smaller diagonal blocks (marked by grey color) are
merged into their diagonal unions, each made up of four smaller blocks, marked
by grey and black colors.
In Figure 2 admissible blocks are shown by grey color, each grey diagonal
block has two black neighboring blocks, and the triples of grey and black blocks
form tridiagonal blocks.
In Figure 3 we show an arc of the unit circle {z : |z = 1|} and the five line
intervals [0, τ ], [0, c], [0, τ ], [τ, c], and [c, τ ]. We also show the two line intervals
bounding the intersection of the sector Γ (ψ, ψ ) and the unit disc D(0, 1) as
well as the two perpendiculars from the center c onto these two bounding line
intervals.
298 V.Y. Pan
References
1. Bracewell, R.: The Fourier Transform and Its Applications, 3rd edn. McGraw-Hill,
New York (1999)
2. Börm, S.: Efficient Numerical Methods for Non-local Operators: H2 -Matrix Com-
pression, Algorithms and Analysis. European Math. Society (2010)
3. Bella, T., Eidelman, Y., Gohberg, I., Olshevsky, V.: Computations with Quasisep-
arable Polynomials and Matrices. Theoretical Computer Science 409(2), 158–179
(2008)
4. Bini, D.A., Fiorentino, G.: Design, Analysis, and Implementation of a Multipreci-
sion Polynomial Rootfinder. Numer. Algs. 23, 127–173 (2000)
5. Bini, D., Pan, V.Y.: Polynomial and Matrix Computations, Volume 1: Fundamental
Algorithms. Birkhäuser, Boston (1994)
6. Barba, L.A., Yokota, R.: How Will the Fast Multipole Method Fare in Exascale
Era? SIAM News 46(6), 1–3 (2013)
7. Chandrasekaran, S., Dewilde, P., Gu, M., Lyons, W., Pals, T.: A Fast Solver for
HSS Representations via Sparse Matrices. SIAM J. Matrix Anal. Appl. 29(1), 67–81
(2006)
8. Carrier, J., Greengard, L., Rokhlin, V.: A Fast Adaptive Algorithm for Particle
Simulation. SIAM J. Scientific Computing 9, 669–686 (1998)
9. Chandrasekaran, S., Gu, M., Sun, X., Xia, J., Zhu, J.: A Superfast Algorithm for
Toeplitz Systems of Linear Equations. SIAM J. Matrix Anal. Appl. 29, 1247–1266
(2007)
10. Dutt, A., Gu, M., Rokhlin, V.: Fast Algorithms for Polynomial Interpolation, Inte-
gration, and Differentiation. SIAM Journal on Numerical Analysis 33(5), 1689–1711
(1996)
11. Dewilde, P., van der Veen, A.: Time-Varying Systems and Computations. Kluwer
Academic Publishers, Dordrecht (1998)
12. Eidelman, Y., Gohberg, I.: A Modification of the Dewilde–van der Veen Method for
Inversion of Finite Structured Matrices. Linear Algebra and Its Applications 343,
419–450 (2002)
13. Eidelman, Y., Gohberg, I., Haimovici, I.: Separable Type Representations of Ma-
trices and Fast Algorithms. Birkhäuser (2013)
14. Gohberg, I., Kailath, T., Olshevsky, V.: Fast Gaussian Elimination with Partial
Pivoting for Matrices with Displacement Structure. Mathematics of Computa-
tion 64, 1557–1576 (1995)
15. Greengard, L., Rokhlin, V.: A Fast Algorithm for Particle Simulation. Journal of
Computational Physics 73, 325–348 (1987)
16. Gentelman, W., Sande, G.: Fast Fourier Transform for Fun and Profit. Full Joint
Comput. Conference 29, 563–578 (1966)
17. Lipton, R.J., Rose, D., Tarjan, R.E.: Generalized Nested Dissection. SIAM J. on
Numerical Analysis 16(2), 346–358 (1979)
18. Martinsson, P.G., Rokhlin, V., Tygert, M.: A Fast Algorithm for the Inversion of
Toeplitz Matrices. Comput. Math. Appl. 50, 741–752 (2005)
19. Pan, V.Y.: On Computations with Dense Structured Matrices, Math. of Computa-
tion, 55(191), 179–190 (1990); Also in Proc. Intern. Symposium on Symbolic and
Algebraic Computation (ISSAC 1989), 34–42. ACM Press, New York (1989)
20. Pan, V.Y.: Structured Matrices and Polynomials: Unified Superfast Algorithms.
Birkhäuser/Springer, Boston/New York (2001)
Fast Approximate Computations 299
21. Pan, V.Y.: Transformations of Matrix Structures Work Again, accepted by Linear
Algebra and Its Applications and available in arxiv:1311.3729[math.NA]
22. Pan, V.Y.: Fast Approximation Algorithms for Computations with Cauchy Matri-
ces and Extensions, in Tech. Report TR 2014005, PhD Program in Comp. Sci.,
Graduate Center, CUNY (2014),
http://tr.cs.gc.cuny.edu/tr/techreport.php?id=469
23. Pan, V.Y., Reif, J.: Fast and Efficient Parallel Solution of Sparse Linear Systems.
SIAM J. on Computing 22(6), 1227–1250 (1993)
24. Rokhlin, V.: Rapid Solution of Integral Equations of Classical Potential Theory.
Journal of Computational Physics 60, 187–207 (1985)
25. Vandebril, R., Van Barel, M., Mastronardi, N.: Matrix Computations and Semisep-
arable Matrices: Linear Systems, vol. 1. The Johns Hopkins University Press, Bal-
timore (2007)
26. Xia, J.: On the Complexity of Some Hierarchical Structured Matrix Algorithms.
SIAM J. Matrix Anal. Appl. 33, 388–410 (2012)
27. Xia, J.: Randomized Sparse Direct Solvers. SIAM J. Matrix Anal. Appl. 34, 197–
227 (2013)
28. Xia, J., Xi, Y., Cauley, S., Balakrishnan, V.: Superfast and Stable Structured
Solvers for Toeplitz Least Squares via Randomized Sampling. SIAM J. Matrix
Anal. and Applications 35, 44–72 (2014)
29. Xia, J., Xi, Y., Gu, M.: A Superfast Structured Solver for Toeplitz Linear Systems
via Randomized Sampling. SIAM J. Matrix Anal. Appl. 33, 837–858 (2012)
First-Order Logic on CPDA Graphs
Pawel Parys
1 Introduction
Already in the 70’s, Maslov [1, 2] generalized the concept of pushdown automata
to higher-order pushdown automata (n-PDA) by allowing the stack to contain
other stacks rather than just atomic elements. In the last decade, renewed in-
terest in these automata has arisen. They are now studied not only as acceptors
of string languages, but also as generators of graphs and trees. Knapik et al. [3]
showed that trees generated by deterministic n-PDA coincide with trees gener-
ated by safe order-n recursion schemes (safety is a syntactic restriction on the
recursion scheme). Driven by the question of whether safety implies a semanti-
cal restriction to recursion schemes (which was recently proven [4, 5]), Hague et
al. [6] extended the model of n-PDA to order-n collapsible pushdown automata
(n-CPDA) by introducing a new stack operation called collapse (earlier, panic
automata [7] were introduced for order 2), and proved that trees generated by
n-CPDA coincide with trees generated by all order-n recursion schemes.
In this paper we concentrate on configuration graphs of these automata. In
particular we consider their ε-closures, whose edges consist of an unbounded
number of transitions rather than just single steps. The ε-closures of n-PDA
graphs form precisely the Caucal hierarchy [8–10], which is defined independently
in terms of MSO-interpretations and graph unfoldings. These results imply that
the graphs have decidable MSO theory, and invite the question about decidability
of logics in ε-closures of n-CPDA graphs.
The author holds a post-doctoral position supported by Warsaw Center of Math-
ematics and Computer Science. Work supported by the National Science Center
(decision DEC-2012/07/D/ST6/02443).
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 300–313, 2014.
c Springer International Publishing Switzerland 2014
First-Order Logic on CPDA Graphs 301
Unfortunately there is even a 2-CPDA graph that has undecidable MSO the-
ory [6]. Kartzow showed that the ε-closures of 2-CPDA graphs are tree automatic
[11], thus they have decidable first-order theory. This topic was further inves-
tigated by Broadbent [12–15]. He proved that for order 3 (and higher) the FO
theory starts to be undecidable. This can be made more precise. Let nm -CPDA
denote an n-CPDA in which we allow collapse links only of one order m. First-
order theory is undecidable already on:
– nm -CPDA graphs restricted to reachable configurations,1 when n ≥ 3, and
3 ≤ m ≤ n, and the formula is Σ2 , and
– nm -CPDA graphs restricted to reachable configurations,1 when n ≥ 4, and
2 ≤ m ≤ n − 2, and the formula is Σ1 , and
– ε-closures2 of 32 -CPDA graphs, when the formula is Σ2 , and
– 3-CPDA graphs not restricted to reachable configurations (nor to stacks
which are constructible from the empty one by a sequence of stack operation).
On the other side, Broadbent gives some small decidability results:
– for n = 2, FO is decidable even when extended by transitive closures of
quantifier free formulae;
– FO is decidable on 32 -CPDA graphs restricted to reachable configurations;
– Σ1 formulae are decidable on ε-closures of nn -CPDA graphs (for each n),
and of 32 -CPDA graphs.
In the current paper we complement this picture by three new results (answer-
ing questions stated by Broadbent). First, we prove that the existential (Σ1 ) FO
sentences are decidable on ε-closures of 3-CPDA graphs. This is almost proved in
[15]: it holds under the assumption that the 3-CPDA is luminous, which means
that after removing all order-3 collapse links from two different reachable con-
figurations, they are still different (that is, the targets of such links are uniquely
determined by the structure of the stack). We prove that each 3-CPDA can be
turned into an equivalent luminous one. The question whether Σ1 formulae are
decidable for nn−1 -CPDA and nn,n−1 -CPDA (allowing links of orders n and
n − 1) where n ≥ 4, both with and without ε-closure, remains open.
Second, we prove (contrarily to the Broadbent’s conjecture) that first-order
logic is undecidable on 4-CPDA graphs not restricted to reachable configurations,
but restricted to stacks constructible from the empty one by a sequence of stack
operations (although not necessarily ever constructed by the particular CPDA in
question). Our reduction is similar to the one showing undecidability of 3-CPDA
graphs not restricted to reachable configurations nor to constructible stacks.
Third, we prove that first-order logic is decidable (for each n) on n-CPDA
graphs not restricted to reachable configurations nor to constructible stacks,
when stacks are represented as annotated stacks. This is an alternative repre-
sentation of stacks of n-CPDA (defined independently in [16] and [17]), where
1
Thus for their ε-closures as well.
2
For ε-closures, it does not change anything whether we restrict to reachable config-
urations or not.
302 P. Parys
2 Preliminaries
We give a standard definition of an n-CPDA, using the “annotated stack” repre-
sentation of stacks. We choose this representation because of Section 5, in which
we talk about all configurations with such stacks. For Sections 3 and 4 we could
choose the standard representation (with links as numbers) as well.
Given a number n (the order of the CPDA) and a stack alphabet Γ , we define
the set of stacks as the smallest set satisfying the following. If 1 ≤ k ≤ n and
s1 , s2 , . . . , sm for m ≥ 1 are (k − 1, n)-stacks, then the sequence [s1 , s2 , . . . , sm ]
is a (k, n)-stack. If a ∈ Γ , and 1 ≤ k ≤ n, and s is a (k, n)-stack or s = [] (the
“empty stack”, which, according to our definition, is not a stack), then (a, k, s)
is a (0, n)-stack. We sometimes use “k-stack” instead of “(k, n)-stack” when n is
clear from the context or meaningless.
A 0-stack (a, l, t) is also called an atom; it has label lb((a, l, t)) := a and link
t of order l. In a k-stack s = [s1 , s2 , . . . , sm ], the top of the stack is on the right.
We define |s| := m, called the height of s, and pop(s) := [s1 , . . . , sm−1 ] (which
is equal to [] if m = 1). For 0 ≤ i ≤ k, topi (s) denotes the topmost i-stack of s.
An n-CPDA has the following operations on an (n, n)-stack s:
– popk , where 1 ≤ k ≤ n, removes the topmost (k − 1)-stack (undefined when
|topk (s)| = 1);
– push1a,l , where 1 ≤ l ≤ n and a ∈ Γ , pushes on the top of the topmost 1-stack
the atom (a, l, pop(topl (s)));
– pushk , where 2 ≤ k ≤ n, duplicates the topmost (k − 1)-stack inside the
topmost k-stack;
– collapse, when top0 (s) = (a, l, t), replaces the topmost l-stack by t (undefined
when t = []);
– rewa , where a ∈ Γ , replaces the topmost atom (b, l, t) by (a, l, t).
Denote the set of all these operations as Θn (Γ ). Operation rewa is not always
present in definitions of CPDA, but we add it following [15].
First-Order Logic on CPDA Graphs 303
In [15] (Theorem 5, and the comment below) this is proven under the restric-
tion to 3-CPDA A which are luminous. It remains to show that each 3-CPDA
A can be turned into a luminous 3-CPDA A for which G/ε (A) = G/ε (A ).
Let us recall the definition of luminosity. For an (n, n)-stack s, we write
stripln(s) to denote the (n, n)-stack that results from deleting all order-n links
from s (that is, changing atoms (a, n, p) into (a, n, []); of course we perform this
stripping also inside all links). An n-CPDA A is luminous whenever for every
two configurations (q, s), (q , s ) in the ε-closure with stripln(s) = stripln(s ) it
holds s = s .
For example, the two 2-stacks
[[(a, 1, []), (b, 1, [])], [(a, 1, []), (b, 2, s1 )], [(a, 1, []), (b, 2, s1 )]] and
[[(a, 1, []), (b, 1, [])], [(a, 1, []), (b, 2, s1 )], [(a, 1, []), (b, 2, s2 )]]
with s1 = [[(a, 1, []), (b, 1, [])]] and s2 = [[(a, 1, []), (b, 1, [])], [(a, 1, []), (b, 2, s1)]]
become identical if the links are removed. One has to add extra annotations to
the stack to tell them apart without links.
We explain briefly why luminosity is needed in the decidability proof in [15].
The proof reduces the order of the CPDA by one (a configuration of an n-CPDA
is represented as a sequence of configurations in an (n − 1)-CPDA), at the cost
of creating a more complicated formula. This reduction allows to deal with the
operational aspect of links (that is, with the collapse operation). However, there
is also the problem of preserving identities, to which first-order logic is sensitive.
For this reason, the reduction would be incorrect, if by removing links from two
different configurations, suddenly they would become equal.
Let us emphasize that we are not trying to simulate the operational behavior
of links in a 3-CPDA after removing them. We only want to construct another
3-CPDA with the same G/ε , which still uses links of order-3, but such that
stripln(s) = stripln(s ) implies s = s .
Our construction is quite similar to that from [15] (which works for such n-
CPDA which only have links of order n). The key idea which allows to extend
it to 3-CPDA which also have links of order 2, is to properly assign the value of
“generation” (see below) to atoms with links of order 2.
Fix a 3-CPDA A with a stack alphabet Γ . W.l.o.g. we assume that A “knows”
what is the link order in each atom, and that it does not perform collapse on
links of order 1. We will construct a luminous 3-CPDA A with stack alphabet
Γ = Γ × {1>, 1=, 1<} × {2>, 2=, 2<, ¬2} × {3≥, 3<, ¬3}.
To obtain luminosity, it would be enough to mark for each atom (in particular
for atoms with links of order 3), whether it was created at its position, or copied
from the 1-stack below, or copied from the 2-stack below. Of course we cannot do
this for each atom independently, since when a whole stack is copied, we cannot
change markers in all its atoms; thus some markers are needed also on top of
1-stacks and 2-stacks.
There is an additional difficulty that all markers should be placed as a function
of a stack, not depending on how the stack was constructed (otherwise one node
First-Order Logic on CPDA Graphs 305
in G/ε (A) would be transformed into several nodes in G/ε (A )). Thus when an
atom is created by push1a,l we cannot just mark it as created here, since equally
well an identical atom could be copied from a stack below. However, an atom
with a link pointing to the 3-stack containing all the 2-stacks below cannot
be a copy from the previous 2-stack. We can also be sure about this for some
atoms with links of order 2, namely those whose link target already contains an
atom with such “fresh” link of order 3. For these reasons, for each k-stack s (for
0 ≤ k ≤ 2), including s = [], we define gn(s), the generation of s:
gn([]) := 0,
gn([s1 , . . . , sm ]) := max(0, max gn(si )),
1≤i≤m
⎧
⎨ |t| + 1 if k = 3,
gn((a, k, t)) := gn(t) if k = 2,
⎩
−1 if k = 1.
Intuitively, gn(s) is a lower bound for the height of the 3-stack of the CPDA
at the moment when s was last modified (or created). For convenience, the
generation of an atom with a link of order 1 is smaller than the generation of
any k-stack for k > 0, and the generation of any atom with a link of order 3 is
greater than the generation of the empty stack.
For each constructible 3-stack s over Γ we define its marked variant mar(s),
which is obtained by adding markers at each position x of s as follows.
– Let i ∈ {1, 2} and r ∈ {>, =, <}, or i = 3 and r ∈ {≥, <}. If x is the topmost
position in its (i − 1)-stack (always true for i = 1), we put marker ir at x if
– Assume that x is not topmost in its 1-stack, and the position directly above it
has assigned marker 1<. Let t be the atom just above x, and let y be the high-
est position in s≤x (in the lexicographic order) such that gn(top2 (s≤y )) <
gn(t). We put marker 2r at x if
y again becomes the topmost position. Necessarily, the marker from y will be
also present at positions x which are copies of y. Notice however that when we
remove an atom at position x using pop1 , and then we reproduce an identical
atom using push1a,k , the 2r marker has to be written there again (mar should be
a function of the stack). For this reason the x containing the 2r marker from y
is not necessarily a copy of y: we store the marker in the highest atom below an
atom from the higher generation. See Figure 1 for an example.
Fig. 1. An example 2-stack (one out of many in a 3-stack). It grows from left to right.
We indicate all 1r and 2r markers, as well as the generation of atoms (bold; no number
for generation −1). To calculate the 2< marker at positions (1, 3), (3, 3), and (4, 2)
we have used position (1, 3) as y. Observe the atom of generation 2 above an atom of
generation 3; this is possible for an atom with a link of order 2.
The key property is that the markers can be updated by a CPDA. We will
say that a CPDA defines a path if from each configuration there is at most one
transition available.
Proof (sketch). This is a tedious case analysis. In most cases we just have to
apply a local change of markers. For a push, we update markers in the previously
topmost atom (depending on markers which were previously there), then we
perform the push, and then we update markers in the new topmost atom. For
popk or collapse, we perform this operation, and then we update markers in the
atom which became topmost, depending on markers in this atom, and in the
atom which was topmost previously.
There is one exception from this schema, during such push1a,k operation which
increases the generation of the topmost 1-stack, but not of the topmost 2-stack.
In this situation in the previously topmost atom we should place a 2r marker,
First-Order Logic on CPDA Graphs 307
the same as in the atom just below the bottommost atom having the highest
generation in the 2-stack. This information is not available locally; to find this
atom (and the marker in it), we copy the topmost 2-stack (push3 ), we destruc-
tively search for this atom (which is easy using the markers), and then we remove
the garbage using pop3 .
where eq k (s, t) states that s and t differ at most in their topmost k-stacks, that
is eq 4 (s, t) := true, and for 1 ≤ k ≤ 3,
popk+1 popk+1 popk+1
eq k (s, t) := ∃u.(s −−−−→ u ∧ t −−−−→ u) ∨ (eq k+1 (s, t) ∧ ¬∃u.(s −−−−→ u)).
Next, we define two sets of substacks of a 4-stack s which can be easily accessed
in FO. The set vis4 (s) contains s and the stacks t for which in top3 (s) there is
the atom ( , 4, t). The set vis3 (s) contains s and the stacks t for which pop(s) =
pop(t) and in top2 (s) there is the atom ( , 3, top3 (t)). When s is constructible,
the property that t ∈ visk (s) (for k ∈ {3, 4}) can be expressed by the FO formula
popk collapse
visk (s, t) := ∃u.(u −−−→ s ∧ link k (u) ∧ u −−−−−→ t).
To every constructible 4-stack s we assign a finite graph G(s) as follows.
Its nodes are V := vis4 (s). Two nodes t, u ∈ V are connected by an edge when
top0 (v) = ( , 4, u) for some v ∈ vis3 (t), or top0 (v) = ( , 4, t) for some v ∈ vis3 (u).
Lemma 6. For each non-empty finite graph G there exists a constructible (4, 4)-
stack sG (in the domain of G con (A)) such that G is isomorphic to G(sG ).
Proof. Suppose that G = (V, E) where V = {1, 2, . . . , k}. The proof is by in-
duction on k. If k = 1, as sG we just take the (constructible) 4-stack consisting
of one atom ( , 1, []). Assume that k ≥ 2. For 1 ≤ i < k, let Gi be the sub-
graph of G induced by the subset of nodes {1, 2, . . . , i}, and let si := sGi be the
stack corresponding to Gi obtained by the induction assumption. We will have
pop4 (sG ) = sk−1 , and top3 (sG ) = tk , where 3-stacks ti for 0 ≤ i ≤ k are defined
by induction as follows. We take t0 = []. For i > 0 we take take pop(ti ) = ti−1 ,
and the topmost 2-stack of ti consists of one or two 1-stacks. Its first 1-stack is
[( , 1, []), ( , 4, s1 ), ( , 4, s2 ), . . . , ( , 4, sk−1 ), ( , 3, t0 ), ( , 3, t1 ), . . . , ( , 3, ti−1 )].
If (i, k) ∈ E we only have this 1-stack; if (i, k) ∈ E, in top2 (ti ) we also have the
1-stack
[( , 1, []), ( , 4, s1 ), ( , 4, s2 ), . . . , ( , 4, si )].
First-Order Logic on CPDA Graphs 309
We notice that vis4 (sG ) contains stacks s1 , s2 , . . . , sk−1 , sG , and vis3 (sG ) con-
tains all stacks obtained from sG by replacing its topmost 3-stack by ti for some
i ≥ 1. It follows that G(sG ) is isomorphic to G.
It is also easy to see that sG is constructible. We create it out of sk−1 by
performing push4 and appropriately changing the topmost 3-stack. Notice that
the bottommost 1-stack of top3 (sk−1 ) starts with ( , 1, []), ( , 4, s1), ( , 4, s2 ), . . . ,
( , 4, sk−2 ). We uncover this prefix using a sequence of popi operations. We
append ( , 4, sk−1 ) and ( , 3, t0 ) by push1,4 and push1,3 . If (1, k) ∈ E, we create
the second 1-stack using push2 and a sequence of pop1 . This already gives the
first 2-stack. To append each next (i-th) 2-stack, we perform push3 ; we remove
the second 1-stack if it exists using pop2 ; we append ( , 3, ti−1 ) using push1,3 ; if
necessary we create the second 1-stack using push2 and a sequence of pop1 .
For the rest of the section fix a CPDA A of order n, with stack alphabet
Γ . The key idea of the proof is that an FO formula can inspect only a small
topmost part of the stack, and check equality of the parts below. Thus instead
of valuating variables into stacks, it is enough to describe how the top of the
stack looks like, and which stacks below are equal. When the size of the described
top part of the stack is fixed, there are only finitely many such descriptions. For
each quantifier in the FO sentence we will be checking all possible descriptions
of fixed size (of course the size of the described part has to decrease with each
next variable). To formalize this we define generalized stacks.
310 P. Parys
app2 first2 app1 (app1 (first1 (cons(a, 1, [])), cons(b, 1, [])), cons(c, 1, [])) ,
It holds
(app2 (first2 (app1 (x1 , cons(c, 1, []))), app1 (x1 , cons(c, 1, [])))) "→2 (s),
where the valuation maps x1 into app1 (first1 (cons(a, 1, [])), cons(b, 1, [])). On the
other hand it does not hold that (app2 (first2 (y 1 ), app1 (x1 , cons(c, 1, [])))) "→2 (s);
the problem is that the two 1-stacks of s were equal, while they are different
in this generalized 2-stack. This shows that we cannot just cut our stack at
one, fixed depth, and place constants in all places at this depth. In fact, for
some stacks, we need to place some constants exponentially deeper than other
constants. As a consequence, our algorithm will be nonelementary (we have to
increase d exponentially with each quantifier).
When a formula (having already some generalized stacks assigned to its free
variables) starts with a quantifier, as a value of the quantified variable we want
to try all possible generalized stacks which are of a special form, as described by
the following definition. Let S1 , . . . , Sm , Sm+1 (for m ≥ 0) be generalized stacks,
let d ∈ N, and d := d + 2d+1 . We say that Sm+1 is d-normalized with respect
to (S1 , . . . , Sm ) if
The key point is that for fixed S1 , . . . , Sm there are only finitely many d-
normalized generalized stacks Sm+1 (up to renaming of fresh constants), so we
can try all of them. The next two lemmas say that to consider d-normalized
generalized stacks is exactly what we need.
Proof (sketch). It is enough to map the constants appearing in Sm+1 but not in
Si for i ≤ m into “fresh” stacks, such that none of them is a substack of any
other nor of any si for i ≤ m (the latter is easy to obtain by taking these stacks
to be bigger than all si ).
We also easily see that the atomic FO formulae can evaluated on the level of
generalized stacks related by the "→n+1 to the actual stacks.
Using the last three lemmas we can check whether an FO sentence holds
in G ano (A). Indeed, for each quantifier we check all possible generalized stacks
which are d-normalized with respect to the previously fixed variables, for big
enough d (depending on the quantifier rank of the formula, so that the induction
works fine), and we deal with atomic formulae using Lemma 11.
References
1. Maslov, A.N.: The hierarchy of indexed languages of an arbitrary level. Soviet
Math. Dokl. 15, 1170–1174 (1974)
2. Maslov, A.N.: Multilevel stack automata. Problems of Information Transmis-
sion 12, 38–43 (1976)
First-Order Logic on CPDA Graphs 313
3. Knapik, T., Niwiński, D., Urzyczyn, P.: Higher-order pushdown trees are easy. In:
Nielsen, M., Engberg, U. (eds.) FOSSACS 2002. LNCS, vol. 2303, pp. 205–222.
Springer, Heidelberg (2002)
4. Parys, P.: Collapse operation increases expressive power of deterministic higher
order pushdown automata. In: Schwentick, T., Dürr, C. (eds.) STACS. LIPIcs,
vol. 9, pp. 603–614. Schloss Dagstuhl, Leibniz-Zentrum fuer Informatik (2011)
5. Parys, P.: On the significance of the collapse operation. In: LICS, pp. 521–530.
IEEE (2012)
6. Hague, M., Murawski, A.S., Ong, C.-H.L., Serre, O.: Collapsible pushdown au-
tomata and recursion schemes. In: LICS, pp. 452–461. IEEE Computer Society
(2008)
7. Knapik, T., Niwiński, D., Urzyczyn, P., Walukiewicz, I.: Unsafe grammars and
panic automata. In: Caires, L., Italiano, G.F., Monteiro, L., Palamidessi, C., Yung,
M. (eds.) ICALP 2005. LNCS, vol. 3580, pp. 1450–1461. Springer, Heidelberg
(2005)
8. Caucal, D.: On infinite terms having a decidable monadic theory. In: Diks, K.,
Rytter, W. (eds.) MFCS 2002. LNCS, vol. 2420, pp. 165–176. Springer, Heidelberg
(2002)
9. Cachat, T.: Higher order pushdown automata, the Caucal hierarchy of graphs and
parity games. In: Baeten, J.C.M., Lenstra, J.K., Parrow, J., Woeginger, G.J. (eds.)
ICALP 2003. LNCS, vol. 2719, pp. 556–569. Springer, Heidelberg (2003)
10. Carayol, A., Wöhrle, S.: The Caucal hierarchy of infinite graphs in terms of logic
and higher-order pushdown automata. In: Pandya, P.K., Radhakrishnan, J. (eds.)
FSTTCS 2003. LNCS, vol. 2914, pp. 112–123. Springer, Heidelberg (2003)
11. Kartzow, A.: Collapsible pushdown graphs of level 2 are tree-automatic. Logical
Methods in Computer Science 9(1) (2013)
12. Broadbent, C.H.: On collapsible pushdown automata, their graphs and the power
of links. PhD thesis, University of Oxford (2011)
13. Broadbent, C.H.: Prefix rewriting for nested-words and collapsible pushdown au-
tomata. In: Czumaj, A., Mehlhorn, K., Pitts, A., Wattenhofer, R. (eds.) ICALP
2012, Part II. LNCS, vol. 7392, pp. 153–164. Springer, Heidelberg (2012)
14. Broadbent, C.H.: The limits of decidability for first order logic on CPDA graphs. In:
Dürr, C., Wilke, T. (eds.) STACS. LIPIcs, vol. 14, pp. 589–600. Schloss Dagstuhl,
Leibniz-Zentrum fuer Informatik (2012)
15. Broadbent, C.H.: On first-order logic and CPDA graphs. Accepted to Theory of
Computing Systems
16. Broadbent, C.H., Carayol, A., Hague, M., Serre, O.: A saturation method for col-
lapsible pushdown systems. In: Czumaj, A., Mehlhorn, K., Pitts, A., Wattenhofer,
R. (eds.) ICALP 2012, Part II. LNCS, vol. 7392, pp. 165–176. Springer, Heidelberg
(2012)
17. Kartzow, A., Parys, P.: Strictness of the collapsible pushdown hierarchy. In: Rovan,
B., Sassone, V., Widmayer, P. (eds.) MFCS 2012. LNCS, vol. 7464, pp. 566–577.
Springer, Heidelberg (2012)
18. Trachtenbrot, B.: Impossibility of an algorithm for the decision problem in finite
classes. Doklady Akad. Nauk. 70, 569–572 (1950)
Recognizing Two-Sided Contexts in Cubic Time
Max Rabkin
Saarland University
max.rabkin@gmail.com
1 Introduction
Barash and Okhotin (2012) introduced grammars with one-sided contexts, ex-
tending context-free and conjunctive grammars with quantifiers allowing pro-
ductions to depend on their context on the left-hand side. They later extended
this to allow context on both sides (Barash and Okhotin, 2013).
This notion of context is purely syntactic, and therefore quite different to for-
mulations of context in terms of rewriting systems, such as the context-sensitive
grammars. To determine whether a substring is matched by a non-terminal in a
grammar with two-sided contexts, one need only examine the string. In a classi-
cal context-sensitive, this question does not make sense: one must consider not
only the string itself, but also the appropriate step of a particular derivation.
Derivations in grammars with two-sided contexts, like in context-free grammars,
do not require any notion of time-steps. This means one can draw meaningful
parse trees (actually directed acyclic graphs) for derivations.
In the first paper, Barash and Okhotin gave a cubic-time algorithm for rec-
ognizing the languages generated by these grammars which is similar to the
Cocke-Kasami-Younger (CKY) algorithm for context-free languages. In the sec-
ond,
they gave a recognition
algorithm in the style of Valiant (1975) which takes
O |G| · n2 space and O |G|2 · nω+1 time, where O(nω ) is the complexity of
multiplying n × n boolean matrices. The best known bound is 2 ≤ ω < 2.3727
(Williams, 2012). Their algorithm works on grammars in binary normal form; it
is not known whether this form can be achieved with sub-exponential blow-up.
We give an algorithm which takes only O |G| · n3 time. This algorithm is
derived from the definition of two-sided contexts using deduction systems: we
give a normal form (separated normal form) for the grammars such that the
corresponding deduction can be efficiently computed using standard techniques.
However, some specialization is required to keep the space usage quadratic. Our
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 314–324, 2014.
c Springer International Publishing Switzerland 2014
Recognizing Two-Sided Contexts in Cubic Time 315
normal form allows ε-rules and unit rules, and so can be achieved with only
linear increase in the size of the grammar.
The speed-up can be seen as arising from the improved resolution of dependen-
cies between sub-problems. In the context-free case, the syntactic properties of
a string (i.e., the non-terminals which match it) depend only on its substrings.
With left contexts, the properties of a string-in-context uvw depend on the
substrings of uv. In either case, we can resolve the dependencies by comput-
ing the properties of substrings in a fixed order. As Barash and Okhotin (2013)
noted, the dependencies between substrings are more complicated in the case
of grammars with two-sided contexts; and therefore their algorithm requires
O(|N | · n) passes to ensure all properties have been recognized, where N is the
set of non-terminals in the grammar. In our algorithm the dependencies are
resolved implicitly, so only a single pass is required.
2 Definitions
Informally, a string in context is simply a string considered as a part of a larger
string. Formally, a string-in-context is a triple of strings uvw, where u and w
are the left and right context of v. That is, uvw is v seen as a substring of uvw.
Concatenation of strings-in-context must respect contexts: the concatenation of
uvv w and uvv w is uvv w, but is not defined for pairs that are not of
this form. In particular, our concept of contexts cover the whole string: the left
context includes everything before the substring, and the right context includes
everything after.
For example, if x = hello world and y = hello world, then we have
xy = hello world. On the other hand, hello world and hello earth can-
not be concatenated. A string with empty contexts, such as εhelloε, cannot be
a strict substring of any string.
We give here an informal description of grammars with two-sided contexts;
we will give a formal definition below. These grammars are similar to context-
free grammars but allow rules with conjunction and context quantifiers. Non-
terminals and sentential forms of the grammar should be considered as properties
of terminal strings-in-context; we will not use rewriting systems. For example,
the rule A → BC should be read as meaning that if x and y have properties B
and C respectively, then xy has property A.
A string-in-context has the property α & β if it has properties α and β.
There are four context quantifiers: α denotes the property of strings which are
preceded by a string with property α, i.e., uvw has property α if εuvw has
property α; denotes a property of a string including its left context, i.e., uvw
has property α if εuvw has property α; the right context quantifiers, and
, have symmetrical interpretations. For example, a rule A → BC & D means
that a string has property A if it is of the form BC and is followed by a string
with property D.
Definition 1. A grammar with two-sided contexts is a tuple G = (Σ, N, R, S)
where Σ is the terminal alphabet, N is the non-terminal alphabet, S ∈ N is the
316 M. Rabkin
A → α1 & · · · & αm ,
We retain the term non-terminal due to its familiarity, but in the absence of
rewriting systems perhaps atomic property would be more descriptive.
We define the semantics grammars with two-sided contexts by means of de-
duction systems. We will use atoms of the form [α, uvw] where u, v, w ∈ Σ ∗
and α has the form of a right-hand side of rule.
Definition 2. Let G = (Σ, N, R, S) be a grammar with two-sided contexts. Then
we create a deduction system /G with the axiom schemes:
/G [ε, uεw]
/G [a, uaw] a∈Σ
3 Examples
S→$
S → LSA
J →ε
J → AJ
⎫
A→σ ⎪
⎪
⎪
L → σ & Cσ ⎬
σ ∈ {a, b}.
Cσ → $Jσ ⎪
⎪
⎪
⎭
Cσ → ACσ A
If we ignore the context condition on the rule for L, this grammar simply matches
{x$y : |x| = |y| and x, y ∈ {a, b}∗ }. However, Cσ matches strings of the form
x$yσz where |x| = |z|, so the context condition on the rule for L ensures that,
for every σ in the left-hand part, a σ also appears in the corresponding position
(counting from the end) of the right-hand part. Thus L(G) = {x$x : x ∈ {a, b}∗}.
The following example derivation shows that a$a ∈ L(G):
/G [a, εa$a]
/G [$, a$a]
/G [a, a$aε]
/G [ε, a$εa]
[ε, a$εa] /G [J, a$εa]
[$, a$a], [J, a$εa] /G [$J, a$a]
[$J, a$a], [a, a$aε] /G [$Ja, a$aε]
[$Ja, a$aε] /G [Ca , a$aε]
[Ca , a$aε] /G [Ca , εa$a]
[a, εa$a], [Ca , εa$a] /G [a & Ca , εa$a]
[a & Ca , εa$a] /G [L, εa$a]
[$, a$a] /G [S, a$a]
[L, εa$a], [S, a$a] /G [LS, εa$a]
[a, a$aε] /G [A, a$aε]
[LS, εa$a], [A, a$aε] /G [LSA, εa$aε]
[LSA, εa$aε] /G [S, εa$aε].
J
Fig. 1. A parse tree for a$a
Example 4. Let G = ({a}, {A, S}, R, S) where R contains the following rules:
S→a
S → AS
A → a & S.
This grammar is in both binary and separated normal forms, and matches the
language aa∗ .
In a run of Barash and Okhotin’s Algorithm 1, each pass examines the sub-
strings of w from left to right (by ending position). However, to deduce anything
in G, we must work from right to left. Therefore, the algorithm can only make
one deduction in each pass, but Θ(n) deductions are required.
4 Normal Form
The recognition algorithm of Barash and Okhotin (2013) requires grammars to
be in a normal form similar to Chomsky normal form, called binary normal form.
Our algorithm will not be adversely affected by ε-productions, but cannot
efficiently handle productions with more than one concatenation (e.g. A → BC &
DE or A → BCD), so we will use a normal form which excludes these cases.
Definition 5. A grammar with two-sided contexts G = (Σ, N, R, S) is said to
be in separated normal form (SNF) if each rule in R is in one of the following
forms:
A→ε
A→a
A → QB
A → B1 B2
A → B1 & · · · & Bm
Recognizing Two-Sided Contexts in Cubic Time 319
In fact, the system /G is exactly the system of Barash and Okhotin (2013,
Definition 2) restricted to SNF; they give a single scheme for deduction rules,
with a complex side-condition, which entails all of ours.
Lemma 8. If G = (Σ, N, R, S) is a grammar in SNF, A ∈ N , and x is a
string-in-context over Σ, then /G [A, x] if and only if /G [A, x].
Proof. Completeness of /G with respect to /G can be shown by a straightforward
induction on the length of proofs in /G .
Soundness can be seen from the fact that every axiom in /G is obtained from
an axiom of /G followed by a single deduction step, and every deduction rule is
obtained by combining rules of /G .
320 M. Rabkin
5 Algorithm
To recognize a string x of length n, we will
construct a set of Horn clauses
from a grammar G in SNF of size O |G| · n3 . We can then apply a linear-time
algorithm for Horn satisfiability (Dowling and Gallier, 1984). The Horn clauses
are derived from the deduction rules used to define the semantics of a grammar
with two-sided contexts, interpreted as logical implications, except that we only
include those which relate to substrings(-in-context) of x. The restriction to SNF
ensures the size of this set is at most cubic in n.
The idea of parsing by interpreting grammar rules as logical implications is
due to Colmerauer and Kowalski (Kowalski, 1979, Chapter 3). Shieber et al.
(1995) noted that when this interpretation is applied to context-free grammars
in Chomsky normal form, one can obtain an efficient algorithm similar to the
CKY algorithm.
We define a set of axioms from which we can prove that a string belongs to
the language of a given grammar with two-sided contexts.
We use the symbols ⇒ and ∧ for logical implication and conjunction, respec-
tively. In a logical formula of the form φ1 ∧ · · · ∧ φm ⇒ ψ, we call φ1 , . . . , φm
the antecedents and ψ the consequent. We will sometimes consider a formula
consisting of a single propositional atom ψ to be an implication with consequent
ψ and no antecedents.
Definition 9. Let G = (Σ, N, R, S) be a grammar with two-sided contexts in
SNF, and let x ∈ Σ ∗ have length n. We will use only atoms of the form [A, uvw]
where A ∈ N and uvw = x.
Construct Axioms(G, x) = r∈R f (r), where
f (A → ε) = {[A, uεw] : uw = x}
f (A → a) = {[A, uaw] : uaw = x}
f (A → B1 B2 ) = {[B1 , uv1 v2 w] ∧ [B2 , uv1 v2 w] ⇒ [A, uv1 v2 w]
: uv1 v2 w = x}
f (A → B1 & · · · & Bm ) = {[B1 , uvw] ∧ · · · ∧ [Bm , uvw] ⇒ [A, uvw]
: uvw = x}
f (A → B) = {[B, εuvw] ⇒ [A, uvw] : uvw = x}
f (A → B) = {[B, εuvw] ⇒ [A, uvw] : uvw = x}
f (A → B) = {[B, uvwε] ⇒ [A, uvw] : uvw = x}
f (A → B) = {[B, uvwε] ⇒ [A, uvw] : uvw = x}
and Ax(G, x) = r∈R f (r), where R ⊂ R is the set of rules not of the form
A → B1 B2 .
Axioms(G, x) is essentially a restatement of the definition of /G . Thus, by
Lemma 8, uvw ∈ LG (A) if and only if Axioms(G, 3 uvw) / [A, uvw].
From each rule of
G we constructed
a set of O n axioms, so the total size of
Axioms(G, x) is O |G| · n3 atoms. The only rules which lead to a cubic
number
of axioms are those of the form A → B1 B2 , so Ax(G, x) has size O |G| · n2 .
Recognizing Two-Sided Contexts in Cubic Time 321
Each axiom is a Horn clause, and the set of atoms which can be deduced
from a set of Horn clauses can be computed in linear time (Dowling and Gallier,
1984, Algorithm 2). Combining such a procedure with the SNF transformation
and Axioms(G, x) yields Algorithm 1 for recognizing the language of a grammar
with two-sided contexts.
Algorithm 1.
function HornConsequences(Γ )
Requires: Γ is a set of Horn clauses
Returns: {ψ : Γ ψ, ψ is an atom}
Q ← {ψ : ψ ∈ Γ, ψ is an atom} — queue of atoms to resolve
P ←Q — set of atoms that have been deduced
while Q = ∅ do
remove any atom φ from Q
mark every occurrence of φ in Γ
for φ1 ∧ · · · ∧ φm ⇒ ψ ∈ Γ with φ1 , . . . , φm all marked do
remove φ1 ∧ · · · ∧ φm ⇒ ψ from Γ
if ψ ∈ P then
add ψ to Q
add ψ to P
return P
function Recognize(G, x)
(Σ, N, R, S) ← SNF(G)
Γ ← Axioms((Σ, N, R, S), x)
return [S, εxε] ∈ HornConsequences(Γ )
6 Evaluation
Lemma 11. ParseSnf(G, x) has running time O |G| · |x|3
Proof. All the initialisation clearly takes O |G| · |x|2 time.
Lines 19, 25, 30 and 33 are in each of the innermost loops.
Line 19 and line 25 are each run at most once
for each appearance of an atom
as an antecedent in Ax(G, x), i.e. O |G| · |x|2 times.
Lines 30 and 33 are run at most once for each tuple (r, u, v, v , w ) where r is
a rule of the form A → BC and uvv w = x. There are O |G| · |x|3 such tuples.
Lemma 12. ParseSnf(G, x) requires O |G| · |x|2 space.
Proof. The algorithm treats O |G| · |x|2 atoms; each of these can appear at
most once in each of P , Q, Starts and Ends.
There is one entry in appearances[φ] for each appearance of φ as an antecedent
in Ax(G, x), so the total size of the appearances array is at most the size of
Ax(G, x). There is one entry in each of antecedents and consequent for each
axiom in Ax(G, x).
Since |Ax(G, x)| ∈ O |G| · |x|2 , and the variables
not
mentioned above use
only constant space, the total space usage is O |G| · |x|2 .
Recognizing Two-Sided Contexts in Cubic Time 323
Algorithm 2.
1: function ParseSnf(G, x)
2: Requires: G = (Σ, N, R, S) in SNF, x ∈ Σ ∗
3: Returns: {ψ : Axioms(G, x) ψ, ψ is an atom}
4: Q←∅ — queue of atoms to resolve
5: P ←∅ — atoms that have been deduced
6: starts[A][i] ← ∅ for A ∈ N and i ∈ {0, . . . , |x|}
7: ends[A][i] ← ∅ for A ∈ N and i ∈ {0, . . . , |x|}
8: appearances[φ] ← ∅ for each atom φ — axioms where φ is an antecedent
9: procedure Proved(ψ = [A, uvw])
10: if ψ ∈ P then
11: add ψ to Q and P
12: add ψ to starts[A][|u|] and ends[A][|uv|]
22: while Q = ∅ do
23: remove any atom φ = [B, uvw] from Q
24: for i ∈ appearances[φ] do
25: antecedents[i] ← antecedents[i] − 1
26: if antecedents[i] = 0 then
27: Proved(consequent[i])
28: for A → BC ∈ R do
29: for [C, uvv w ] ∈ starts[C][|uv|] do
30: Proved([A, uvv w ])
31: for A → CB ∈ R do
32: for [C, u v vw] ∈ ends[C][|u|] do
33: Proved([A, u v vw])
34: return P
35: function Recognize(G, x)
36: G = (Σ, N, R, S) ← SNF(G)
37: return [S, εxε] ∈ ParseSnf(G , x)
324 M. Rabkin
Proof. By Lemma 10, 11 and 12, the function Recognise from Algorithm 2
recognizes such languages with the desired complexity.
Parse trees correspond to proofs of [S, εxε], so a parse forest can be obtained
by modifying ParseSnf to record all the ways in which each atom is proved.
References
Barash, M., Okhotin, A.: Defining contexts in context-free grammars. In: Dediu, A.-
H., Martı́n-Vide, C. (eds.) LATA 2012. LNCS, vol. 7183, pp. 106–118. Springer,
Heidelberg (2012)
Barash, M., Okhotin, A.: Grammars with two-sided contexts. Tech. Rep. 1090, Turku
Centre for Computer Science (2013),
http://tucs.fi/publications/view/?pub_id=tBaOk13b
Dowling, W.F., Gallier, J.H.: Linear-time algorithms for testing the satisfiability of
propositional Horn formulae. The Journal of Logic Programming 1(3), 267–284
(1984)
Kowalski, R.: Logic for problem-solving. North-Holland Publishing Co. (1979),
http://www.doc.ic.ac.uk/~ rak/
Okhotin, A.: Conjunctive and boolean grammars: the true general case of the context-
free grammars. Computer Science Review 9, 27–59 (2013)
Shieber, S.M., Schabes, Y., Pereira, F.C.N.: Principles and implementation of deductive
parsing. The Journal of Logic Programming 24(1-2), 3–36 (1995)
Valiant, L.G.: General context-free recognition in less than cubic time. Journal of Com-
puter and System Sciences 10(2), 308–315 (1975)
Williams, V.V.: Multiplying matrices faster than Coppersmith-Winograd. In: Proceed-
ings of the 44th Symposium on Theory of Computing, STOC 2012, pp. 887–898.
ACM (2012)
A Parameterized Algorithm for Packing
Overlapping Subgraphs
1 Introduction
Discovering communities in large and complex networks such as social, citation,
or biological networks has been of interest on the last decades. A community
is a part of the network in which the nodes are more highly interconnected to
each other than to the rest. For example, a community can represent a group of
friends in social networks or a protein complex in biological networks. Naturally,
one person can have different groups of friends, and one protein can belong to
more than one protein complex. Therefore, in realistic scenarios, communities
can share members. The problem of finding communities with possible overlap
was formalized as the k-H-Packing with t-Overlap problem in [10].
In the k-H-Packing with t-Overlap problem, the goal is to find at least k
induced subgraphs (the communities) in a graph G (the network) such that each
subgraph is isomorphic to a graph H (a community model) and each pair of
subgraphs overlap in at most t vertices (the shared members)[10]1 .
The k-H-Packing with t-Overlap problem is NP-Complete [10]. Therefore, we
are interested in the design of algorithms that provide a solution in f (k)nO(1)
running time, i.e., fixed-parameter algorithms or FPT-algorithms. In other words,
the running time of a fixed-parameter algorithm is polynomial in the input size
n but possibly exponential or worse in a specified parameter k, usually the
size of the solution. Thus, our fundamental goal is to explore how the overlap
1
To follow standard notation with packing and isomorphism problems, the meaning
of the graphs G and H have been exchanged with respect to their meaning in [10].
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 325–336, 2014.
c Springer International Publishing Switzerland 2014
326 J. Romero and A. López-Ortiz
complexity of the problem. Even though the k-H-packing problem (the vertex-
disjoint version) is well studied, our search tree algorithm is the first one to
consider variable overlap between subgraphs.
The classical k-Set Packing problem asks for at least k pairwise disjoint sets
from a given collection of sets. We introduce a variant of this problem that would
allow overlap between the sets. We show how our search tree algorithm would
work for this variant as well. To the best of our knowledge, this variant of the
k-set packing problem has not been studied before.
This paper is organized as follows. In Section 2, we introduce the terminology
and notation used in the paper. Section 3 describes the details of our search
tree algorithm. In Section 4, we explain how the search tree algorithm can be
applied for a variant of the k-Set Packing problem. Finally, Section 5 states the
conclusion of this work.
The left-side of Figure 1 shows an example of this intersection for the 4-K4 -
Packing with 1-Overlap problem (k = 4, t = 1). The two K4 ’s of the maximal
solution are indicated by solid lines while the four K4 ’s of the k-solution are
indicated with solid and dashed lines. Edges of the graph that do not belong to
any of these solutions are indicated in light gray. The seeds in the example have
size t + 1 = 2. A collection of four feasible seeds is {{1, 3}, {3, 4}, {5, 6}, {6, 8}};
the vertices of these seeds are filled in the figure.
We now proceed to describe the algorithm for the k-H-Packing with t-Overlap
problem. First, we obtain a maximal solution M of G. If the number of H-
subgraphs in M is at least k then M is a k-H-Packing with t-Overlap and the
A Parameterized Algorithm for Packing Overlapping Subgraphs 329
9 1 2 5 6 13
10 3 4 7 8 14
root
11 1 3 ...
12
Qgr ={ } Qi ={{1,3},{3,4},{5,6},{6,8}}
10 11
Ql ={{1,3},{3,4,11},{5,6},{6,8}}
Fig. 1. On the left side, an intersection of a k-solution with a maximal solution of the
4-K4 -Packing with 1-Overlap problem (k = 4 and t = 1). The seeds in this example
are of size t + 1 = 2. To the right, part of the search tree corresponding to the instance
to the left.
Lemma 2. If for a seed sij ∈ Qi all its sponsors are ineligible then Qi cannot
be completed into a k-solution.
with t-Overlap. In the example of Figure 1, one leaf of the search tree would com-
plete the collection into the solution K = {{1, 3} · {9, 10}, {3, 4} · {11, 12}, {5, 6} ·
{4, 7}, {6, 8} · {13, 14}}.
3.1 Correctness
The next basic lemma will help us to prove that the algorithm is correct.
Lemma 4. The Feasible Path. If the graph G has a k-solution then there is at
least one path P on the subtree rooted at a feasible child where each node in P
is feasible.
Proof. The lemma states that there is a path P =< i1 , i2 , . . . , im > such that
each node il in P has the collection Qil = {si1l , . . . , sikl } where sijl ⊆ V (Q∗j ) for
1 ≤ j ≤ k and 1 ≤ l ≤ m. Note that i1 = i.
We prove this claim by induction on the number of levels. At level 1, the first
node of the path is a feasible child of the root and the claim follows.
By Observation 1, each feasible seed in Qi has at least one feasible sponsor.
Let {A∗1 , . . . , A∗k } be the set of feasible sponsors where A∗j is the feasible sponsor
of sij , i.e., K = {si1 · A∗1 , . . . , sik · A∗k }.
Next we show that for the remaining nodes of P , the seeds are updated only
with vertices from the feasible sponsors.
Let us suppose that the greedy algorithm failed to complete a seed sij1 at
level 1. The seed sij1 has at least one feasible sponsor A∗j . Since A∗j is feasible
then it is eligible. Greedy failed to complete sij1 , if the H-subgraph formed with
sij1 and each eligible sponsor of sij1 (including the feasible one A∗j ) overlaps in
more than t vertices with an H-subgraph completed by greedy (i.e., in the set
Qgr ). Therefore at level 2, there is at least one child of the node i1 where
the seed sij1 is updated with one vertex from the feasible sponsor A∗j . That is,
Qi2 = {si11 , . . . , sij1 ∪ v ∗ , . . . , sik1 } where v ∗ ∈ A∗j , and the lemma follows.
Now, let us assume that the lemma is true up to the level h − 1. We next show
that lemma holds for level h. Let < i2 , . . . , ih−1 > be the subpath of P where
one seed in each node is updated with one vertex from the feasible sponsors.
By contradiction, suppose that at level h − 1 greedy could not complete the
i i
seed sjh−1 but there is no child of the node ih−1 such that sjh−1 is updated with
a vertex from the feasible sponsor.
332 J. Romero and A. López-Ortiz
Let us suppose that U ∗ is the set of vertices that has been added to sij1 during
the levels 1, . . . , h − 1. By our assumption, the seed sij1 is feasible, and it has
been updated only with vertices from the feasible sponsor. Therefore, U ∗ ⊂ A∗j .
By Lemma 3, A∗j \U ∗ is a sponsor of sjh−1 . Therefore, the only way that none
i
of the children of ih−1 would update sjh−1 with a vertex from A∗j \U ∗ is if A∗j \U ∗
i
i
is not an eligible sponsor of sjh−1 .
However, this would imply that the H-subgraph sjh−1 · (A∗j \U ∗ ) = sij1 · A∗j
i
overlaps in more than t vertices with some feasible seed sil1 ∈ Qi1 . This contra-
dicts our assumption that the collection Qi1 can be completed into a solution
(feasible child).
Lemma 5. The collection of seeds of the last node l (a leaf ) of a feasible path
is a k-solution.
Proof. By Lemma 4, we know that the collection of seeds of every node in a
feasible path is updated only with vertices from the feasible sponsors. Therefore,
eventually a seed is completed into an H-subgraph of the k-solution. Let us
suppose that k − m seeds, where m ≥ 1, were completed in this way.
We claim now that greedy finds an eligible sponsor for the remaining m seeds.
Assume by contradiction that greedy failed to complete one of these m seeds and
suppose it is slj . Since the collection of a feasible child can be completed into a
solution, and the node l is in a feasible path, then slj should have at least one
eligible sponsor. In that case, the next step would be to create children of the
node l updating the seed slj , contradicting the assumption that the node l is a
leaf.
Theorem 1. The search tree algorithm finds one k-H-Packing with t-Overlap,
if the graph G has at least one.
Proof. Since we are creating a child of the root for each possible selection of k
seeds from the universe of seeds, at least one child is feasible. By Lemma 4, there
is at least one feasible path that starts at this child. By Lemma 5, a k-solution
is given in the collection of the last node of this path.
3.2 Analysis
2
k(t+1)
e r
Lemma 6. The root has at most t+1 children.
r
Proof. There are t+1 distinct sets of t+1 vertices (seeds) from the set of vertices
t+1
of an H-subgraph. Since |M| ≤ k − 1 then there are at most (k − 1) t+1 er
The classical k-Set Packing problem asks for at least k pairwise disjoint sets.
Therefore, the k-Set Packing with t-Overlap problem generalizes that condition
of the problem.
We now apply the search tree algorithm of Section 3 to this problem. First,
Lemma 1 can be restated as follows.
Lemma 9. Let M and K be a maximal Set Packing with t-Overlap and a k-Set
Packing with t-Overlap, respectively. We claim that any Q∗ ∈ K overlaps with
some Q ∈ M in at least t + 1 elements, i.e., |Q∗ ∩ Q| ≥ t + 1. Furthermore, there
is no pair Q∗i , Q∗j ∈ K for i = j that overlaps in the same set of elements with
Q ∈ M, i.e., Q∗i ∩ Q = Q∗j ∩ Q.
Since the size of each set in S is at least t + 1 and at most r, and there
is no pair Qi , Qj in S such that Qi ⊂ Qj , then this lemma follows by similar
arguments as Lemma 1.
A Parameterized Algorithm for Packing Overlapping Subgraphs 335
Once again, we have that sets from a k-Set Packing with t-Overlap K share
some elements with sets from a maximal k-Set Packing with t-Overlap M. Thus,
we can use the notion of feasible seeds to find a k-Set Packing with t-Overlap K.
For this problem, a seed is a subset of size t + 1 from a set in M. In this way,
the universe of seeds is the set of all possible seeds for each set in M.
Now, given a collection Q of k seeds we want to complete it into a k-Set
Packing with t-Overlap. That is, we want to add elements from U to each seed
in Q such that each updated seed is a set of S, and the overlap between any
pair of updated seeds is at most t. In this sense, the term sponsor of a seed s is
redefined as a set of elements from U that updates s as a set of S. Specifically,
we say that A is a sponsor of s, if |s ∩ A| = 0 and s ∪ A ∈ S.
The set Sponsors(s) can be computed as follows. For each set Q ∈ S, if s ⊂ Q
then a sponsor of s is Q\s. Once the set of sponsors for each seed is computed,
the bounded search tree algorithm follows with minor differences. For example,
now Qgr would be a collection of sets each of size at most r instead of H-
completed subgraphs. In the same way, the rule to discard ineligible sponsors
can be applied.
Theorem 3. The search tree algorithm finds one k-Set Packing with t-Overlap
assuming there is at least one.
Since the sets in S have size at most r and |U| = n, then O(nr ) is still an
upper bound for the number of sponsors of the seeds. Thus, the running time of
the algorithm follows as well by Theorem 2.
5 Conclusion
We have introduced the first fixed-parameter algorithm for packing subgraphs
with arbitrary overlap (the k-H-Packing with t-Overlap problem). We have also
provided an insight of the difficulty of packing overlapping subgraphs rather than
vertex-disjoint subgraphs. As discussed in Section 3.3, even overlap of at most
one vertex substantially complicates the analysis of the algorithm. On the other
hand, we show that the algorithm is applicable for a generalized version of the
k-Set Packing problem.
Many leads arise from the results presented here. Naturally, the first one is
to improve of the running time of the algorithm. The second is the design of
data reduction rules to decrease the number of children of the root or to bound
the number of sponsors of the seeds. Finally, alternative parameters besides the
number of the subgraphs could be considered as well.
References
1. Adamcsek, B., Palla, G., Farkas, I., Derenyi, I., Vicsek, T.: Cfinder: locating cliques
and overlapping modules in biological networks. Bioinformatics 22(8), 1021–1023
(2006)
2. Damaschke, P.: Fixed-parameter tractable generalizations of cluster editing.
In: The 6th International Conference on Algorithms and Complexity (CIAC),
pp. 344–355 (January 2006)
3. Fellows, M., Guo, J., Komusiewicz, C., Niedermeier, R., Uhlmann, J.: Graph-based
data clustering with overlaps. Discrete Optimization 8(1), 2–17 (2011)
4. Fellows, M., Heggernes, P., Rosamond, F., Sloper, C., Telle, J.: Finding k dis-
joint triangles in an arbitrary graph. In: The 30th Workshop on Graph-Theoretic
Concepts in Computer Science (WG), pp. 235–244 (2004)
5. Fellows, M., Knauer, C., Nishimura, N., Ragde, P., Rosamond, F., Stege, U.,
Thilikos, D., Whitesides, S.: Faster fixed-parameter tractable algorithms for match-
ing and packing problems. Algorithmica 52(2), 167–176 (2008)
6. Hartung, S., Komusiewicz, C., Nichterlein, A.: On structural parameterizations
for the 2-club problem. In: van Emde Boas, P., Groen, F.C.A., Italiano, G.F.,
Nawrocki, J., Sack, H. (eds.) SOFSEM 2013. LNCS, vol. 7741, pp. 233–243.
Springer, Heidelberg (2013)
7. Komusiewicz, C., Sorge, M.: Finding dense subgraphs of sparse graphs. In: 7th
International Symposium on Parameterized and Exact Computation (IPEC),
pp. 242–251 (2012)
8. Moser, H.: A problem kernelization for graph packing. In: Nielsen, M., Kučera,
A., Miltersen, P.B., Palamidessi, C., Tůma, P., Valencia, F. (eds.) SOFSEM 2009.
LNCS, vol. 5404, pp. 401–412. Springer, Heidelberg (2009)
9. Prieto, E., Sloper, C.: Looking at the stars. Theoretical Computer Science 351(3),
437–445 (2006)
10. Romero, J., López-Ortiz, A.: The G-packing with t-overlap problem. In: Pal, S.P.,
Sadakane, K. (eds.) WALCOM 2014. LNCS, vol. 8344, pp. 114–124. Springer,
Heidelberg (2014)
11. Schäfer, A., Komusiewicz, C., Moser, H., Niedermeier, R.: Parameterized computa-
tional complexity of finding small-diameter subgraphs. Optimization Letters 6(5),
883–891 (2012)
Crossing-Free Spanning Trees in Visibility
Graphs of Points between Monotone
Polygonal Obstacles
1 Introduction
A geometric graph is a graph whose vertices are points in the plane. Two distinct
edges {u1 , v1 } and {u2 , v2 } in such a graph cross if the straight line segments
u1 v1 and u2 v2 have a point in common that is not an endpoint of both edges. A
subgraph of a geometric graph is crossing-free if it does not contain any crossing
edges (cf. Fig. 1(a)). Rivera-Campo [21] gave the following sufficient condition
for the existence of a crossing-free spanning tree in a geometric graph G = (V, E)
with n ≥ 5 vertices:
(I5 ) For every 5-element subset U ⊆ V , the induced subgraph G[U ] has a
crossing-free spanning tree.
He conjectured that the constant 5 in condition (I5 ) can be replaced by n − 1
which, in turn, would imply that it can be replaced by any k ∈ {2, 3, . . . , n},
yielding a family of conditions (Ik ). Moreover, he showed that condition (Ik )
is indeed sufficient for the existence of a crossing-free spanning tree for all
k ∈ {2, 3, . . . , n} if the vertex set of the geometric graph is in convex position.
In this paper, we present, for every n ≥ 16, a geometric graph that satisfies
condition (In−1 ) but does not have a crossing-free spanning tree. We obtained
these counterexamples as a byproduct when exploring computationally tractable
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 337–350, 2014.
c Springer International Publishing Switzerland 2014
338 J. Schüler and A. Spillner
Fig. 1. (a) A geometric graph G. The bold edges yield a crossing-free subgraph of G,
but G has no crossing-free spanning tree. (b) The geometric graph (V, E(O)) induced
on a set V of points by a collection O of three polygonal obstacles (drawn shaded). (c)
A geometric graph G = (V, E({C})) induced by a single monotone obstacle C below V .
condition (I3 ) can be relaxed: It suffices that there are at most n − 3 subsets
U ⊆ V with |U | = 3 for which (i) the interior of the convex hull of U does not
contain a vertex v ∈ V and (ii) the induced subgraph G[U ] has no crossing-free
spanning tree. A well-known result established by Károlyi et al. [11] states that
there is no
geometric
graph G = (V, E) such that neither G nor its complement
Gc = (V, V2 − E) has a crossing-free spanning tree. A complete characterization
of the minimal geometric graphs G such that Gc has no crossing-free spanning
tree is given by Keller et al. [12].
Obstacle Representations: Given an abstract graph G = (V , E ), an obstacle
representation of G is a geometric graph G = (V, E(O)) induced by a collection
O of obstacles on a set V of points such that G is isomorphic to G. Alpert
et al. [1] showed that every outerplanar graph has an obstacle representation
(V, E(O)) with |O| = 1 and they present a family of graphs that require an
arbitrarily large number of obstacles to represent them. Subsequently, Pach and
Sarıöz [20] showed that there are even bipartite graphs that require an arbitrarily
large number of obstacles, Mukkamala et al. [19] presented a lower bound of
Ω(n/ log n) on the number of obstacles needed in the worst case for representing
a graph with n vertices and Koch et al. [16] gave a characterization of the
biconnected graphs that have a representation where all obstacles lie in the
unbounded region of the plane outside of the induced geometric graph. Given an
obstacle representation G = (V, E(O)) such that O consists of a single polygon P
that has precisely one hole and all points in V are contained in this hole, Cheng
et al. [3] presented an algorithm that, for any two vertices s, t ∈ V , decides
whether or not G contains a crossing-free path from s to t. The run time of
the algorithm is O(n2 m2 ), where m is the number of corners of P and n = |V |.
Later, Daescu and Luo [5] improved the run time to O(n3 log m + nm).
Monotone Obstacles: A related problem on monotone obstacles that has
received considerable attention over the last years is that of optimal guarding.
In this problem, we want to compute a minimum size set W of points, also
called watchmen, on the upper boundary U of a monotone obstacle C such that
for every point p ∈ U there exists a watchmen w ∈ W that sees p, that is,
the straight line segment wp does not intersect C. There was a series of papers
[2,4,7,13] presenting constant-factor approximation algorithms for this problem,
which was only recently shown to be NP-hard by King and Krohn [14] (see also
[17,18] for hardness results on closely related problems). Our inspiration for re-
stricting the problem CFST to geometric graphs induced by monotone obstacles
came from the work by Gibson et al. [8] who showed that there is a polynomial
time approximation scheme for optimal guarding monotone obstacles while more
general versions of this problem are APX-hard [6].
2 A Combinatorial Characterization
Throughout this paper, we assume that the vertices of geometric graphs and
the corners of obstacles are in general position, that is, no three of them are
340 J. Schüler and A. Spillner
collinear and no two of them have the same x- or y-coordinate. Moreover, for
any two points p and q in the plane, we will say that p lies to the left/right of q if
p has a smaller/larger x-coordinate than q.
Often, when the intended meaning is clear
from the context, we will identify an edge
{u, v} in a geometric graph and the straight
line segment uv. We denote, for any finite
non-empty set V of points in the plane, by
chtop (V ) the upper boundary of the convex
hull of V , that is, the set of all those points Fig. 2. A geometric graph G =
that we meet when moving in clockwise di- (V, E) with the vertices in Vtop
rection along the boundary of the convex drawn as empty circles and the edges
hull of V from its leftmost to its rightmost in Etop drawn bold
point. In addition, for any geometric graph
G = (V, E), we denote by Vtop the set of those vertices in V that are contained
in chtop (V ) and, similarly, by Etop the set of those edges in E that are contained
in chtop (V ) (cf. Fig. 2). We will use the following observation from [21].
Observation 1. Let G = (V, E) be a geometric graph with n ≥ 3 vertices that
are in convex position. Then every crossing-free spanning tree of G must contain
at least two edges that lie on the boundary of the convex hull of V .
In addition, we also rely on the following fact that can be viewed as a dual
version of Observation 1 and that can easily be verified by induction on the
number of vertices of the geometric graph (it clearly holds for graphs with n =
3 vertices and, for n ≥ 4 vertices, any edge naturally partitions the graph into
two smaller subgraphs to which the induction hypothesis can be applied).
Observation 2. Let G = (V, E) be a geometric graph with n ≥ 3 vertices that
are in convex position. If G contains no edges that lie on the boundary of the
convex hull of V then every crossing-free spanning subgraph of G has at least
three connected components.
Next, we explore some properties that are very similar in spirit to Rivera-
Campo’s conditions (Ik ) mentioned in the introduction. To formally describe
these properties, we first introduce some more notation. Let G = (V, E) be a
geometric graph with n vertices and let k ∈ {0, 1, 2, . . . , n}. We say that G is
k-Steiner if for every k-element subset K ⊆ V there exists a crossing-free subtree
T = (V , E ) of G with K ⊆ V . Note that such a tree T can be viewed as a
crossing-free Steiner tree in G for the terminal vertices in K.
Our original motivation for looking into crossing-free Steiner trees was to
identify interesting families F of geometric graphs for which there exists a small
constant k ∗ such that a graph G ∈ F has a crossing-free spanning tree if and
only if G is k ∗ -Steiner. Then, assuming that there exists a polynomial time al-
gorithm A that decides for every G = (V, E) ∈ F and every k ∗ -element subset
K ⊆ V whether or not there exists a crossing-free Steiner tree for K in G,
we would immediately obtain a polynomial time algorithm for CFST when re-
stricted to the family F . As mentioned in the introduction, at least for k ∗ = 2,
Crossing-Free Spanning Trees in Visibility Graphs of Points 341
(a) (b) v3
v2
v1
Fig. 3. (a) The geometric graph Gn considered in the proof of Theorem 4 for n = 8.
(b) A crossing-free Steiner tree in G8 for a set of n − 3 = 5 terminal vertices (non-
terminal vertices marked by empty circles).
that is, crossing-free paths between two specified vertices, there exists such an
algorithm A for geometric graphs induced by certain polygonal obstacles [3,5].
Unfortunately, as we will see below, this overall approach does not even work for
geometric graphs induced above a single monotone obstacle because there exist
such graphs G that are k-Steiner for arbitrarily large values of k but have no
crossing-free spanning tree. First, we present a technical lemma (proof omitted).
Based on this lemma, we obtain the above-mentioned characterization.
Proof: Clearly, if G has a crossing-free spanning tree then it is k-Steiner for any
k ∈ {0, 1, 2, . . . , n}. For the converse direction, assume that G is (n − 2)-Steiner.
Since n ≥ 4, this implies that G is connected. Moreover, since |Vtop | ≥ 2, it
also implies that G is (n − |Vtop |)-Steiner. Hence, by Lemma 3, G must have a
crossing-free spanning tree.
To see that n − 2 is the smallest possible value, fix an arbitrary n ≥ 4. We
consider a graph resulting from a complete geometric graph with n vertices in
convex position by removing all except one of the edges that lie on the boundary
of the convex hull of its vertex set. Such a geometric graph can easily be obtained
as Gn = (V, E({C})) for some suitably chosen set V of n points above some
monotone obstacle C (cf. Fig. 3(a)).
First note that, by Observation 1, the graph Gn cannot have a crossing-free
spanning tree. Thus, by the equivalence already established, Gn cannot be k-
Steiner for any k ∈ {n − 2, n − 1, n}. Hence, it remains to show that Gn is
(n − 3)-Steiner: Consider an arbitrary set K ⊆ V of n − 3 terminal vertices.
Let v1 , v2 and v3 be the non-terminal vertices in V − K numbered in clockwise
order around the convex hull of V (the terms between/before/after used in the
following always refer to this order). Since n ≥ 4, we can assume without loss
of generality that there is at least one vertex in K between v3 and v1 on the
342 J. Schüler and A. Spillner
boundary of the convex hull of V . To obtain a crossing-free Steiner tree for the
vertices in K, we first connect v2 with all vertices in K between v3 and v1 . Next,
we connect all vertices in K between v1 and v2 (if any) with the vertex in K
immediately before v1 and, finally, we connect all vertices between v2 and v3 (if
any) with the vertex in K immediately after v3 . An example of the resulting
crossing-free Steiner tree is depicted in Fig. 3(b).
When exploring the situation for general geometric graphs, we found that
there are such graphs with n vertices that have no crossing-free spanning tree
even though they are (n − 1)-Steiner. Since a crossing-free Steiner tree for an
(n − 1)-element set K of terminal vertices in such a graph must actually be
a crossing-free spanning tree for the subgraph induced by K, this immediately
gives counterexamples to Rivera-Campo’s conjecture.
Lemma 5. For all n ≥ 16, there exists a geometric graph G = (V, E) with n
vertices that satisfies condition (In−1 ) but has no crossing-free spanning tree.
Proof: Fix an arbitrary n ≥ 16. To construct a suitable geometric graph G =
(V, E) with n vertices, we first arrange a set V1 of n − 8 points in convex position
such that v1 , v2 , . . . , vn−8 is the order of these points along the boundary of the
convex hull of V1 in clockwise direction. We arrange V1 in such a way that v1 is the
point with largest y-coordinate and v8 is the point with smallest y-coordinate.
Similarly, we arrange a set V2 of 8 points in convex position. Let u1 , u2 , . . . , u8
be the order of the points in V2 in counterclockwise direction along the boundary
of the convex hull of V2 . The points are arranged in such a way that u1 is the
point with largest y-coordinate and u8 is the point with smallest y-coordinate.
Now, for i ∈ {1, 2}, let Gi = (Vi , Ei ) denote the geometric graph that we
obtain from the complete geometric graph on vertex set Vi by removing all
edges that lie on the boundary of the convex hull of Vi . Putting
E ∗ = {{vj , uj+1 } : j ∈ {1, 3, 5, 7}} ∪ {{vj , uj−1 } : j ∈ {2, 4, 6, 8}},
we obtain our final geometric graph G with vertex set V = V1 ∪ V2 and edge set
E = E1 ∪ E2 ∪ E ∗ . By placing G2 far enough away to the right of G1 we ensure
that no edge in E ∗ crosses an edge in E1 ∪ E2 (cf. Fig. 4(a)). Note that the edges
in E ∗ form four disjoint pairs of crossing edges.
We first argue that G has no crossing-free spanning tree: By Observation 2,
the restriction of any crossing-free spanning subgraph of G to Vi , i ∈ {1, 2}, has
at least three connected components. Hence, a crossing-free spanning tree of G
would need to use at least five edges that are neither in E1 nor in E2 . But, by
construction of G, a crossing-free subgraph of G can use at most four edges from
E − (E1 ∪ E2 ) = E ∗ .
It remains to show that for every (n−1)-element subset V = V −{w}, w ∈ V ,
there exists a crossing-free spanning tree for the subgraph of G induced by V .
In view of the high degree of symmetry of G, it suffices to consider the case that
w ∈ V1 and, as indicated in Fig. 4(b)-(f), there are only five different types of
(n − 1)-element subsets V that result from removing a vertex w from V1 . It is
easy to check that, for each of them, a crossing-free spanning tree exists.
Crossing-Free Spanning Trees in Visibility Graphs of Points 343
(a) v1 u1 (b)
v2 u2
v3 u3
v4 u4
G2
v5 u5
v6 u6
G1 v7 u7
v8 u8
(c) (d)
(e) (f)
Fig. 4. (a) The geometric graph G constructed in the proof of Lemma 5 for n = 22.
The eight edges in E ∗ between the two subgraphs G1 and G2 are drawn dashed.
(b)-(f) The empty circle marks the vertex w ∈ V1 that is removed to obtain an (n − 1)-
element subset V . There is always a crossing-free spanning tree for the subgraph of
G induced by V but its structure depends on the position of w: (b) w = vj for some
j ∈ {9, 10, . . . , n − 8}, (c)-(f) w = vj for some j ∈ {1, 2, 3, 4}.
(a) (b) r1 r2 r3 r4
Ca
v
u e
Cb
r1 r2 r3
Fig. 5. (a) A geometric graph induced on a point set V between two monotone obstacles
Ca and Cb . (b) The vertical rays in R(e) and R(e) emanating from e downwards and
upwards, respectively.
q q q h
h h h
g g g
r
e e
ri f
rj rj
Fig. 8. (a) A subproblem of Type (1). (b) A subproblem of Type (2). (c) A subproblem
of Type (3).
w w w f
f v v f v u
e e e
r1 r1 r1 r
Fig. 9. (a) Processing a subproblem of Type (1), Case 1. (b)-(c) There are two different
ways how the problem may be partitioned into two smaller subproblems, but it will
always be into a subproblem of Type (1) and a subproblem of Type (2).
Theorem 11. There is a dynamic programming algorithm that, for any geomet-
ric graph G = (V, E({Ca , Cb })) that is induced on a set V of n points between
two monotone obstacles Ca and Cb decides in O(n5 ) time whether or not G has
a crossing-free spanning tree.
4 Concluding Remarks
In this paper, we have started to explore properties of crossing-free spanning
trees in geometric graphs that are induced on a point set in the plane by special
types of polygonal obstacles. To illustrate that this may indeed lead to interest-
ing tractable instances of the problem CFST, we showed that for graphs induced
between two monotone obstacles it can be solved in polynomial time. In view of
the fact that the existence of a crossing-free path between two specified vertices
can be decided in polynomial time even for geometric graphs that are induced
by a single non-monotone polygonal obstacle, it would be interesting to know
whether CFST can also be solved in polynomial time on these more general
instances too. Moreover, our counterexamples to Rivera-Campo’s conjecture im-
mediately raise the following question: What is the largest number k ∗ ∈ N−{0, 1}
such that, for all geometric graphs G = (V, E) with n ≥ k ∗ vertices, condition
(Ik∗ ) implies the existence of a crossing-free spanning tree in G? Combining the
results in this paper with those in [21], we obtain the bounds 5 ≤ k ∗ ≤ 14.
References
1. Alpert, H., Koch, C., Laison, J.: Obstacle numbers of graphs. Discrete & Compu-
tational Geometry 44, 223–244 (2010)
2. Ben-Moshe, B., Katz, M., Mitchell, J.: A constant-factor approximation algorithm
for optimal 1.5D terrain guarding. SIAM Journal on Computing 36, 1631–1647
(2007)
350 J. Schüler and A. Spillner
3. Cheng, Q., Chrobak, M., Sundaram, G.: Computing simple paths among obstacles.
Computational Geometry 16, 223–233 (2000)
4. Clarkson, K., Varadarajan, K.: Improved approximation algorithms for geometric
set cover. Discrete & Computational Geometry 37, 43–58 (2007)
5. Daescu, O., Luo, J.: Computing simple paths on points in simple polygons.
In: Ito, H., Kano, M., Katoh, N., Uno, Y. (eds.) KyotoCGGT 2007. LNCS,
vol. 4535, pp. 41–55. Springer, Heidelberg (2008)
6. Eidenbenz, S.: Inapproximability results for guarding polygons without holes. In:
Chwa, K.-Y., Ibarra, O.H. (eds.) ISAAC 1998. LNCS, vol. 1533, pp. 427–436.
Springer, Heidelberg (1998)
7. Elbassioni, K., Krohn, E., Matijević, D., Mestre, J., Ševerdija, D.: Improved
approximations for guarding 1.5-dimensional terrains. Algorithmica 60, 451–463
(2011)
8. Gibson, M., Kanade, G., Krohn, E., Varadarajan, K.: An approximation scheme
for terrain guarding. In: Dinur, I., Jansen, K., Naor, J., Rolim, J. (eds.) APPROX
and RANDOM 2009. LNCS, vol. 5687, pp. 140–148. Springer, Heidelberg (2009)
9. Halldórsson, M., Knauer, C., Spillner, A., Tokuyama, T.: Fixed-parameter
tractability for non-crossing spanning trees. In: Dehne, F., Sack, J.-R., Zeh, N.
(eds.) WADS 2007. LNCS, vol. 4619, pp. 410–421. Springer, Heidelberg (2007)
10. Jansen, K., Woeginger, G.: The complexity of detecting crossingfree configurations
in the plane. BIT 33, 580–595 (1993)
11. Károlyi, G., Pach, J., Tóth, G.: Ramsey-type results for geometric graphs I. Dis-
crete & Computational Geometry 18, 247–255 (1997)
12. Keller, C., Perles, M., Rivera-Campo, E., Urrutia-Galicia, V.: Blockers for non-
crossing spanning trees in complete geometric graphs. In: Pach, J. (ed.) Thirty
Essays on Geometric Graph Theory, pp. 383–397. Springer (2013)
13. King, J.: A 4-approximation algorithm for guarding 1.5-dimensional terrains. In:
Correa, J.R., Hevia, A., Kiwi, M. (eds.) LATIN 2006. LNCS, vol. 3887, pp. 629–640.
Springer, Heidelberg (2006)
14. King, J., Krohn, E.: Terrain guarding is NP-hard. SIAM Journal on Computing 40,
1316–1339 (2011)
15. Knauer, C., Schramm, É., Spillner, A., Wolff, A.: Configurations with few crossings
in topological graphs. Computational Geometry 37, 104–114 (2007)
16. Koch, A., Krug, M., Rutter, I.: Graphs with plane outside-obstacle representations
(2013) available online: arXiv:1306.2978
17. Krohn, E., Nilsson, B.: The complexity of guarding monotone polygons. In: Proc.
Canadian Conference on Computational Geoemtry, pp. 167–172 (2012)
18. Krohn, E., Nilsson, B.: Approximate guarding of monotone and rectilinear poly-
gons. Algorithmica 66, 564–594 (2013)
19. Mukkamala, P., Pach, J., Pálvölgyi, D.: Lower bounds on the obstacle number of
graphs. The Electronic Journal of Combinatorics 19 (2012)
20. Pach, J., Sarıöz, D.: On the structure of graphs with low obstacle number. Graphs
and Combinatorics 27, 465–473 (2011)
21. Rivera-Campo, E.: A note on the existente of plane spanning trees of geometrie
graphs. In: Akiyama, J., Kano, M., Urabe, M. (eds.) JCDCG 1998. LNCS, vol. 1763,
pp. 274–277. Springer, Heidelberg (2000)
The Connectivity of Boolean Satisfiability:
Dichotomies for Formulas and Circuits
Konrad Schwerdtfeger
1 Introduction
The Boolean satisfiability problem, as well as many related questions like equiv-
alence, counting, enumeration, and numerous versions of optimization, are of
great importance in both theory and applications of computer science.
Common to all these problems is that one asks questions about a Boolean
relation given by some short description, e.g. a propositional formula, Boolean
circuit, binary decision diagram, or Boolean neural network. For the usual for-
mulas with the connectives ∧, ∨ and ¬, several generalizations and restrictions
have been considered. Most widely studied are Boolean constraint satisfactions
problems (CSPs), that can be seen as a generalization of formulas in CNF (con-
junctive normal form), see Definition 2. Another generalization, that we will con-
sider here, are formulas with connectives from an arbitrary fixed set of Boolean
functions B, known as B-formulas. This concept also applies to circuits, where
the allowed gates implement the functions from B, called B-circuits. A further
extension that allows for shorter representations, and in turn makes many prob-
lems harder, are quantifiers, which we will look at in Section 5.
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 351–364, 2014.
c Springer International Publishing Switzerland 2014
352 K. Schwerdtfeger
Here we will investigate the structure of the solution space, which is of obvi-
ous relevance to these satisfiability related problems. Indeed, the solution space
connectivity is strongly correlated to the performance of standard satisfiability
algorithms like WalkSAT and DPLL on random instances: As one approaches
the satisfiability threshold (the ratio of constraints to variables at which ran-
dom k-CNF-formulas become unsatisfiable for k ≥ 3 ) from below, the solution
space fractures, and the performance of the algorithms breaks down [9,8]. These
insights mainly came from statistical physics, and lead to the development of
the survey propagation algorithm, which has much better performance on ran-
dom instances [8]. This research was a motivation for Gopalan et al. to study
connectivity properties of the solution space of Boolean CSPs [3].
While the most efficient satisfiability solvers take CNF-formulas as input, one
of the most important applications of satisfiability testing is verification and op-
timization in Electronic Design Automation (EDA), where the instances derive
mostly from digital circuit descriptions [18]. Though many such instances can
easily be encoded in CNF, the original structural information, such as signal
ordering, gate orientation and logic paths, is lost, or at least obscured. Since
exactly this information can be very helpful for solving these instances, consid-
erable effort has been made recently to develop satisfiability solvers that work
with the circuit description directly [18], which have far superior performance in
EDA applications, or to restore the circuit structure from CNF [2]. This is one
major motivation for our study.
A direct application of st-connectivity are reconfiguration problems, that arise
when we wish to find a step-by-step transformation between two feasible solutions
of a problem such that all intermediate results are also feasible. Recently, the re-
configuration versions of many problems such as Independent-Set, Vertex-
Cover, Set-Cover, Graph-k-Coloring, Shortest-Path have been studied
[4,5], and many complexity results were obtained, in some cases making use of
Gopalan et al.’s results.
Since many of the satisfiability related problems are hard to solve in gen-
eral (they are NP- or even PSPACE-complete), one has tried to identify easier
fragments and to classify restrictions in terms of their complexity. Possibly the
best known result is Schaefer’s 1978 dichotomy theorem for CSPs, which states
that for certain classes of allowed constraints the satisfiability of a CSP is in P,
while it is NP-complete for all other classes [13]. Analogously, Gopalan et al. in
2006 classified the complexity of connectivity questions for CSPs in Schaefer’s
framework. In this paper, we consider the same connectivity issues as Gopalan
et al., but for problems defined by Boolean circuits and propositional formulas
that use gates, resp. connectives, from a fixed set of Boolean functions.
Definition 1. An n-ary Boolean relation is a subset of {0, 1}n (n ≥ 1). The set
of solutions of a propositional formula φ with n variables defines in a natural way
The Connectivity of Boolean Satisfiability 353
an n-ary Boolean relation R, where the variables are taken in lexicographic order.
The solution graph G(φ) of φ is the subgraph of the n-dimensional hypercube
graph induced by the vectors in R, i.e., the vertices of G(φ) are the vectors in R,
and there is an edge between two vectors precisely if they differ in exactly one
position.
We use a, b, . . . to denote vectors of Boolean values and x, y, . . . to denote vec-
tors of variables, a = (a1 , a2 , . . .) and x = (x1 , x2 , . . .). The Hamming distance
|a − b| of two Boolean vectors a and b is the number of positions in which they
differ. If a and b are solutions of φ and lie in the same connected component
of G(φ), we write dφ (a, b) to denote the shortest-path distance between a and b.
The diameter of a connected component is the maximal shortest-path distance
between any two vectors in that component. The diameter of G(φ) is the maximal
diameter of any of its connected components.
In our proofs for B-formulas and B-circuits, we will use Gopalan et al.’s results
for 3-CNF-formulas, so we also need to introduce some terminology for constraint
satisfaction problems.
Definition 2. A CNF-formula is a Boolean formula of the form C1 ∧ · · · ∧ Cm
(1 ≤ m < ∞), where each Ci is a clause, that is, a finite disjunction of literals
(variables or negated variables). A k-CNF-formula (k ≥ 1) is a CNF-formula
where each Ci has at most k literals.
For a finite set of Boolean relations S, a CNF(S)-formula (with constants)
over a set of variables V is a finite conjunction C1 ∧ · · · ∧ Cm , where each Ci is
a constraint application ( constraint for short), i.e., an expression of the form
R(ξ1 , . . . , ξk ), with a k-ary relation R ∈ S, and each ξj is a variable in V or one
of the constants 0, 1.
A k-clause is a disjunction of k variables or negated variables. For 0 ≤ i ≤ k,
let Di be the set of all satisfying truth assignments of the k-clause whose first i
literals are negated, and let Sk = {D0 , . . . , Dk } Thus, CNF(Sk ) is the collection
of k-CNF-formulas.
Gopalan et al. studied the following two decision problems for CNF(S)-formulas:
– the connectivity problem Conn(S): given a CNF(S)-formula φ, is G(φ) con-
nected? (if φ is unsatisfiable, then G(φ) is considered connected)
– the st-connectivity problem st-Conn(S): given a CNF(S)-formula φ and
two solutions s and t, is there a path from s to t in G(φ)?
Lemma 1. [3, Lemm 3.6] st-Conn(S3 ) and Conn(S3 ) are PSPACE-complete.
Proof. st-Conn(S3 ) and Conn(S3 ) are in PSPACE: Given a CNF(S3 )-formula
φ and two solutions s and t, we can guess a path of length at most 2n between
them and verify that each vertex along the path is indeed a solution. Hence
st-Conn(S3 ) is in NPSPACE=PSPACE. For Conn(S3 ), by reusing space we
can check for all pairs of vectors whether they are satisfying and, if they both
are, whether they are connected in G(φ).
We can not state the full proof for the PSPACE-hardness here. It consists of
a direct reduction from the computation of a space-bounded Turing machine M .
354 K. Schwerdtfeger
BF
R1 R0
R2
S20 S21
M1 M0
S200 S210
S302 S301 S311 S312
Sn
0 S300 S310 Sn
1
Sn
02 Sn
01 D Sn
11 Sn
12
S0 S1
D1
Sn
00 Sn
10
S02 S01 S11 S12
D2
S00 S10
V L E
V1 V0 L1 L3 L0 E1 E0
V2 L2 E2
st-BF-Conn, N2 st-QBF-Conn,
BF-Conn, QBF-Conn,
st-Circ-Conn, / Diameter for
Circ-Conn quantified formulas:
/ Diameter:
PSPACE-complete
I
PSPACE-complete / exponential
/ exponential I1 I0 PSPACE-complete
in P / linear / exponential
in P / linear I2 in P / linear
Fig. 1. Post’s lattice with our results for the connectivity problems and the diameter.
For comparison, the satisfiability problem (without quantifiers) is NP-complete for the
bold circled classes, and in P for the other ones.
356 K. Schwerdtfeger
2. Otherwise,
(a) st-Circ-Conn(B) and Circ-Conn(B) are PSPACE-complete,
(b) st-BF-Conn(B) and BF-Conn(B) are PSPACE-complete,
(c) there are functions f ∈ [B] such that their diameter is exponential in the
number of variables of f .
The proof follows from the Lemmas in the next subsections. By the following
Proposition, we can relate the complexity of B-formulas and B-circuits.
Proposition 1. Every B-formula can be transformed into an equivalent B-
circuit in polynomial time.
Proof. The table of all closed classes of Boolean functions shows that f is mono-
tonic in this case. Thus, either f = 0, or (1, . . . , 1) must be a solution, and every
other solution a is connected to (1, . . . , 1) in G(φ) since (1, . . . , 1) can be reached
by flipping the variables assigned 0 in a one at a time to 1. Further, if a and
b are solutions, b can be reached from a in |a − b| steps by first flipping all
variables that are assigned 0 in a and 1 in b, and then flipping all variables that
are assigned 1 in a and 0 in b.
Lemma 5. If B ⊆ L,
1. st-Circ-Conn(B) and Circ-Conn(B) are in P,
2. st-BF-Conn(B) and BF-Conn(B) are in P,
3. for any function f ∈ [B], df (a, b) = |a − b| for any two solutions a and b
that lie in the same connected component of G(φ).
Proof. Since every function f ∈ L is linear, f (x1 , . . . , xn ) = xi1 ⊕. . .⊕xim ⊕c, and
any two solutions s and t are connected iff they differ only in fictional variables:
If s and t differ in at least one non-fictional variable (i.e., an xi ∈ {xi1 , . . . , xim }),
to reach t from s, xi must be flipped eventually, but for every solution a, any
358 K. Schwerdtfeger
Proof. We chose the variables in the proof of Lemma 1 such that the accepting
configuration of the Turing machine corresponds to the (1, . . . , 1) vector.
Tψ = ψ ∧ y,
Algorithm Tr(ψ1 , . . . , ψm )
1. if m = 1 return ψ1
2. else if m is even, return
Tr(T∧∗ [x1 /ψ1 , x2 /ψ2 ] , T∧∗ [x1 /ψ3 , x2 /ψ4 ] , . . . , T∧∗ [x1 /ψm−1 , x2 /ψm ])
3. else return
Tr(T∧∗ [x1 /ψ1 , x2 /ψ2 ] , T∧∗ [x1 /ψ3 , x2 /ψ4 ] , . . . , T∧∗ [x1 /ψm−2 , x2 /ψm−1 ] , ψm ).
360 K. Schwerdtfeger
Here ψ[xi /ξ] denotes the formula obtained by substituting the formula ξ for the
variable xi in the formula ψ. Note that in every Tψ∗ we have the same variable y.
Since the recursion terminates after a number of steps logarithmic in the
number of clauses of φ, and every step increases the total formula size by
only a constant factor, the algorithm runs in polynomial time. We show φ =
Tφ by induction. The basis is clear. Since Tψ ≡ Tψ∗ , it suffices to show that
T∧ [x1 /Tψ1 , x2 /Tψ2 ] ≡ Tψ1 ∧ψ2 :
T∧ [x1 /Tψ1 , x2 /Tψ2 ] = Tψ1 ∧Tψ2 ∧y = (ψ1 ∧y)∧(ψ2 ∧y)∧y ≡ ψ1 ∧ψ2 ∧y = Tψ1 ∧ψ2 .
Lemma 7. If [B] ⊇ D1 ,
1. st-BF-Conn(B) and BF-Conn(B) are PSPACE-complete,
2. st-Circ-Conn(B) and Circ-Conn(B) are PSPACE-complete,
3. for n ≥ 5, there is an n-ary function f ∈ [B] with diameter of at least
2 2 .
n−3
Proof. 1. This proof is similar to the previous one, but the construction is more
intricate; for every 1-reproducing 3-CNF formula we have to construct a self-dual
function s.t. the connectivity is retained. For clarity, we do the construction in
two steps.
For a 1-reproducing formula ψ over the n variables x1 , . . . , xn , we construct
a formula Tψ∼ ∈ D1 with three new variables (y1 , y2 , y3 ) = y,
Tψ∼ = (ψ(x) ∧ y) ∨ ψ(x) ∧ y ∨ y ∈ {100, 010, 001} .
Observe that Tψ∼ (x, y) is self-dual: for any solution ending with 111, the in-
verse vector (that ends with 000) is no solution; all vectors ending with 100,
010, or 001 are solutions and their inverses are no solutions. Also, Tψ∼ is still
1-reproducing, and it is 0-reproducing since ψ(0 · · · 0) ≡ ψ(1 · · · 1) ≡ 0.
Further, for any two solutions s and t of ψ(x), s = s · 111 and t = t · 111
are solutions of Tψ∼ (x, y) and are connected in G(Tψ∼ ) iff s and t are connected
in G(ψ): Every solution a of ψ corresponds to a solution a · 111 of Tψ∼ , and the
connectivity does not change by padding the vectors with 111, and since there
are no solutions of Tψ∼ ending with 110, 101, or 011, every other solution of Tψ∼
differs in at least two variables from the solutions a · 111 that correspond to
solutions of ψ.
Note that exactly one connected component is added in G(Tψ∼ ) to the com-
ponents corresponding to those of G(ψ): It consists of all vectors ending with
000, 100, 010, or 001 (any two vectors ending with 000 are connected e.g. via
those ending with 001). It follows that G(Tψ∼ ) is always unconnected. To fix
The Connectivity of Boolean Satisfiability 361
Proof. 1. This proof is analogous to the previous one. For a 1-reproducing for-
mula ψ over the n variables x1 , . . . , xn , we construct the formula Tψ∼ ∈ Sk02 with
the additional variables y and (z1 , . . . , zk+1 ) = z,
Tψ∼ = (ψ ∧ y ∧ z) ∨ z ∈
/ {0 · · · 0, 10 · · · 0, 010 · · · 0, . . . , 0 · · · 01} .
Tψ∼ (x, y, z) is 0-separating of degree k since all vectors that are no solutions
of Tψ∼ end with a vector b ∈ {0 · · · 0, 10 · · · 0, 010 · · · 0, . . . , 0 · · · 01} ⊂ {0, 1}k+1
and thus any k of them have at least one common variable assigned 0. Also, Tψ∼
is 0-reproducing and still 1-reproducing.
Further, for any two solutions s and t of ψ(x), s = s · 1 · 0 · · · 0 and t =
t · 1 · 0 · · · 0 are solutions of Tψ∼ (x, y, z) and are connected in G(Tψ∼ ) iff s and t
are connected in G(ψ).
But again, we have produced an additional connected component (consisting
of all vectors not ending with 10 · · · 0, 010 · · · 0, . . . , 0 · · · 01, or 0 · · · 0). To connect
it to a component corresponding to one of ψ, we add 1 · · · 1·1·10 · · · 0 as a solution,
Tψ = (ψ ∧ y ∧ z) ∨ z ∈
/ {0 · · · 0, 10 · · · 0, 010 · · · 0, . . . , 0 · · · 01}
∨(x ∧ y ∧ (z = 10 · · · 0)).
which is equivalent to
Q1 y1 · · · Qm ym ϕ(y1 , . . . , ym , x1 , . . . xn ),
6 Conclusions
While the classification for CSPs required an essential enhancement of Schae-
fer’s framework and the introduction of new classes of CNF(S)-formulas, for
B-formulas and B-circuits the connectivity issues fit entirely into Post’s frame-
work, although the proofs were quite novel, and made substantial use of Gopalan
et al.’s results for 3-CNF-formulas.
As Gopalan et al. stated, we also believe that “connectivity properties of
Boolean satisfiability merit study in their own right”, which is substantiated by
the recent interest in reconfiguration problems. Moreover, we imagine our results
could aid the advancement of circuit based SAT solvers.
References
1. Böhler, E., Creignou, N., Reith, S., Vollmer, H.: Playing with boolean blocks, part
i: Posts lattice with applications to complexity theory. In: SIGACT News (2003)
2. Fu, Z., Malik, S.: Extracting logic circuit structure from conjunctive normal form
descriptions. In: 20th International Conference on VLSI Design, Held Jointly with
6th International Conference on Embedded Systems, pp. 37–42. IEEE (2007)
3. Gopalan, P., Kolaitis, P.G., Maneva, E., Papadimitriou, C.H.: The connectivity of
boolean satisfiability: Computational and structural dichotomies. SIAM J. Com-
put. 38(6), 2330–2355 (2009), http://dx.doi.org/10.1137/07070440X
4. Ito, T., Demaine, E.D., Harvey, N.J.A., Papadimitriou, C.H., Sideri, M., Uehara,
R., Uno, Y.: On the complexity of reconfiguration problems. Theor. Comput.
Sci. 412(12-14), 1054–1065 (2011),
http://dx.doi.org/10.1016/j.tcs.2010.12.005
5. Kamiński, M., Medvedev, P., Milanič, M.: Shortest paths between shortest paths
and independent sets. In: Iliopoulos, C.S., Smyth, W.F. (eds.) IWOCA 2010. LNCS,
vol. 6460, pp. 56–67. Springer, Heidelberg (2011)
6. Lewis, H.R.: Satisfiability problems for propositional calculi. Mathematical Sys-
tems Theory 13(1), 45–53 (1979)
7. Makino, K., Tamaki, S., Yamamoto, M.: On the boolean connectivity problem
for horn relations. In: Marques-Silva, J., Sakallah, K.A. (eds.) SAT 2007. LNCS,
vol. 4501, pp. 187–200. Springer, Heidelberg (2007)
8. Maneva, E., Mossel, E., Wainwright, M.J.: A new look at survey propagation and
its generalizations. Journal of the ACM (JACM) 54(4), 17 (2007)
9. Mézard, M., Mora, T., Zecchina, R.: Clustering of solutions in the random satisfi-
ability problem. Physical Review Letters 94(19), 197205 (2005)
10. Michael, T.: On the applicability of post’s lattice. Information Processing Let-
ters 112(10), 386–391 (2012)
11. Post, E.L.: The Two-Valued Iterative Systems of Mathematical Logic(AM-5),
vol. 5. Princeton University Press (1941)
12. Reith, S., Wagner, K.W.: The complexity of problems defined by Boolean circuits
(2000)
13. Schaefer, T.J.: The complexity of satisfiability problems. In: STOC 1978,
pp. 216–226 (1978)
14. Schnoor, H.: Algebraic techniques for satisfiability problems. Ph.D. thesis, Univer-
sität Hannover (2007)
15. Schwerdtfeger, K.W.: A computational trichotomy for connectivity of boolean satis-
fiability. ArXiv CoRR abs/1312.4524 (2013), extended version of a paper submitted
to the JSAT Journal, http://arxiv.org/abs/1312.4524
16. Schwerdtfeger, K.W.: The connectivity of boolean satisfiability: Dichotomies for
formulas and circuits. ArXiv CoRR abs/1312.6679 (2013), extended version of this
paper, http://arxiv.org/abs/1312.6679
17. Vollmer, H.: Introduction to Circuit Complexity: A Uniform Approach. Springer-
Verlag New York, Inc. (1999)
18. Wu, C.A., Lin, T.H., Lee, C.C., Huang, C.Y.R.: Qutesat: a robust circuit-based sat
solver for complex circuit structure. In: Proceedings of the Conference on Design,
Automation and Test in Europe, EDA Consortium, pp. 1313–1318 (2007)
19. Zverovich, I.E.: Characterizations of closed classes of boolean functions in terms of
forbidden subfunctions and post classes. Discrete Appl. Math. 149(1-3), 200–218
(2005), http://dx.doi.org/10.1016/j.dam.2004.06.028
Randomized Communication Complexity
of Approximating Kolmogorov Complexity
Nikolay Vereshchagin
1 Introduction
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 365–374, 2014.
c Springer International Publishing Switzerland 2014
366 N. Vereshchagin
As Bob can find C(y) privately1 and transmit it to Alice in log n bits, approxi-
mating C(x, y) and C(x|y) with more than logarithmic additive error are almost
1
Although C(y) is not computable, Bob can do that, as we are using a non-uniform
model of computation where the parties can just hard-wire a table containing C(x)
for all x of length up to 2n.
Randomized Communication Complexity 367
2 Preliminaries
All logarithms in this paper have the base 2.
which is almost obvious: a short program to print the pair (x, y) can be identified
by the shortest program to print x encoded in a prefix free way (the easiest prefix
free encoding doubles the length) concatenated with the shortest program to
print y. Finally, we will implicitly use the fact that algorithmic transformations
do not increase complexity: C(A(x)) C(x) + O(1) for every algorithm A and
all x (the constant O(1) depends on A but not on x).
The depth of the protocol tree is the worst case length of communication
according to the protocol.
We will consider also randomized communication protocols. A randomized
communication protocol of depth d with public randomness is a probability
distribution P over deterministic communication protocols of depth d. We say
that a randomized protocol P computes a function f with success probability p
if for all input pairs (x, y) the protocol P drawn at random with respect to P
computes f (x, y) with probability at least p.
3 Results
3.1 Deterministic Protocols
Theorem 1. If a deterministic protocol P computes C(x|y) with additive error
α then its depth d is at least n − 2α − O(1).
Proof. Indeed, let P (x, y) denote the output of P for the input pair (x, y). The
protocol P defines a partition of the set {0, 1}n × {0, 1}n into at most 2d rect-
angles3 such that P (x, y) is constant on every rectangle from the partition [5].
Let (y, y) be a diagonal input pair, A × B the rectangle in the partition
containing it and k the value of P on that rectangle. As C(y|y) = O(1), we have
k α + O(1). Since the rectangle A × B includes A × {y}, we have C(x|y)
2α + O(1) for all x ∈ A, which implies that |A| 22α+O(1) . Hence the number
of diagonal pairs (y , y ) in A × B is at most 22α+O(1) . As the total number of
diagonal pairs is 2n , it follows that the partition should have at least 2n−2α−O(1)
rectangles hence d n − 2α − O(1).
Theorem 2 ([4]). Assume that a randomized r round protocol with shared ran-
domness for every (x, y) ∈ {0, 1}n ×{0, 1}n communicates at most d bits and with
probability at least p > 1/2 produces a number k such that k C(x|y) < k + α.
Then d Ω((n/α)1/r ). The constant in Ω-notation depends on r and p.
3
A rectangle is a set of the form A × B.
370 N. Vereshchagin
where k stands for the value of P (x, y) on the rectangle. By the assumption this
contribution is at most ε|R| + δ. Summing up the contributions of all rectangles
we obtain the upper bound ε22n + δ2d .
On the top level the construction of μ is the following. For some integer l n,
we construct a family of l distributions μi where i = 2n − l + 1, . . . , 2n, with the
following properties:
(1) |C(x, y|n) − i| = O(1) for all pairs (x, y) in the support of μi ;
(2) μi (R) ε |R| + δ for every rectangle R ⊂ {0, 1}n × {0, 1}n .
Then we will let μ be the arithmetic mean of μi . The properties (1) and (2)
imply that the assumptions of Lemma 1 are fulfilled for
ε
δ
ε=O and δ = O
l l
(for the function f (x, y) = C(x, y|n)). Indeed, for any k and for any rectangle R
the μ-probability of the set
O
l
of input pairs with respect to μ.
Is suffices to construct a large family of distributions such that properties (1)
and (2) hold for small ε , δ . To this end we will need the following combinatorial
lemma.
Lemma 2. For every n 1 and every 3 < i 2n there is a bipartite graph
Gn,i whose left and right nodes are all binary strings of length n, that has at
least 2i−1 and at most 2i+1 edges and for every left set A and right set B with
edge can be identified by a its i + 1 bit index). Remove from the graph all edges
of complexity less than i − 2. The number of removed edges is less that 2i−2 and
hence the resulting graph has more than 2i−1 − 2i−2 = 2i−2 edges.
Let μi be the uniform probability distribution over the edges of Gn,i . The first
property holds by construction. Let us show that the second property holds for
some small ε , δ for every rectangle A × B. Assume first that both log |A| and
log |B| are larger than 2n − i + log n + 4 (this bound comes from Lemma 2). The
probability that a random edge from Gn,i falls into A × B is at most the number
of edges in A × B divided by the total number of edges in Gn,i . By Lemma 2
the number of edges in A × B is at most |A × B| · 2i−2n+1 and En,i is at least
2i−2 . Hence
μi (A × B) = O(|A × B|/22n ).
Otherwise either |A|, or |B| is less than 22n−i+log n+4 and we use the trivial
upper bound |A × B| 2n × 22n−i+log n+4 for the number of edges of Gn,i in
A × B and the inequality i > 2n − l. We have
pO . (2)
l
By Yao’s principle Equation (2) also holds for the success probability of every
depth d randomized protocol to compute C(x, y|n). Now we have to choose l so
that this inequality yields the best lower bound for d. A simple analysis reveals
that an almost optimal choice of l is such that the exponent in the power of 2
in the right hand side of (2) is 0, that is l = (n − d − log n)/2 (notice that if this
l is negative then there is nothing to prove). Plugging such l in (2), we obtain
O(1)
p .
n − log n − d
The statement of the theorem easily follows.
4
The reader could wonder why we did not let μi be the uniform distribution over
all pairs of Kolmogorov complexity about i. This distribution certainly satisfies the
first property. However the second property is fulfilled only for ε = 2−i , which is
much larger than 2−2n . Indeed, let R = A × A where A is the set of all extensions
of a fixed string of length 2n − i and complexity close to 2n − i. Then complexity of
almost all pairs in R is close to (2n − i) + (i − n) + (i − n) = i. Hence μi (R) is close
to |R|2−i .
Randomized Communication Complexity 373
as i 4.
The second requirement states that for all A, B of cardinality at least
22n−i+log n+4 the number of edges in A × B does not exceed twice its expec-
tation. Fix a and b greater than 22n−i+log n+4 32. Fix A and B of sizes a, b
respectively. The expected number of edges that connect A and B is ab2i−2n .
Thus the probability that the number of edges between A and B exceeds its av-
erage two times is at most 2−ab2
i−2n−2
. The number of possible A’s of size a is at
most 2na . Similarly, the number of possible B’s of size b is at most 2nb . By union
bound, the probability that there are A and B of sizes a, b respectively, that
i−2n−2
violate the statement of the theorem is at most 2nb+na−ba2 . The exponent
in this formula can be written as the sum of b(n−a2i−2n−3 ) and a(n−b2i−2n−3 ).
The lower bound for |A|, |B| was chosen so that both terms n − a2i−2n−3 and
n − b2i−2n−3 be less than −n. By union bound the probability that there are A
and B, that violate the statement of the theorem is at most
n n n
2 2 2
−bn−an −bn
2 = 2 2−an < 1/2.
b,a=32 b=32 a=32
5
We could use here a weaker bound of large deviations.
374 N. Vereshchagin
References
1. Alon, N., Spencer, J.: The probabilistic method, 2nd edn. John Wiley & Sons (2000)
2. Ambainis, A., Buhrman, H., Gasarch, W.I., Kalyanasundaram, B., Torenvliet, L.:
The communication complexity of enumeration, elimination and selection. Journal
of Computer and System Sciences 63, 148–185 (2001)
3. Buhrman, H., Klauck, H., Vereshchagin, N.K., Vitányi, P.M.B.: Individual commu-
nication complexity. In: Diekert, V., Habib, M. (eds.) STACS 2004. LNCS, vol. 2996,
pp. 19–30. Springer, Heidelberg (2004)
4. Buhrman, H., Koucký, M., Vereshchagin, N.: Randomized Individual Communica-
tion Complexity. In: IEEE Conference on Computational Complexity, pp. 321–331
(2008)
5. Kushilevitz, E., Nisan, N.: Communication Complexity. Cambridge University Press
(1997)
6. Li, M., Vitányi, P.: An Introduction to Kolmogorov Complexity and its Applications.
Springer (1997)
7. Yao, A.C.-C.: Probabilistic computations: Toward a unified measure of complexity.
In: 18th Annual IEEE Symposium on Foundation of Computer Science, pp. 222–227
(1977)
Space Saving by Dynamic Algebraization
1 Introduction
Exact solutions to NP-hard problems typically adopt a branch-and-bound, in-
clusion/exclusion or dynamic programming framework. While algorithms based
on branch-and-bound or inclusion/exclusion techniques [20] have shown to be
both time and space efficient, one problem with dynamic programming is that for
many NP-hard problems, it requires exponential space to store the computation
table. As in practice programs usually run out of space before they run out of
time [27], an exponential-space algorithm is considered not scalable. Lokshtanov
and Nederlof [18] have recently shown that algebraic tools like the zeta trans-
form and Möbius inversion [22,23] can be used to obtain space efficient dynamic
programming under some circumstances. The idea is sometimes referred to as
the coefficient extraction technique which also appears in [15,16].
The principle of space saving is best illustrated with the better known
Fourier transform. Assume we want to compute a sequence of polynomial addi-
tions and multiplications modulo xn − 1. We can either use a linear amount of
storage and do many complicated convolution operations throughout, or we can
start and end with the Fourier transforms and do the simpler component-wise
Research supported in part by NSF Grant CCF-0964655 and CCF-1320814.
E.A. Hirsch et al. (Eds.): CSR 2014, LNCS 8476, pp. 375–388, 2014.
c Springer International Publishing Switzerland 2014
376 M. Fürer and H. Yu
1
O∗ notation hides the polynomial factors of the expression.
Space Saving by Dynamic Algebraization 377
2 Preliminaries
Lokshtanov and Nederlof [18] introduce algebraic techniques to solve three types
of problems. The first technique is using discrete Fourier transforms (DFT) on
problems of very large domains, e.g., for the subset sum problem. The second
one is using Möbius and zeta transforms when recurrences used in dynamic pro-
gramming can be formulated as subset convolutions, e.g., for the unweighted
Steiner tree problem. The third one is to solve the minimization version of the
second type of problems by combining the above transforms, e.g., for the trav-
eling salesman problem. To the interest of this paper, we explain the techniques
used in the second type of problems.
Given a universe V , let R be a ring and consider functions from 2V to R.
Denote the collection of such functions by R[2V ]. A singleton fA [X] is an element
of R[2V ] which is zero unless X = A. The operator ⊕ is the pointwise addition
and the operator ( is the pointwise multiplication. We first define some useful
algebraic transforms.
The zeta transform of a function f ∈ R[2V ] is defined to be
ζf [Y ] = f [X]. (1)
X⊆Y
The Möbius transform is the inverse transform of the zeta transform, as they
have the following relation [22,23]:
The high level idea of [18] is that, rather than directly computing f [V ] by
storing exponentially many intermediate results {f [S]}S⊆V , they compute the
zeta transform of f [S] using onlypolynomial space. f [V ] can be obtained by
Möbius inversion (2) as f [V ] = X⊆V (−1)|V \X| (ζf )[X]. Problems which can
be solved in this manner have a common nature. They have recurrences which
can be formulated by subset convolutions. The subset convolution [3] is defined
to be
f ∗R g[X] = f (X )g(X \ X ). (4)
X ⊆X
To apply the zeta transform to f ∗R g, we need the union product [3] which
is defined as
f ∗u g[X] = f (X1 )g(X2 ). (5)
X1 X2 =X
378 M. Fürer and H. Yu
The relation between the union product and the zeta transform is as follows
[3]:
ζ(f ∗u g)[X] = (ζf ) ( (ζg)[X]. (6)
In [18], functions over (R[2V ]; ⊕, ∗R ) are modeled by arithmetic circuits. Such
a circuit is a directed acyclic graph where every node is either a singleton (con-
stant gate), a ⊕ gate or a ∗R gate. Given any circuit C over (R[2V ]; ⊕, ∗R )
which outputs f , every gate in C computing an output a from its inputs b, c is
|V |
replaced by small circuits computing a relaxation {ai }i=1 of a from relaxations
|V | |V |
{bi }i=1 and {ci }i=1 of b and c respectively. (A relaxation of a function f ∈ R[2V ]
is a sequence of functions {f i : f i ∈ R[2V ], 0 ≤ i ≤ |V |}, such that ∀i, X ⊆ V ,
f i [X] = f [X] if i = |X|, f i [X] = 0 if i < |X|, and f i [X] is an arbitrary value if
i > |X|.) For a ⊕ gate, replace a = b ⊕ c by ai = bi ⊕ ci , for 0 ≤ i ≤ |V |. For a
i
∗R gate, replace a = b ∗R c by ai = j=0 bj ∗u ci−j , for 0 ≤ i ≤ |V |. This new
circuit C1 over (R[2V ]; ⊕, ∗u ) is of size O(|C|·|V |) and outputs f|V | [V ]. The next
step is to replace every ∗u gate by a gate ( and every constant gate a by ζa. It
turns C1 to a circuit C2 over (R[2V ]; ⊕, (), such that for every gate a ∈ C1 , the
corresponding gate in C2 outputs ζa. Since additions and multiplications in C2
are pointwise, C2 can be viewed as 2|V | disjoint circuits C Y over (R[2V ]; +, ·)
for every subset Y ⊆ V . The circuit C Y outputs (ζf )[Y ]. It is easy to see that
the construction of every C Y takes polynomial time.
As all problems of interest in this paper work on the integer domain Z, we
consider R = Z and replace ∗R by ∗ for simplicity. Assume 0 ≤ f [V ] < m for
some integer m, we can view the computation as on the finite ring Zm . Additions
and multiplications can be implemented efficiently on Zm (e.g., using the fast
algorithm in [10] for multiplication).
is given in [7]. The result has been further improved to O(log k) in [8]. There
are also a series of works studying constant approximation of treewidth k with
running time exponential in k, see [5] and references therein.
To simplify the presentation of dynamic programming based on tree decom-
position, an arbitrary tree decomposition is usually transformed into a nice tree
decomposition which has the following additional properties. A node in a nice
tree decomposition has at most 2 children. Let c be the only child of x or let
c1 , c2 be the two children of x. Any node x in a nice tree decomposition is of one
of the following five types:
1. An introduce vertex node (introduce vertex v), where Bx = Bc ∪ {v}.
2. An introduce edge node (introduce edge e = {u, v}), where u, v ∈ Bx and
Bx = Bc . We say that e is associated with x.
3. A forget vertex node (forget vertex v), where Bx = Bc \ {v}.
4. A join node, where x has two children and Bx = Bc1 = Bc2 .
5. A leaf node, a leaf of T .
For any tree decomposition, a nice tree decomposition with the same treewidth
can be constructed in polynomial time [13]. Notice that an introduce edge node
is not a type of nodes in a common definition of a nice tree decomposition. We
can create an introduce edge node after the two endpoints are introduced. We
further transform every leaf node and the root to a node with an empty bag by
adding a series of introduce nodes or forget nodes respectively.
3 Algorithmic Framework
We explain the algorithmic framework using the problem of counting perfect
matchings based on tree decomposition as an example to help understand the
recurrences. The result can be easily applied to other problems. A perfect match-
ing in a graph G = (V, E) is a collection of |V |/2 edges such that every vertex
in G belongs to exactly one of these edges.
Consider a connected graph G and a nice tree decomposition T of treewidth k
on G. Consider a function f ∈ Z[2V ]. Assume that the recurrence for computing
f on a join node can be formulated as a subset convolution, while on other types
of tree nodes it is an addition or subtraction. We explain how to efficiently eval-
uate f [V ] on a nice tree decomposition by dynamic programming in polynomial
space. Let Tx be the subtree rooted at x. Let Tx be the vertices contained in bags
associated with nodes in Tx which are not in Bx . For any X ⊆ Bx , let YX be the
union of X and Tx . For any X ⊆ Bx , let fx [X] be the number of perfect match-
ings in the subgraph YX with edges introduced in Tx . As in the construction of
Theorem 1, we first replace fx by a relaxation {fxi }0≤i≤k+1 of f , where k is the
treewidth. We then compute the zeta transform of fxi , for 0 ≤ i ≤ k + 1. In the
following context, we present only recurrences of fx for all types of tree nodes
except the join node where we need to use the relaxations. The recurrences of
fx based on fc can be directly applied to their relaxations with the same index
as in Theorem 1.
380 M. Fürer and H. Yu
For any leaf node x, (ζfx )[∅] = fx [∅] is a problem-dependent constant. In the
case of the number of perfect matchings, fx [∅] = 1. For the root x, (ζfx )[∅] =
fx [∅] = f [V ] which is the value of interest. For the other cases, consider an
arbitrary subset X ⊆ Bx .
1. x is an introduce vertex node. If the introduced vertex v is not in X,
fx [X] = fc [X]. If v ∈ X, in the case of the number of perfect matchings, v has no
adjacent edges, hence fx [X] = 0 (for other problems, fx [X] may equal to fc [X],
which implies a similarrecurrence). By definition
of the zeta transform,
if v ∈ X,
we have (ζfx )[X] = v∈X ⊆X fx [X ] + / ⊆X fx [X ] =
v ∈X / ⊆X fx [X ].
v ∈X
Therefore,
(ζfc )[X] v∈ /X
(ζfx )[X] = (7)
(ζfc )[X \ {v}] v ∈ X
For the problem of counting perfect matchings, it is easy to verify that fx [X]
i
can be computed using (9). Let fxi = j=0 fcj1 ∗u fci−j
2
. We can transform the
computation to
i
(ζfxi )[X] = (ζfcj1 )[X] · (ζfci−j
2
)[X], for 0 ≤ i ≤ k + 1. (10)
j=0
Hence,
(ζfc )[X] eX
(ζfx )[X] = (11)
(ζfc )[X] + (ζfc )[X \ {u, v}] e ⊆ X
In cases 2 and 4, we see that the value of (ζfx )[X] depends on the values
of ζfc on two different subsets. We can visualize the computation along a path
from a leaf to the root as a computation tree. This computation tree branches
on introduce edge nodes and forget vertex nodes. Suppose along any path from
the root to a leaf in T , the maximum number of introduce edge nodes is m and
the maximum number of forget vertex nodes is h. To avoid exponentially large
storage for keeping partial results in this computation tree, we compute along
every path from a leaf to the root in this tree. This leads to an increase of the
running time by a factor of O(2m +h ), but the computation is in polynomial space
(explained in detail later). As m could be Ω(n), this could contribute a factor
of 2Ω(n) to the time complexity. To reduce the running time, we eliminate the
branching introduced by introduce edge nodes. On the other hand, the branching
introduced by forget vertex nodes seems inevitable.
For any introduce edge node x which introduces an edge e and has a child c
in the original nice tree decomposition T , we add an auxiliary child c of x, such
that Bc = Bx and introduce the edge e at c . c is a special leaf which is not
empty. We assume the evaluation of ζf on c takes only polynomial time. For
the counting perfect matchings problem, fc [X] = 1 only when X = e or X = ∅,
otherwise it is equal to 0. Then (ζfc )[X] = 2 if e ⊆ X, otherwise (ζfc )[X] = 1.
We will verify that this assumption is valid for other problems considered in the
following sections. We call x a modified introduce edge node and c an auxiliary
leaf. As the computation on x is the same as that on a join node, we do not talk
about the computation on modified introduce edge nodes separately.
In cases 1 and 2, we observe that the addition operation is not a strictly
pointwise addition as in Theorem 1. This is because in a tree decomposition,
the set of vertices on every tree node might not be the same. However, there
is a one-to-one correspondence from a set X in node x to a set X in its child
c. We call it a relaxed pointwise addition and denote it by ⊕ . Hence, f can
be evaluated by a circuit C over (Z[2V ]; ⊕ , ∗). We transform C to a circuit C1
over (Z[2V ]; ⊕ , ∗u ), then to C2 over (Z[2V ]; ⊕ , (), following constructions in
Theorem 1.
In Theorem 1, C2 can be viewed as 2|V | disjoint circuits. In the case of tree
decomposition, the computation makes branches on a forget node. Therefore, we
cannot take C2 as O(2k ) disjoint circuits. Consider a subtree Tx of T where the
root x is the only join node in the subtree. Take an arbitrary path from x to a
leaf l and assume there are h forget nodes along this path. We compute along
every path of the computation tree expanded by the path from x to l, and sum
up the result at the top. There are 2h computation paths which are independent.
Hence we can view the computation as 2h disjoint circuits on (Z; +, ·). Assume
the maximum number of forget nodes along any path from the root x to a leaf
in Tx is h and there are nl leaves, the total computation takes at most nl · 2h
time and in polynomial space.
382 M. Fürer and H. Yu
To apply Algorithm
1 to the problem of counting perfect matchings, we verify
that f [S] ≤ |V|E|
|/2
≤ |E| |V |/2
and all constants are singletons.
To the best of our knowledge, there is no rigorous time complexity analysis of the
counting perfect matchings problem in grids in the literature. To demonstrate
the efficiency of Algorithm 1, we compare it to three other natural algorithms.
1. Dynamic programming based on path decomposition. A path decom-
position is a special tree decomposition where the underlying tree is a path. A
path decomposition with width 2nd−1 is obtained by putting all vertices with
x1 coordinate equal to j and j + 1 into the bag of node j, for j = 0, 1, ..., n − 1.
A path decomposition with a smaller pathwidth of nd−1 can be obtained as fol-
lows. Construct n nodes {p1 , p2 , ..., pn } associated with a bag of vertices with
x1 coordinate equal to j, for j = 0, 1, ..., n − 1. For any pj , pj+1 , start from pj ,
add a sequence of nodes by alternating between adding a vertex of x1 = j + 1
and deleting its neighbor with x1 = j. The number of nodes increases by a fac-
tor of nd−1 than the first path decomposition. We run the standard dynamic
programming on the second path decomposition. This algorithm runs in time
O∗ (2n ), however the space complexity is O∗ (2n ). It is of no surprise that
d−1 d−1
it has a better running time than Algorithm 1 due to an extra space usage. We
remark that van Rooij et al. [25] give a dynamic programming algorithm for the
counting perfect matching problem on any tree decomposition of treewidth k
with running time O∗ (2k ) and space exponential to k.
2. Dynamic programming based on path decomposition on a subgrid.
One way to obtain a polynomial space dynamic programming is to construct a
low pathwidth decomposition on a sufficiently large subgraph. One can then run
dynamic programming on this path decomposition and do an exhaustive enumer-
ation on the remaining graph in a similar way as in [2]. To extract from Gd (n)
a subgrid of pathwidth O(log n) (notice that this is the maximum pathwidth for
a polynomial space dynamic programming algorithm), we can delete a portion
of vertices from Gd (n) to turn a ”cube”-shaped grid into a long ”stripe” with
d
O(log n) cross-section area. It is sufficient to remove O( (log n)n1/(d−1) ) vertices.
nd
O( )
This leads to a polynomial-space algorithm with running time 2 (log n)1/(d−1) ,
which is worse than Algorithm 1.
3. Branching algorithm. A naive branching algorithm starting from any ver-
d
tex in the grid could have time complexity 2O(n ) in the worst case. We analyze
a branching algorithm with a careful selection of the starting point. The branch-
ing algorithm works by first finding a balanced separator S and partitioning the
graph into A∪S ∪B. The algorithm enumerates every subset X ⊆ S. A vertex in
X either matches to vertices in A or to vertices in B while vertices in S \ X are
matched within S. Then the algorithm recurses on A and B. Let Td (n) be the
386 M. Fürer and H. Yu
running time of this branching algorithm on Gd (n). We use the same balanced
separator as in Algorithm 2. We have an upper bound of the running time as,
|X|
Td (n) ≤ 2Td ( n−|S|
2 ) X⊆S 2 Td−1 (|S \ X|). We can use any polynomial space
algorithm to count perfect matchings on S \ X. For example using Algorithm
d−2
1, since the separator is of size O(nd−1 ), we have Td−1 (|S \ X|) = 2O(n ) .
d−1 |S| |S|
Therefore, Td (n) ≤ 2Td ( n2 ) · 2o(n ) i=0 i 2i = 2Td ( n2 ) · 2o(n ) 3|S| . We
d−1
2d −1
nd−1
get Td (n) = O∗ (3h ), i.e. O∗ (3 2d−1 −1 ), which is worse than Algorithm 1. We
remark that this branching algorithm can be viewed as a divide and conquer
algorithm on balanced tree decomposition, which is similar as in [17].
4.2 Extensions
References
1. Björklund, A.: Counting perfect matchings as fast as Ryser. In: SODA, pp. 914–921
(2012)
2. Björklund, A., Husfeldt, T.: Exact algorithms for exact satisfiability and number
of perfect matchings. Algorithmica 52(2), 226–249 (2008)
3. Björklund, A., Husfeldt, T., Kaski, P., Koivisto, M.: Fourier meets Möbius: fast
subset convolution. In: STOC, pp. 67–74 (2007)
4. Bodlaender, H.L.: Dynamic programming on graphs with bounded treewidth. In:
Lepistö, T., Salomaa, A. (eds.) ICALP 1988. LNCS, vol. 317, pp. 105–118. Springer,
Heidelberg (1988)
5. Bodlaender, H.L.: A linear time algorithm for finding tree-decompositions of small
treewidth. In: STOC, pp. 226–234 (1993)
388 M. Fürer and H. Yu
6. Bodlaender, H.L.: Discovering treewidth. In: Vojtáš, P., Bieliková, M., Charron-
Bost, B., Sýkora, O. (eds.) SOFSEM 2005. LNCS, vol. 3381, pp. 1–16. Springer,
Heidelberg (2005)
7. Bodlaender, H.L., Gilbert, J.R., Kloks, T., Hafsteinsson, H.: Approximating
treewidth, pathwidth, and minimum elimination tree height. In: Schmidt, G.,
Berghammer, R. (eds.) WG 1991. LNCS, vol. 570, pp. 1–12. Springer, Heidelberg
(1992)
8. Bouchitté, V., Kratsch, D., Müller, H., Todinca, I.: On treewidth approximations.
Discrete Appl. Math. 136(2-3), 183–196 (2004)
9. Fomin, F.V., Gaspers, S., Saurabh, S., Stepanov, A.A.: On two techniques of com-
bining branching and treewidth. Algorithmica 54(2), 181–207 (2009)
10. Fürer, M.: Faster integer multiplication. SIAM J. Comput. 39(3), 979–1005 (2009)
11. Gottlob, G., Leone, N., Scarcello, F.: Hypertree decompositions: A survey. In: Sgall,
J., Pultr, A., Kolman, P. (eds.) MFCS 2001. LNCS, vol. 2136, pp. 37–57. Springer,
Heidelberg (2001)
12. Kenyon, C., Randall, D., Sinclair, A.: Approximating the number of monomer-
dimer coverings of a lattice. J. Stat. Phys. 83 (1996)
13. Kloks, T. (ed.): Treewidth. LNCS, vol. 842. Springer, Heidelberg (1994)
14. Kneis, J., Mölle, D., Richter, S., Rossmanith, P.: A bound on the pathwidth of
sparse graphs with applications to exact algorithms. SIAM J. Discret. Math. 23(1),
407–427 (2009)
15. Koutis, I.: Faster algebraic algorithms for path and packing problems. In: ICALP,
pp. 575–586 (2008)
16. Koutis, I., Williams, R.: Limits and applications of group algebras for parameter-
ized problems. In: ICALP, pp. 653–664 (2009)
17. Lokshtanov, D., Mnich, M., Saurabh, S.: Planar k-path in subexponential time and
polynomial space. In: Kolman, P., Kratochvı́l, J. (eds.) WG 2011. LNCS, vol. 6986,
pp. 262–270. Springer, Heidelberg (2011)
18. Lokshtanov, D., Nederlof, J.: Saving space by algebraization. In: STOC, pp. 321–
330 (2010)
19. Miller, G.L., Teng, S.-H., Thurston, W., Vavasis, S.A.: Separators for sphere-
packings and nearest neighbor graphs. J. ACM 44(1), 1–29 (1997)
20. Nederlof, J.: Fast polynomial-space algorithms using inclusion-exclusion. Algorith-
mica 65(4), 868–884 (2013)
21. Nešetřil, J., de Mendez, P.O.: Tree-depth, subgraph coloring and homomorphism
bounds. Eur. J. Comb. 27(6), 1022–1041 (2006)
22. Rota, G.-C.: On the foundations of combinatorial theory. i. theory of möbius func-
tions. Zeitschrift Wahrscheinlichkeitstheorie und Verwandte Gebiete 2(4), 340–368
(1964)
23. Stanley, R.P., Rota, G.C.: Enumerative Combinatorics, vol. 1. Cambridge Univer-
sity Press (2000)
24. Temperley, H.N.V., Fisher, M.: Dimer problem in statistical mechanics - an exact
result. Philosophical Magazine 6, 1061–1063 (1961)
25. van Rooij, J.M.M., Bodlaender, H.L., Rossmanith, P.: Dynamic programming on
tree decompositions using generalised fast subset convolution. In: Fiat, A., Sanders,
P. (eds.) ESA 2009. LNCS, vol. 5757, pp. 566–577. Springer, Heidelberg (2009)
26. van Rooij, J.M.M., Nederlof, J., van Dijk, T.C.: Inclusion/Exclusion meets measure
and conquer. In: Fiat, A., Sanders, P. (eds.) ESA 2009. LNCS, vol. 5757, pp. 554–
565. Springer, Heidelberg (2009)
27. Woeginger, G.J.: Space and time complexity of exact algorithms: Some open prob-
lems (invited talk). In: 1st International Workshop on Parameterized and Exact
Computation, pp. 281–290 (2004)
Author Index