This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

A Complexity Theory for Hard Enumeration Problems

Nadia Creignou nadia.creignou@univ-amu.fr Markus Kröll kroell@dbai.tuwien.ac.at Reinhard Pichler pichler@dbai.tuwien.ac.at Sebastian Skritek skritek@dbai.tuwien.ac.at Heribert Vollmer vollmer@thi.uni-hannover.de TU Wien, Vienna, Austria Aix-Marseille Univ, CNRS, Marseille, France Leibniz Universität Hannover, Hannover, Germany
Abstract

Complexity theory provides a wealth of complexity classes for analyzing the complexity of decision and counting problems. Despite the practical relevance of enumeration problems, the tools provided by complexity theory for this important class of problems are very limited. In particular, complexity classes analogous to the polynomial hierarchy and an appropriate notion of problem reduction are missing. In this work, we lay the foundations for a complexity theory of hard enumeration problems by proposing a hierarchy of complexity classes and by investigating notions of reductions for enumeration problems.

1 Introduction

While decision problems often ask for the existence of a solution to some problem instance, enumeration problems aim at outputting all solutions. In many domains, enumeration problems are thus the most natural kind of problems. Just take the database area (usually the user is interested in all answer tuples and not just in a yes/no answer) or diagnosis (where the user wants to retrieve possible explanations, and not only whether one exists) as two examples. Nevertheless, the complexity of enumeration problems is far less studied than the complexity of decision problems.

It should be noted that even simple enumeration problems may produce big output. To capture the intuition of easy to enumerate problems – despite a possibly exponential number of output values – various notions of tractable enumeration classes have been proposed in [1]. The class DelayP (“polynomial delay”) contains all enumeration problems where, for given instance xx, (1) the time to compute the first solution, (2) the time between outputting any two consecutive solutions, and (3) the time to detect that no further solution exists, are all polynomially bounded in the size of xx. The class IncP (“incremental polynomial time”) contains those enumeration problems where, for given instance xx, the time to compute the next solution and for detecting that no further solution exists is polynomially bounded in the size of both xx and of the already computed solutions. Obviously, the relationship DelayPIncP\text{\sf DelayP}\subseteq\text{\sf IncP} holds. In [2], the proper inclusion DelayPIncP\text{\sf DelayP}\subsetneq\text{\sf IncP} is mentioned. For these tractable enumeration classes, a variety of membership results exist, a few examples are given in [3, 4, 5, 6, 7, 8]

There has also been work on intractable enumeration problems. Intractability of enumeration is typically proved by showing intractability of a related decision problem rather than directly proving lower bounds by relating one enumeration problem to the other. Tools for a more fine-grained analysis of intractable enumeration problems are missing to date. For instance, up to now we are not able to make a differentiated analysis of the complexity of the following typical enumeration problems:

ΠkSATe\Pi_{k}\mathrm{SAT}^{e} / ΣkSATe\Sigma_{k}\mathrm{SAT}^{e} Instance: ψ=y1y2Qkykϕ(x,y)\psi=\forall y_{1}\exists y_{2}\ldots Q_{k}y_{k}\phi(\vec{x},\vec{y}) / ψ=y1y2Qkykϕ(x,y)\psi=\exists y_{1}\forall y_{2}\ldots Q_{k}y_{k}\phi(\vec{x},\vec{y}) Output: All assignments for x\vec{x} such that ψ\psi is true.

This is in sharp contrast to decision problems, where the polynomial hierarchy is crucial for a detailed complexity analysis. As a matter of fact, it makes a big difference, if an NP-hard problem is in NP or not. Indeed, NP-complete problems have an efficient transformation into SAT and can therefore be solved by making use of powerful SAT-solvers. Similarly, problems in Σ2P{\Sigma}_{2}^{P} can be solved by using ASP-solvers. Finally, also for problems on higher levels of the polynomial hierarchy, the number of quantifier alternations in the QBF-encoding matters when using QBF-solvers. For counting problems, an analogue of the polynomial hierarchy has been defined in form of the #𝒞\#\cdot{\cal C}–classes with 𝒞{P,coNP,Π2P,}{\cal C}\in\{\text{\sf P},\text{\sf coNP},{\Pi}_{2}^{P},\dots\} [9, 10]. For enumeration problems, no such analogue has been studied.

Goal and Results. The goal of this work is to lay the foundations for a complexity theory of hard enumeration problems by defining appropriate complexity classes for intractable enumeration and a suitable notion of problem reductions. We propose to extend tractable enumeration classes by oracles. We will thus get a hierarchy of classes DelayP𝒞\text{\sf DelayP}^{\mathcal{C}}, IncP𝒞\text{\sf IncP}^{\mathcal{C}}, where various complexity classes 𝒞{\cal C} are used as oracles. As far as the definition of an appropriate notion of reductions is concerned, we follow the usual philosophy of reductions: if some enumeration problem can be reduced to another one, then we can use this reduction together with an enumeration algorithm for the latter problem to solve the first one. We observe that two principal kinds of reductions are used for decision problems, namely many-one reductions and Turing reductions. Similarly, we shall define a more declarative-style and a more procedural-style notion of reduction for enumeration problems. Our results are summarized below.

  • Enumeration complexity classes. In Section 3, we introduce a hierarchy of complexity classes of intractable enumeration via oracles and prove that it is strict unless the polynomial hierarchy collapses.

  • Declarative-style reductions. In Section 4, we introduce a declarative-style notion of reductions. While they enjoy some desirable properties, we do not succeed in exhibiting complete problems under this type of reductions.

  • Procedural-style reductions. In Section 5, we introduce a procedural-style notion of reductions, show that they have the desirable properties any reduction should possess, and show that the enumeration problems associated with the typical quantified Boolean satisfiability problems are complete in our hierarchy of enumeration problems.

  • Completeness results for natural problems. Starting with these completeness results, we establish a chain of reductions among several natural enumeration problems from areas such as generalized satisfiability, circumscription, model-based diagnosis, abduction, and repairs of inconsistent databases in Section 6, thus proving completeness of these problems in classes of our hierarchy.

This work is an extension of the conference article [11].

2 Preliminaries

In the following, Σ\Sigma denotes a finite alphabet and RR denotes a polynomially bounded, binary relation RΣ×ΣR\subseteq\Sigma^{*}\times\Sigma^{*}, i.e., there is a polynomial pp such that for all (x,y)R(x,y)\in R, |y|p(|x|)|y|\leq p(|x|) holds. For every string xx, R(x)={yΣ(x,y)R}R(x)=\{y\in\Sigma^{*}\mid(x,y)\in R\}. A string yR(x)y\in R(x) is called a solution for xx. With such a relation RR, we can associate several natural computational problems:

Exist_R\text{\sc Exist}{\_}R Instance: xΣx\in\Sigma^{*} Question: Is R(x)R(x)\neq\emptyset?

Exist-AnotherSol_R\text{\sc Exist-AnotherSol}{\_}R Instance: xΣ,YR(x)x\in\Sigma^{*},Y\subseteq R(x) Output: Is (R(x)Y)(R(x)\setminus Y)\neq\emptyset?

AnotherSol_R\text{\sc AnotherSol}{\_}R Instance: xΣ,YR(x)x\in\Sigma^{*},Y\subseteq R(x) Output: yR(x)Yy\in R(x)\!\setminus\!Y or declare that no such yy exists.

Check_R\text{\sc Check}{\_}R Instance: (x,y)Σ×Σ(x,y)\in\Sigma^{*}\times\Sigma^{*} Question: Is (x,y)R(x,y)\in R?

ExtSol_R\text{\sc ExtSol}{\_}R Instance: (x,y)Σ×Σ(x,y)\in\Sigma^{*}\times\Sigma^{*} Question: Is there some yΣy^{\prime}\in\Sigma^{*} such that (x,yy)R(x,yy^{\prime})\in R?

In counting complexity, the following computational problem arises:

Count_R\text{\sc Count}{\_}R Instance: xΣx\in\Sigma^{*} Output: |{yΣ(x,y)R}|\bigl{|}\{y\in\Sigma^{*}\mid(x,y)\in R\}\bigr{|}.

A binary relation RR also gives rise to an enumeration problem, which aims at outputting the set R(x)R(x) of solutions for xx.

Enum_R\text{\sc Enum}{\_}R Instance: xΣx\in\Sigma^{*} Output: R(x)={yΣ(x,y)R}R(x)=\{y\in\Sigma^{*}\mid(x,y)\in R\}.

We assume the reader to be familiar with the polynomial hierarchy – the complexity classes P, NP, coNP and, more generally, ΔkP{\Delta}_{k}^{P}, ΣkP{\Sigma}_{k}^{P}, and ΠkP{\Pi}_{k}^{P} for k{0,1,}k\in\{0,1,\dots\}.

As we usually deal with exponential runtime of algorithms in the course of an enumeration process, we will also make use of the weak EXP hierarchy (see [12]) in the following. It is an exponential time analogue of the polynomial hierarchy defined as follows:

Definition 1 (Exponential Hierarchy).
Δ0EXP\displaystyle\Delta_{0}^{\text{\sf EXP}} =Σ0EXP=Π0EXP=EXP\displaystyle=\Sigma_{0}^{\text{\sf EXP}}=\Pi_{0}^{\text{\sf EXP}}=\text{\sf EXP}
ΔkEXP\displaystyle\Delta_{k}^{\text{\sf EXP}} =EXPΣk1P, for k1\displaystyle=\text{\sf EXP}^{{\Sigma}_{k-1}^{P}},\text{ for }k\geq 1
ΣkEXP\displaystyle\Sigma_{k}^{\text{\sf EXP}} =NEXPΣk1P, for k1\displaystyle=\text{\sf NEXP}^{{\Sigma}_{k-1}^{P}},\text{ for }k\geq 1
ΠkEXP\displaystyle\Pi_{k}^{\text{\sf EXP}} =coNEXPΣk1P, for k1\displaystyle=\text{\sf coNEXP}^{{\Sigma}_{k-1}^{P}},\text{ for }k\geq 1

A hierarchy of counting complexity classes similar to the polynomial hierarchy was defined [9, 10]. Let 𝒞{\cal C} be a complexity class of decision problems. Then #𝒞\#\cdot{\cal C} denotes the class of all counting problems 𝒫{\cal P}, such that there exists a relation RR with Check_R𝒞\text{\sc Check}{\_}R\in{\cal C} and 𝒫=Count_R{\cal P}=\text{\sc Count}{\_}R. For #𝖯\mathsf{\#P} – the best known counting complexity class – we have #𝖯=#𝖯\mathsf{\#P}=\#\cdot\mathsf{P}. Moreover, the inclusions #𝖯#𝖭𝖯#𝖼𝗈𝖭𝖯#Σ2P#Π2P\mathsf{\#P}\subseteq\#\cdot\mathsf{NP}\subseteq\#\cdot\mathsf{coNP}\subseteq\#\cdot\Sigma_{2}^{P}\subseteq\#\cdot\Pi_{2}^{P}\subseteq\dots hold.

A complexity class 𝒞{\mathcal{C}} is closed under a reduction r\leq_{r} if, for any two binary relations R1R_{1} and R2R_{2} we have that R2𝒞R_{2}\in{\mathcal{C}} and R1rR2R_{1}\leq_{r}R_{2} imply R1𝒞R_{1}\in{\mathcal{C}}. Furthermore, a reduction r\leq_{r} is transitive if for any three binary relations R1,R2,R3R_{1},R_{2},R_{3}, it is the case that R1rR2R_{1}\leq_{r}R_{2} and R2rR3R_{2}\leq_{r}R_{3} implies R1rR3R_{1}\leq_{r}R_{3}.

3 Complexity Classes for Enumeration

In Section 1, we have already recalled two important tractable enumeration complexity classes, DelayP and IncP from [1]. Note that in [2, 13], these classes are defined slightly differently by restricting DelayP and IncP to those problems Enum_R\text{\sc Enum}{\_}R such that the corresponding problem Check_R\text{\sc Check}{\_}R is in P — in addition to the constraints on the allowed delays. We adhere to the definition of tractable enumeration classes from [1].

In contrast to counting complexity, defining a hierarchy of enumeration problems via the Check_R\text{\sc Check}{\_}R problem of binary relations RR does not seem appropriate. Note that while the same counting problem 𝒫{\mathcal{P}} can be defined by different relations, i.e., 𝒫=Count_R1{\cal P}=\text{\sc Count}{\_}R_{1} and 𝒫=Count_R2{\cal P}=\text{\sc Count}{\_}R_{2} for R1R2R_{1}\neq R_{2}, the relation associated with an enumeration problem is fixed.

Thus, we need an alternative approach for defining meaningful enumeration complexity classes. To this end, we first fix our computation model: Observe that there is a subtle difference between how Turing Machines and random access machines (RAMs) can access data in their “memory”. Due to the linear nature of the tapes of Turing Machines, accessing an exponential size data structure requires exponential time, even if just a small portion of its data is actually read. This is usually not a problem when studying decision or search problems, since writing an exponentially sized data structure onto the tape already requires exponential time, and as a result the additional exponential time to read the data structure has no more effect on the overall runtime.

This situation, however, changes for enumeration problems and polynomial delay, since it is now possible that, while computing an exponential number of solutions, an exponential size data structure accumulates. Thus computing another solution with only polynomial delay is not possible with Turing Machines if this requires some information from such a data structure. However, by maintaining suitable index structures, it might be possible to gather the necessary information in polynomial time from such a data structure on a random access machine (RAM) that allows to access its memory directly and not first needs to move the read/write head over the correct tape position. In fact, due to this property that allows to access (polynomially sized) parts of exponential size data in polynomial time, it is common to use the RAM model as a computational model for the study of enumeration problems (cf. [2]). We restrict ourselves here to polynomially bounded RAMs, i.e., throughout the computation of such a machine, the size of the content of each register is polynomially bounded in the size of the input.

For enumeration, we will also make use of RAMs with an 𝗈𝗎𝗍𝗉𝗎𝗍\mathsf{output}-instruction, as defined in [2]. This model can be extended further by introducing decision oracles. The input to the oracle is stored in special registers and the oracle takes consecutive non-empty registers as input. Moreover, following [14], we use a computational model that does not delete the input of an oracle call once such a call is made. For a detailed definition, refer to [2]. It is important to note that due to the exponential runtime of an enumeration algorithm and the fact that the input to an oracle is not deleted when the oracle is executed, the input to an oracle call may eventually become exponential as well. Clearly, this can only happen if exponentially many consecutive special registers are non-empty, since we assume also each special register to be polynomially bounded.

Using this we define a collection of enumeration complexity classes via oracles:

Definition 2 (enumeration complexity classes).

Let RR be a binary relation, and 𝒞{\mathcal{C}} a decision complexity class. Then we say that:

  • Enum_RDelayP𝒞\text{\sc Enum}{\_}R\in\text{\sf DelayP}^{\mathcal{C}} if there is a RAM MM with an oracle LL in 𝒞{\mathcal{C}} such that for any instance xx, MM enumerates R(x)R(x) with polynomial delay. The class IncP𝒞\text{\sf IncP}^{\mathcal{C}} is defined analogously.

  • Enum_RDelayPp𝒞\text{\sc Enum}{\_}R\in\text{\sf DelayP}_{p}^{\mathcal{C}} if there is a RAM MM with an oracle LL in 𝒞{\mathcal{C}} such that for any instance xx, MM enumerates R(x)R(x) with polynomial delay and the size of the input to every oracle call is polynomially bounded in |x||x|.

Note that the restriction of the oracle inputs to polynomial size makes a crucial difference when it comes to DelayP𝒞\text{\sf DelayP}^{\mathcal{C}}, where we have a discrepancy between the polynomial restriction (w.r.t. the input xx) on the time between two consecutive solutions are output and the possibly exponential size (w.r.t. the input xx) of oracle calls. No such discrepancy exists for IncP𝒞\text{\sf IncP}^{\mathcal{C}}, where the same polynomial upper bound w.r.t. the already computed solutions (resp. all solutions) applies both to the allowed time and to the size of the oracle calls. In fact, the lower computational power of DelayP compared with IncP can be compensated by equipping the lower class with a slightly more powerful oracle.

Theorem 1.

Let k0k\geq 0. Then DelayPΔk+1P=IncPΣkP\text{\sf DelayP}^{{\Delta}_{k+1}^{P}}=\text{\sf IncP}^{{\Sigma}_{k}^{P}}.

Proof.

Let k0k\geq 0. We start the proof by showing that DelayPΔk+1PIncPΣkP\text{\sf DelayP}^{{\Delta}_{k+1}^{P}}\supseteq\text{\sf IncP}^{{\Sigma}_{k}^{P}}. So let Enum_RIncPΣkP\text{\sc Enum}{\_}R\in\text{\sf IncP}^{{\Sigma}_{k}^{P}} with corresponding binary relation RR and let xΣx\in\Sigma^{*}. Fix an incremental delay algorithm 𝒜{\mathcal{A}} which uses a ΣkP{\Sigma}_{k}^{P}-oracle witnessing the membership Enum_RIncPΣkP\text{\sc Enum}{\_}R\in\text{\sf IncP}^{{\Sigma}_{k}^{P}} and let <<^{*} be an order on R(x)R(x) induced by algorithm 𝒜{\mathcal{A}}, i.e. the ii-th output of 𝒜{\mathcal{A}} on input xx is the ii-th element in <<^{*}. We define the following decision problem:

AnotherSolExtR𝒜\text{\sc AnotherSolExt}_{R}^{\mathcal{A}} Instance: y1,,yn,y,xΣy_{1},\ldots,y_{n},y^{\prime},x\in\Sigma^{*} Question: Is yy^{\prime} a prefix of yn+1y_{n+1}, where yn+1y_{n+1} is the (n+1)(n+1)-th element in R(x)R(x) w.r.t. <<^{*}?

We first note that AnotherSolExtR𝒜Δk+1P\text{\sc AnotherSolExt}_{R}^{\mathcal{A}}\in{\Delta}_{k+1}^{P}. Indeed, assume that we have given an instance y1,,yn,y,xΣy_{1},\ldots,y_{n},y^{\prime},x\in\Sigma^{*}. Then we can use 𝒜{\mathcal{A}} to enumerate the first n+1n+1 elements of R(x)R(x) in time 𝒪(poly(|x|,|n+1|))=𝒪(poly(|y1|++|yn|+|y|+|x|)){\mathcal{O}}(\operatorname{poly}(|x|,|n+1|))={\mathcal{O}}(\operatorname{poly}(|y_{1}|+\ldots+|y_{n}|+|y^{\prime}|+|x|)) and then check whether yy^{\prime} is a prefix of yn+1y_{n+1}. As 𝒜{\mathcal{A}} uses a ΣkP{\Sigma}_{k}^{P}-oracle, this decision can be made within PΣkP=Δk+1P\text{\sf P}^{{\Sigma}_{k}^{P}}={\Delta}_{k+1}^{P}. The membership Enum_RDelayPΔk+1P\text{\sc Enum}{\_}R\in\text{\sf DelayP}^{{\Delta}_{k+1}^{P}} follows immediately, as we can construct a polynomial delay algorithm with an AnotherSolExtR𝒜\text{\sc AnotherSolExt}_{R}^{\mathcal{A}}-oracle that enumerates Enum_R\text{\sc Enum}{\_}R in a similar way to commonly used enumeration algorithms, see [2, 5] or Proposition 5. This enumeration algorithm starts by computing some aΣa\in\Sigma such that the oracle on this input returns ’yes’. Then y1y_{1} (and also every other yiy_{i}) can be computed by repeatedly extending the previous input to the oracle by the unique element in Σ\Sigma such that the decision oracle AnotherSolExtR𝒜\text{\sc AnotherSolExt}_{R}^{\mathcal{A}} returns ’yes’.
Next we need to show that DelayPΔk+1PIncPΣkP\text{\sf DelayP}^{{\Delta}_{k+1}^{P}}\subseteq\text{\sf IncP}^{{\Sigma}_{k}^{P}}, so let Enum_RDelayPΔk+1P\text{\sc Enum}{\_}R\in\text{\sf DelayP}^{{\Delta}_{k+1}^{P}}, and let 𝒜{\mathcal{A}} be an algorithm witnessing this membership. Moreover, let LPΣkPL\in\text{\sf P}^{{\Sigma}_{k}^{P}} be the language used for the Δk+1P{\Delta}_{k+1}^{P}-oracle in 𝒜{\mathcal{A}}, with a polynomial qq and a language LΣkPL^{\prime}\in{\Sigma}_{k}^{P} such that LDTIMEL(q(n))L\in\text{\sf DTIME}^{L^{\prime}}(q(n)). Let pp be be the polynomial for the delay of 𝒜{\mathcal{A}}. We describe an algorithm {\mathcal{B}} that has an incremental delay of p(X)Yq(p(X)Y)p(X)\cdot Y\cdot q(p(X)\cdot Y) (here the indeterminate XX stands for the size of the input and the indeterminate YY for the number of previously output solutions) that uses a ΣkP{\Sigma}_{k}^{P}-oracle, such that {\mathcal{B}} enumerates Enum_R\text{\sc Enum}{\_}R. For this, let xΣx\in\Sigma^{*} and assume that we want to enumerate R(x)R(x). The algorithm {\mathcal{B}} works as follows:

  • Let y1y_{1} be the first element output by algorithm 𝒜{\mathcal{A}} on input xx. As this output can be computed by 𝒜{\mathcal{A}} in time p(|x|)p(|x|), at most p(|x|)p(|x|) many calls to the LL-oracle have been made with an input of size at most p(|x|)p(|x|). Thus the answer of every oracle call can be computed in time q(p(|x|))q(p(|x|)) using an LL^{\prime}-oracle. Therefore y1y_{1} can be output by {\mathcal{B}} in time p(|x|)q(p(|x|))p(|x|)\cdot q(p(|x|)) by running 𝒜{\mathcal{A}} until the first output, and simulating the oracle calls accordingly.

  • For n2n\geq 2, let yny_{n} be the nn-th element output by 𝒜{\mathcal{A}}. As with y1y_{1}, we can make the nn-th output of {\mathcal{B}} by running 𝒜{\mathcal{A}} until yny_{n} is output and simulating the oracle calls accordingly. Indeed, 𝒜{\mathcal{A}} takes p(|x|)np(|x|)\cdot n steps to output yny_{n}, with at most p(|x|)np(|x|)\cdot n oracle calls to LL with an input of size bounded by p(|x|)np(|x|)\cdot n. Thus yny_{n} can be computed in time p(|x|)nq(p(|x|n))p(|x|)\cdot n\cdot q(p(|x|\cdot n)) using an LL^{\prime}-oracle.

In fact, given that the classes ΔkP{\Delta}_{k}^{P} describe problems that can be solved in polynomial time by a deterministic machine with a Σk1P{\Sigma}_{k-1}^{P}-oracle, it is not very surprising that for enumeration algorithms, ΔkP{\Delta}_{k}^{P}-oracles can be simulated by Σk1P{\Sigma}_{k-1}^{P}-oracles, as long as one accounts for the potentially accumulating input to the ΔkP{\Delta}_{k}^{P}-oracles.

This property is not restricted to the case shown in Theorem 1, but applies to all ΔkP{\Delta}_{k}^{P}-oracles. As a result, in the remainder of this work, we omit any result regarding the classes DelayPpΔkP,DelayPΔkP\text{\sf DelayP}_{p}^{{\Delta}_{k}^{P}},\text{\sf DelayP}^{{\Delta}_{k}^{P}} or IncPΔkP\text{\sf IncP}^{{\Delta}_{k}^{P}}, as they are given implicitly by a result on DelayPpΣkP\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}} or IncPΣkP\text{\sf IncP}^{{\Sigma}_{k}^{P}} respectively. Indeed, Theorem 1 shows the equality of DelayPΔkP\text{\sf DelayP}^{{\Delta}_{k}^{P}} and IncPΣk1P\text{\sf IncP}^{{\Sigma}_{k-1}^{P}}. Concerning the remaining classes, observe that DelayPpP𝒞=DelayPp𝒞\text{\sf DelayP}_{p}^{\text{\sf P}^{{\mathcal{C}}}}=\text{\sf DelayP}_{p}^{{\mathcal{C}}} for any decision complexity class 𝒞{\mathcal{C}}; in particular we obtain DelayPpΔkP=DelayPpΣk1P\text{\sf DelayP}_{p}^{{\Delta}_{k}^{P}}=\text{\sf DelayP}_{p}^{{\Sigma}_{k-1}^{P}}. A similar results holds for the IncP𝒞\text{\sf IncP}^{{\mathcal{C}}} classes even without the bound on the input size to the decision oracle. This is due to the fact that the size of any input α\alpha to the decision oracle is at most polynomial in the combined size of the instance and number of outputs. Thus an incremental delay gives us enough time to make 𝗉𝗈𝗅𝗒(|α|)\mathsf{poly}(|\alpha|) many oracles calls, meaning that IncPΔkP=IncPΣk1P\text{\sf IncP}^{{\Delta}_{k}^{P}}=\text{\sf IncP}^{{\Sigma}_{k-1}^{P}}.

3.1 A Hierarchy of Enumeration Complexity Classes

We now prove that our classes provide strict hierarchies under the assumption that the polynomial hierarchy is strict.

Theorem 2.

Let k0k\geq 0. Then, unless the polynomial hierarchy collapses to the (k+1)(k+1)-st level,

DelayPpΣkPDelayPpΣk+1P,DelayPΣkPDelayPΣk+1P,IncPΣkPDelayPΣk+1P\displaystyle\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}}\subsetneq\text{\sf DelayP}_{p}^{{\Sigma}_{k+1}^{P}},\text{\sf DelayP}^{{\Sigma}_{k}^{P}}\subsetneq\text{\sf DelayP}^{{\Sigma}_{k+1}^{P}},\text{\sf IncP}^{{\Sigma}_{k}^{P}}\subsetneq\text{\sf DelayP}^{{\Sigma}_{k+1}^{P}}
and IncPΣkPIncPΣk+1P.\displaystyle\text{ and }\text{\sf IncP}^{{\Sigma}_{k}^{P}}\subsetneq\text{\sf IncP}^{{\Sigma}_{k+1}^{P}}.
Proof.

Let k0k\geq 0. By Theorem 1 and the definition of our classes we have that

DelayPΣkPDelayPΔk+1P=IncPΣkPDelayPΣk+1PIncPΣk+1P,\text{\sf DelayP}^{{\Sigma}_{k}^{P}}\subseteq\text{\sf DelayP}^{{\Delta}_{k+1}^{P}}=\text{\sf IncP}^{{\Sigma}_{k}^{P}}\subseteq\text{\sf DelayP}^{{\Sigma}_{k+1}^{P}}\subseteq\text{\sf IncP}^{{\Sigma}_{k+1}^{P}},

so we only need to show that DelayPpΣkPDelayPpΣk+1P\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}}\subsetneq\text{\sf DelayP}_{p}^{{\Sigma}_{k+1}^{P}} and IncPΣkPDelayPΣk+1P\text{\sf IncP}^{{\Sigma}_{k}^{P}}\subsetneq\text{\sf DelayP}^{{\Sigma}_{k+1}^{P}}. Let LL be a Σk+1P{\Sigma}_{k+1}^{P}-complete problem. Define a relation RL={(x,1)xL}R_{L}=\{(x,1)\mid x\in L\}. It is clear that Check_RL\text{\sc Check}{\_}R_{L} is Σk+1P{\Sigma}_{k+1}^{P}-complete. Moreover, the enumeration problem Enum_RL\text{\sc Enum}{\_}R_{L} is in DelayPpΣk+1P\text{\sf DelayP}_{p}^{{\Sigma}_{k+1}^{P}} (thus also in DelayPΣk+1P\text{\sf DelayP}^{{\Sigma}_{k+1}^{P}}). Assume that Enum_RLDelayPpΣkP\text{\sc Enum}{\_}R_{L}\in\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}} (or Enum_RLIncPΣkP\text{\sc Enum}{\_}R_{L}\in\text{\sf IncP}^{{\Sigma}_{k}^{P}}). Then, as there is only one output to the enumeration problem, Check_RL\text{\sc Check}{\_}R_{L} can be decided in polynomial time using a ΣkP{\Sigma}_{k}^{P}-oracle, meaning that Check_RLΔk+1P\text{\sc Check}{\_}R_{L}\in{\Delta}_{k+1}^{P} and thus the polynomial hierarchy collapses to the (k+1)(k+1)-st level. ∎

The statement of the following proposition is twofold: First, it shows that the complexity classes based on DelayP with a polynomial bound on the decision oracle and the complexity classes based on DelayP without such a bound, respectively, are very likely to be distinct. Second, the gap between DelayPpΣkP\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}} and DelayPΣkP\text{\sf DelayP}^{{\Sigma}_{k}^{P}} cannot be overcome by equipping the oracle-bounded enumeration complexity class with a slightly more powerful oracle, in contrast to the result of Theorem 1. Note that the proposition refers to the weak EXP hierarchy as defined in Definition 1.

Proposition 3.

Let k1k\geq 1. If EXPΔk+1EXP\text{\sf EXP}\subsetneq\Delta_{k+1}^{\text{\sf EXP}}, then

DelayPpΣkPDelayPΣkPDelayPpΣk+1P.\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}}\subsetneq\text{\sf DelayP}^{{\Sigma}_{k}^{P}}\not\subseteq\text{\sf DelayP}_{p}^{{\Sigma}_{k+1}^{P}}.

To show Proposition 3, we first need to prove the following result.

Lemma 4.

Let RR be a binary relation and k0k\geq 0. If Enum_RDelayPpΣkP\text{\sc Enum}{\_}R\in\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}}, then Check_REXP\text{\sc Check}{\_}R\in\text{\sf EXP}.

Proof.

Let (x,y)(x,y) be an instance of Check_R\text{\sc Check}{\_}R and let k0k\geq 0. Further let 𝒜{\mathcal{A}} be an enumeration algorithm witnessing the membership Enum_RDelayPpΣkP\text{\sc Enum}{\_}R\in\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}}. In order to decide whether (x,y)R(x,y)\in R, we simply enumerate all of R(x)R(x) and check whether yR(x)y\in R(x). Let q,rq,r be a polynomials such that the decision of the ΣkP{\Sigma}_{k}^{P}-oracle can be computed in 𝒪(2q(n)){\mathcal{O}}(2^{q(n)}), and the size of the input to any such decision oracle while executing 𝒜{\mathcal{A}} is bounded by rr. By the definition of polynomial delay and the fact that RR is a polynomial relation, there is some polynomial hh such that R(x)R(x) can be enumerated in time 𝒪(2q(r(n))+h(n)){\mathcal{O}}(2^{q(r(n))+h(n)}), i. e., in exponential time. ∎

of Proposition 3.

Assume that EXPΔk+1EXP\text{\sf EXP}\subsetneq\Delta_{k+1}^{\text{\sf EXP}}. Then there exists some polynomial qq and a language LL such that LΔk+1EXPEXPL\in\Delta_{k+1}^{\text{\sf EXP}}\setminus\text{\sf EXP} and LL can be decided in time 𝒪(2q(n)){\mathcal{O}}(2^{q(n)}) using a ΣkP{\Sigma}_{k}^{P}-oracle. Define the following enumeration problem:

Enum_D0\text{\sc Enum}{\_}D_{0} Instance: xΣx\in\Sigma^{*}. Output: All {0,1}\{0,1\}-words of length q(|x|)q(|x|), and 22 if xLx\in L

First note that Enum_D0DelayPΣkP\text{\sc Enum}{\_}D_{0}\in\text{\sf DelayP}^{{\Sigma}_{k}^{P}} by an algorithm 𝒜{\mathcal{A}} that enumerates all 2q(|x|)2^{q(|x|)} words in {0,1}q(|x|)\{0,1\}^{q(|x|)} in 𝒪(2q(|x|)){\mathcal{O}}(2^{q(|x|)}). While enumerating the trivial part of the output, 𝒜{\mathcal{A}} also has enough time to compute whether xLx\in L, and then makes the last output (’2’ or nothing) accordingly. Next assume that Enum_D0DelayPpΣkP\text{\sc Enum}{\_}D_{0}\in\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}} (or DelayPpΣk+1P\text{\sf DelayP}_{p}^{{\Sigma}_{k+1}^{P}}). Then, by Lemma 4, Check_D0EXP\text{\sc Check}{\_}D_{0}\in\text{\sf EXP}. Therefore we can check for all xΣx\in\Sigma^{*} whether (x,2)D0(x,2)\in D_{0}, which is equivalent to xLx\in L. Thus we can decide LL in exponential time, a contradiction. This proves also the second claim. ∎

By generalizing the statement of Lemma 4, we even have that DelayPp𝒞\text{\sf DelayP}^{{\mathcal{C}}}_{p} and DelayPΣkP\text{\sf DelayP}^{{\Sigma}_{k}^{P}} are incomparable for any k1k\geq 1 and any 𝒞{\mathcal{C}} within EXP under the assumption that the weak EXP hierarchy does not collapse. This is due to the fact that Check_R\text{\sc Check}{\_}R for an enumeration problem Enum_RDelayPp𝒞\text{\sc Enum}{\_}R\in\text{\sf DelayP}^{{\mathcal{C}}}_{p} is within EXP, whereas DelayPΣkP\text{\sf DelayP}^{{\Sigma}_{k}^{P}} contains an enumeration problem with corresponding check problem in Δk+1EXPEXP\Delta_{k+1}^{\text{\sf EXP}}\setminus\text{\sf EXP}.

DelayPΣk+1P\text{\sf DelayP}^{{\Sigma}_{k+1}^{P}}DelayPΣkP\text{\sf DelayP}^{{\Sigma}_{k}^{P}}DelayPΔk+1P=IncPΣkP\text{\sf DelayP}^{{\Delta}_{k+1}^{P}}=\text{\sf IncP}^{{\Sigma}_{k}^{P}}DelayPpΣk+1P\text{\sf DelayP}_{p}^{{\Sigma}_{k+1}^{P}}DelayPpΣkP\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}}?Theorem 2Proposition 3Theorem 2Proposition 3Theorem 1
Figure 1: Hierarchy among enumeration complexity classes for all k1k\geq 1. The lines without ‘?’ represent strict inclusions under some reasonable complexity theoretic assumption. For the line with ‘?’, inclusion holds, but it is not clear whether it is strict.

The relations among the enumeration complexity classes introduced in this chapter are summarized in Figure 1.

3.2 Connections to Decision Complexity

For a lot of problems, the set of all solutions can be enumerated by repeatedly solving differing instances of a corresponding decision problem and using the information gained from to construct the solutions.

For the class DelayPp𝒞\text{\sf DelayP}_{p}^{{\mathcal{C}}}, it turns out that the decision problem ExtSol_R\text{\sc ExtSol}{\_}R is most relevant for achieving the aforementioned goal. Indeed, the standard enumeration algorithm that constructs solutions bit by bit and tests whether the current partial candidate solution can still be extended to a solution [2, 5], and which outputs the solutions in lexicographical order, gives the following relationship.

Proposition 5.

Let RR be a binary relation. Further let k0k\geq 0 and 𝒞{ΔkP,ΣkP}{\mathcal{C}}\in\{{\Delta}_{k}^{P},{\Sigma}_{k}^{P}\}. If ExtSol_R𝒞\text{\sc ExtSol}{\_}R\in{\mathcal{C}} then Enum_RDelayPp𝒞\text{\sc Enum}{\_}R\in\text{\sf DelayP}_{p}^{{\mathcal{C}}}.

Proof.

Let k1k\geq 1. Further let qq be a polynomial such that for all (x,y)R(x,y)\in R, |y|q(|x|)|y|\leq q(|x|) holds. As DelayPpΔk+1P=DelayPpΣkP\text{\sf DelayP}_{p}^{{\Delta}_{k+1}^{P}}=\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}}, we show that Enum_RDelayPp𝒞\text{\sc Enum}{\_}R\in\text{\sf DelayP}_{p}^{{\mathcal{C}}} by giving an enumeration algorithm 𝒜{\mathcal{A}} with access to ExtSol_R\text{\sc ExtSol}{\_}R as an oracle. Assume that we have given xx as an input for Enum_R\text{\sc Enum}{\_}R. For every y1Σy_{1}\in\Sigma, we make an oracle call with (x,y1)(x,y_{1}) as input. If the oracle returns ’yes’, y1y_{1} can be extended to some yR(x)y\in R(x), so for every y2Σy_{2}\in\Sigma, we query (x,y1y2)(x,y_{1}y_{2}) to the oracle. Repeating this q(|x|)q(|x|) times gives a first answer yR(x)y\in R(x). With the use of backtracking, we can enumerate all of R(x)R(x) with a polynomial delay and access to the oracle ExtSol_R\text{\sc ExtSol}{\_}R, where every input to an oracle call is polynomially bounded by qq. ∎

When considering decision problems, typically not the problem ExtSol_R\text{\sc ExtSol}{\_}R is studied, but instead the problem Exist_R\text{\sc Exist}{\_}R that just asks, given some instance, whether there exists any solution at all. While in general unrelated, for a big class of problems, the so-called self-reducible problems, the problem ExtSol_R\text{\sc ExtSol}{\_}R can be solved via Exist_R\text{\sc Exist}{\_}R.

Definition 3 (self-reducibility).

Let T\leq_{T} denote Turing reductions. We say that a binary relation RR is self-reducible, if ExtSol_RTExist_R\text{\sc ExtSol}{\_}R\leq_{T}\text{\sc Exist}{\_}R.

Self-reducibility thus allows to reduce enumeration to the typical decision problem associated with RR. More formally, for self-reducible problems, Proposition 5 can be refined as follows.

Proposition 6.

Let RR be a binary relation, which is self-reducible, and k0k\geq 0. Then Exist_RΔkP\text{\sc Exist}{\_}R\in{\Delta}_{k}^{P} if and only if Enum_RDelayPpΣkP\text{\sc Enum}{\_}R\in\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}}.

The above proposition gives a characterization of the class DelayPpΣkP\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}} in terms of the complexity of decision problems in the case of self-reducible relations. Analogously, the notion of “enumeration self-reducibility” introduced by Kimelfeld and Kolaitis, that directly relates the search problem AnotherSol_R\text{\sc AnotherSol}{\_}R to its corresponding decision problem [4], allows a characterization of the class IncPΣkP\text{\sf IncP}^{{\Sigma}_{k}^{P}}.

Definition 4 ([4], enumeration self-reducibility).

A binary relation RR is enumeration self-reducible if AnotherSol_RTExist-AnotherSol_R\text{\sc AnotherSol}{\_}R\leq_{T}\text{\sc Exist-AnotherSol}{\_}R.

The following proposition generalizes two results to the higher levels of the enumeration hierarchy, by following analogous arguments as for the basic level IncP. The first result is given by Strozecki in [2, Prop. 2.14], and the second result is given by Kimelfeld and Kolaitis [4, Prop. 2.2].

Proposition 7.

Let RR be a binary relation and let k0k\geq 0.

  • The functional problem AnotherSol_R\text{\sc AnotherSol}{\_}R can be solved in polynomial time with access to a ΔkP{\Delta}_{k}^{P}-oracle if and only if Enum_RIncPΣkP\text{\sc Enum}{\_}R\in\text{\sf IncP}^{{\Sigma}_{k}^{P}}.

  • Let RR be enumeration self-reducible. Then Exist-AnotherSol_RΔkP\text{\sc Exist-AnotherSol}{\_}R\in{\Delta}_{k}^{P} if and only if Enum_RIncPΣkP\text{\sc Enum}{\_}R\in\text{\sf IncP}^{{\Sigma}_{k}^{P}}.

4 Declarative-style Reductions

As far as we know, only a few kinds of reductions between enumeration problems have been investigated so far. One such reduction is implicitly described in [15]. It establishes a bijection between sets of solutions. Different approaches introduced in [16] and in [17] relax this condition and allow for non-bijective reduction relations. We go further in that direction in proposing a declarative style reduction relaxing the isomorphism requirement while closing the relevant enumeration classes.

Definition 5 (e-reduction).

Let R1,R2ΣR_{1},R_{2}\subseteq\Sigma^{*} be binary relations. Then Enum_R1\text{\sc Enum}{\_}R_{1} reduces to Enum_R2\text{\sc Enum}{\_}R_{2} via an ee-reduction, Enum_R1eEnum_R2\text{\sc Enum}{\_}R_{1}\leq_{e}\text{\sc Enum}{\_}R_{2}, if there exist a function σ:ΣΣ\sigma:\Sigma^{*}\rightarrow\Sigma^{*} computable in polynomial time and a relation τΣ×Σ×Σ\tau\subseteq\Sigma^{*}\times\Sigma^{*}\times\Sigma^{*}, s.t. for all xΣx\in\Sigma^{*} the following holds. For yΣy\in\Sigma^{*}, let τ(x,y,):={zΣ(x,y,z)τ}\tau(x,y,-):=\{z\in\Sigma^{*}\mid(x,y,z)\in\tau\} and for zΣz\in\Sigma^{*}, let τ(x,,z):={yΣ(x,y,z)τ}\tau(x,-,z):=\{y\in\Sigma^{*}\mid(x,y,z)\in\tau\}. Then:

  1. 1.

    R1(x)=yR2(σ(x))τ(x,y,){R_{1}}(x)=\bigcup_{y\in{R_{2}}(\sigma(x))}\tau(x,y,-);

  2. 2.

    For all yR2(σ(x))y\in{R_{2}}(\sigma(x)), either τ(x,y,)=\tau(x,y,-)=\emptyset, or τ(x,y,)R1(x)\emptyset\subsetneq\tau(x,y,-)\subseteq{R_{1}}(x) and τ(x,y,)\tau(x,y,-) can be enumerated with polynomial delay in |x||x|; moreover τ(x,y,)=\tau(x,y,-)=\emptyset can only hold for a number of yy’s which is polynomially bounded in |x||x|;

  3. 3.

    For all zR1(x)z\in{R_{1}}(x), we have τ(x,,z)R2(σ(x))\tau(x,-,z)\subseteq{R_{2}}(\sigma(x)) and the size of τ(x,,z)\tau(x,-,z) is polynomially bounded in |x||x|.

R1(x){R_{1}}(x)R2(σ(x)){R_{2}}(\sigma(x)) One solution of R2(σ(x))R_{2}(\sigma(x)) may map to an unbounded number of solutions of R1(x)R_{1}(x). At most polynomially many solutions of R2(σ(x))R_{2}(\sigma(x)) may map to one solution of R1(x)R_{1}(x). zzyy

Figure 2: Illustration of relation τ\tau from Definition 5.

Intuitively, τ\tau establishes a relationship between instances xx, solutions yR2(σ(x))y\in{R_{2}}(\sigma(x)) and solutions zR1(x)z\in{R_{1}}(x). We can thus use τ\tau to design an enumeration algorithm for R1(x){R_{1}}(x) via an enumeration algorithm for R2(σ(x)){R_{2}}(\sigma(x)). The conditions imposed on τ\tau have the following meaning: By condition 1, the solutions zR1(x)z\in{R_{1}}(x) can be computed by iterating through the solutions yR2(σ(x))y\in{R_{2}}(\sigma(x)) and computing τ(x,y,)R1(x)\tau(x,y,-)\subseteq{R_{1}}(x). Conditions 2 and 3 make sure that the delay of enumerating R1(x){R_{1}}(x) only differs by a polynomial from the delay of enumerating R2(σ(x)){R_{2}}(\sigma(x)): Condition 2 ensures that, for every yy, the set τ(x,y,)\tau(x,y,-) can be enumerated with polynomial delay and that we do not encounter more than a polynomial number of “useless” yy (i.e., a solution yR2(σ(x))y\in{R_{2}}(\sigma(x)) which is associated with no solution zR1(x)z\in{R_{1}}(x)).

In principle, we may thus get duplicates zz associated with different values of yy. However, Condition 3 ensures that each zz can be associated with at most polynomially many values yy. Using a priority queue storing all zz that are output, we can avoid duplicates, cf. the proof of Proposition 8 or [2]. Figure 2 illustrates the idea of τ\tau, and a concrete example of an e-reduction is provided next.

Example 1.

The idea of the relation τ\tau can also be nicely demonstrated on an ee-reduction from 3-Colourabilitye\text{\sc 3-Colourability}^{e} to 4-Colourabilitye\text{\sc 4-Colourability}^{e} (enumerating all valid 3- respectively 4-colourings of a graph). We intentionally choose this reduction since there is no bijection between the solutions of the two problems.

Recall the classical many-one reduction between these problems, which takes a graph GG and defines a new graph GG^{\prime} by adding an auxiliary vertex vv and connecting it to all the other ones. This reduction can be extended to an ee-reduction with the following relation τ\tau: With every graph GG in the first component of τ\tau, we associate all valid 4-colourings (using 0, 1, 2, and 3) of GG^{\prime} in the third component of τ\tau. With each of those we associate the corresponding 3-colouring of GG in the second component. They are obtained from the 4-colourings by first making sure that vv is coloured with 33 (by “switching” the colour of vv with 3) and then by simply reading off the colouring of the remaining vertices.

The ee-reductions have two desirable and important properties, as stated next.

Proposition 8.
  1. 1.

    Reducibility via ee-reductions is a transitive relation.

  2. 2.

    Let 𝒞{ΣkP,ΔkPk0}{\mathcal{C}}\in\{{\Sigma}_{k}^{P},{\Delta}_{k}^{P}\mid k\geq 0\}. The classes DelayPp𝒞\text{\sf DelayP}_{p}^{\mathcal{C}}, DelayP𝒞\text{\sf DelayP}^{\mathcal{C}}, and IncP𝒞\text{\sf IncP}^{\mathcal{C}} are closed under ee-reductions.

Proof.

We first show that the enumeration classes DelayP𝒞\text{\sf DelayP}^{\mathcal{C}}, DelayPp𝒞\text{\sf DelayP}_{p}^{\mathcal{C}} and IncP𝒞\text{\sf IncP}^{\mathcal{C}} are closed under ee-reductions for 𝒞{ΣkP,ΔkPk0}{\mathcal{C}}\in\{{\Sigma}_{k}^{P},{\Delta}_{k}^{P}\mid k\geq 0\}. Let R1,R2R_{1},R_{2} be binary relations with Enum_R1eEnum_R2\text{\sc Enum}{\_}R_{1}\leq_{e}\text{\sc Enum}{\_}R_{2}. Further let σ\sigma and τ\tau be relations corresponding to the reduction Enum_R1eEnum_R2\text{\sc Enum}{\_}R_{1}\leq_{e}\text{\sc Enum}{\_}R_{2}, and assume that Enum_R2DelayP𝒞\text{\sc Enum}{\_}R_{2}\in\text{\sf DelayP}^{\mathcal{C}} (the cases where Enum_R2DelayPp𝒞\text{\sc Enum}{\_}R_{2}\in\text{\sf DelayP}_{p}^{\mathcal{C}} or Enum_R2IncP𝒞\text{\sc Enum}{\_}R_{2}\in\text{\sf IncP}^{{\mathcal{C}}} work along the same lines). Let 𝒜{\mathcal{A}} denote the enumeration algorithm for Enum_R2\text{\sc Enum}{\_}R_{2} with a polynomial delay and decision oracle 𝒞{\mathcal{C}}, and let {\mathcal{B}} be the polynomial delay algorithm enumerating τ(x,y,)\tau(x,y,-) for all x,yΣx,y\in\Sigma^{*}. Moreover, let pp be a polynomial such that for all zR1(x)z\in{R_{1}}(x), we have |τ(x,,z)|p(|x|)|\tau(x,-,z)|\leq p(|x|). The idea for an enumeration algorithm for Enum_R1\text{\sc Enum}{\_}R_{1} is to enumerate (without output) R2(σ(x)){R_{2}}(\sigma(x)) via 𝒜{\mathcal{A}}, and for every element yy that would be output by 𝒜{\mathcal{A}}, repeatedly add p(|x|)p(|x|) elements of τ(x,y,)\tau(x,y,-) to a priority queue. Then, whenever those elements are added to the queue, an element of the queue w.r.t. some order is output. This way, one can ensure polynomial (respectively incremental) delay albeit producing an exponentially large priority queue.
To give a detailed explanation of the enumeration algorithm for Enum_R1\text{\sc Enum}{\_}R_{1}, fix some xΣx\in\Sigma^{*}. Denote by 𝖭𝖾𝗐𝗈𝗎𝗍𝗉𝗎𝗍𝒜(σ(x))\mathsf{Newoutput}_{\mathcal{A}}(\sigma(x)) a new output made by the enumeration algorithm 𝒜{\mathcal{A}} when enumerating R2(σ(x)){R_{2}}(\sigma(x)), and similarly by 𝖭𝖾𝗐𝗈𝗎𝗍𝗉𝗎𝗍(y)\mathsf{Newoutput}_{\mathcal{B}}(y) a new output made by the enumeration algorithm {\mathcal{B}} when enumerating τ(x,y,)\tau(x,y,-). Algorithm 1 gives the algorithm for enumerating R1(x){R_{1}}(x). It is easy to see that this algorithm indeed works with a polynomial (respectively incremental) delay. When adding some element zz to the priority queue (line 10 of Algorithm 1), if zz is already in the queue, then 𝗈𝗎𝗍𝗉𝗎𝗍_𝗊𝗎𝖾𝗎𝖾\mathsf{output\_queue} remains unchanged, otherwise zz is added as the last element. Moreover, note that we do not delete elements in the priority queue in order to avoid the duplicates in the output.

Algorithm 1 Enumerate R1(x){R_{1}}(x)
1:i=1i=1
2:𝗈𝗎𝗍𝗉𝗎𝗍_𝗊𝗎𝖾𝗎𝖾=\mathsf{output\_queue}=\emptyset
3:
4:while  𝒜{\mathcal{A}} has not output all of R2(σ(x)){R_{2}}(\sigma(x)) do
5:  y=𝖭𝖾𝗐𝗈𝗎𝗍𝗉𝗎𝗍𝒜(σ(x))y=\mathsf{Newoutput}_{\mathcal{A}}(\sigma(x))
6:  𝗈𝗎𝗍𝗉𝗎𝗍_𝖽𝖾𝗅𝖺𝗒=1\mathsf{output\_delay}=1
7:  while  𝗈𝗎𝗍𝗉𝗎𝗍_𝖽𝖾𝗅𝖺𝗒<p(|x|)\mathsf{output\_delay}<p(|x|)  do
8:   z=𝖭𝖾𝗐𝗈𝗎𝗍𝗉𝗎𝗍(y)z=\mathsf{Newoutput}_{\mathcal{B}}(y)
9:   if  zz\neq\emptyset then
10:     Add zz to 𝗈𝗎𝗍𝗉𝗎𝗍_𝗊𝗎𝖾𝗎𝖾\mathsf{output\_queue}
11:     𝗈𝗎𝗍𝗉𝗎𝗍_𝖽𝖾𝗅𝖺𝗒=𝗈𝗎𝗍𝗉𝗎𝗍_𝖽𝖾𝗅𝖺𝗒+1\mathsf{output\_delay}=\mathsf{output\_delay}+1
12:   else
13:     y=𝖭𝖾𝗐𝗈𝗎𝗍𝗉𝗎𝗍𝒜(σ(x))y=\mathsf{Newoutput}_{\mathcal{A}}(\sigma(x))
14:   end if
15:   if y=y=\emptyset then
16:     Output (without deleting) the elements of 𝗈𝗎𝗍𝗉𝗎𝗍_𝗊𝗎𝖾𝗎𝖾\mathsf{output\_queue} starting from the ii-th element
17:     𝗈𝗎𝗍𝗉𝗎𝗍_𝖽𝖾𝗅𝖺𝗒=p(|x|)\mathsf{output\_delay}=p(|x|)
18:   end if
19:  end while
20:  if yy\neq\emptyset then
21:   Output (without deleting) the ii-th element of 𝗈𝗎𝗍𝗉𝗎𝗍_𝗊𝗎𝖾𝗎𝖾\mathsf{output\_queue}
22:  end if
23:  i=i+1i=i+1
24:end while

To show that reducibility via ee-reductions is a transitive relation, let R1,R2,R3ΣR_{1},R_{2},R_{3}\subseteq\Sigma^{*} be binary relations. Further let Enum_R1eEnum_R2\text{\sc Enum}{\_}R_{1}\leq_{e}\text{\sc Enum}{\_}R_{2} with corresponding polynomial p1p_{1} and relations τ1\tau_{1} and σ1\sigma_{1} and Enum_R2eEnum_R3\text{\sc Enum}{\_}R_{2}\leq_{e}\text{\sc Enum}{\_}R_{3} with corresponding polynomial p2p_{2} and relations τ2\tau_{2} and σ2\sigma_{2}. Define relations σ3\sigma_{3} as σ3:=σ2σ1\sigma_{3}:=\sigma_{2}\circ\sigma_{1} and τ3\tau_{3} as

τ3:={(x,y,z)Σ×Σ×ΣζΣ with (x,ζ,z)τ1 and (σ1(x),y,ζ)τ2}.\tau_{3}:=\{(x,y,z)\in\Sigma^{*}\times\Sigma^{*}\times\Sigma^{*}\mid\exists\zeta\in\Sigma^{*}\text{ with }(x,\zeta,z)\in\tau_{1}\text{ and }(\sigma_{1}(x),y,\zeta)\in\tau_{2}\}.

Let x,yΣx,y\in\Sigma^{*}. To show that τ3(x,y,)\tau_{3}(x,y,-) can be enumerated with a polynomial delay in |x||x|, we use the same idea for a polynomial delay enumeration as we did to show that the reduction closes the enumeration classes: First a single yR2(σ1(x))y^{\prime}\in{R_{2}}(\sigma_{1}(x)) is computed by τ2(σ1(x),y,)\tau_{2}(\sigma_{1}(x),y,-) (with a polynomial delay in σ1(|x|)\sigma_{1}(|x|) and thus polynomial delay in |x||x|), and then at most polynomially many y′′y^{\prime\prime} from τ1(x,y,)\tau_{1}(x,y^{\prime},-) are added to some priority queue. An element of the queue is output, and again polynomially many elements are added by the queue (possibly by first computing some new yR2(σ1(x))y^{\prime}\in{R_{2}}(\sigma_{1}(x)). This way, all of τ3(x,y,)\tau_{3}(x,y,-) can be enumerated with a polynomial delay in |x||x|. Moreover, it is easy to see that for all x,zΣx,z\in\Sigma^{*} we have |τ3(x,,z)|p1(p2(|x|))|\tau_{3}(x,-,z)|\leq p_{1}(p_{2}(|x|)) and that R2(x)=yR3(σ3(x))τ3(x,y,){R_{2}}(x)=\bigcup_{y\in{R_{3}}(\sigma_{3}(x))}\tau_{3}(x,y,-). It follows that indeed Enum_R1eEnum_R3\text{\sc Enum}{\_}R_{1}\leq_{e}\text{\sc Enum}{\_}R_{3}. ∎

Note that, as an additional benefit, Enum_R1eEnum_R2\text{\sc Enum}{\_}R_{1}\leq_{e}\text{\sc Enum}{\_}R_{2} does not imply Exist_R1mExist_R2\text{\sc Exist}{\_}R_{1}\leq_{m}\text{\sc Exist}{\_}R_{2}. An example for this behavior can be found in Theorem 14 below.

Thus, besides being a natural extension of existing reductions, Proposition 8 also shows that ee-reductions have important desirable properties. As a result, they are very well suited for reasoning about enumeration algorithms and complexities. For example, they allow to compare different enumeration problems, thus supporting to make statements on one problem “relative” to some other problem, and can be used to derive enumeration algorithms – hence complexity upper bounds.

In fact, they have already been implicitly used previously for these purposes. For example, an important result from [18] compares the complexity of two well-known problems by implicitly using an ee-reduction:

Example 2.

We denote by Dom-Enum the problem of enumerating all subset-minimal dominating sets of a given graph, and by Trans-Enum the problem of enumerating all minimal hitting sets of a hypergraph. In [18], it was shown that Trans-Enum can be enumerated via an enumeration algorithm for Dom-Enum, by mapping a hypergraph to an instance of Dom-Enum, and giving a (non-bijective) map between the minimal dominating sets and the minimal hitting sets. In fact this defines the following ee-reduction Trans-EnumeDom-Enum\text{\sc Trans-Enum}\leq_{e}\text{\sc Dom-Enum}:

  • Given a hypergraph {\mathcal{H}}, σ()\sigma({\mathcal{H}}) is defined as the co-bipartite incidence graph of {\mathcal{H}}, with

    V(σ())=\displaystyle V(\sigma({\mathcal{H}}))= V(){yeeE()}{v},\displaystyle V({\mathcal{H}})\cup\{y_{e}\mid e\in E({\mathcal{H}})\}\cup\{v\},
    E(σ())=\displaystyle E(\sigma({\mathcal{H}}))= {{x,ye}xV(),xe}{{x,y}x,yV()}\displaystyle\{\{x,y_{e}\}\mid x\in V({\mathcal{H}}),x\in e\}\cup\{\{x,y\}\mid x,y\in V({\mathcal{H}})\}
    {{v,x}xV()}{{ye,yf}e,fE()}.\displaystyle\cup\{\{v,x\}\mid x\in V({\mathcal{H}})\}\cup\{\{y_{e},y_{f}\}\mid e,f\in E({\mathcal{H}})\}.
  • Given σ()\sigma({\mathcal{H}}) and some minimal dominating set Dσ())D\subseteq\sigma({\mathcal{H}})), we have that

    τ(σ(),D,)={:D={x,ye} for some xV(),eE(),D: otherwise.\tau(\sigma({\mathcal{H}}),D,-)=\left\{\begin{array}[]{ll}\emptyset&:D=\{x,y_{e}\}\text{ for some }x\in V({\mathcal{H}}),e\in E({\mathcal{H}}),\\ D&:\text{ otherwise}.\end{array}\right.

Note that Dom-EnumeTrans-Enum\text{\sc Dom-Enum}\leq_{e}\text{\sc Trans-Enum} holds as well. The original question studied in [18] was whether any of these problems can be enumerated in a time that is polynomially in both, the size of the input and the size of the output. For the two problems Dom-Enum and Trans-Enum, this is a longstanding open problem. The conclusion in [18] was that if such an enumeration algorithm exists for one of the problems, then this is also possible for the other one. It can be shown that the existence of the ee-reductions between Dom-Enum and Trans-Enum also induces the same result. Moreover, they are also equivalent for all of the classes that are closed under ee-reductions as given in Proposition 8, i.e., if one of the two problems is in any of these classes, then the other problem is as well.

Another example that implicitly uses ee-reductions is [19]. In later sections of this paper, we will use them to retrieve reductions among enumeration problems as well. And even though we do not show any completeness results under ee-reduction, we will actually use them to show hardness under alternative reductions that will be introduced in the next section.

5 Procedural-style Reductions

Although Turing reductions are too strong to show completeness results for classes in the polynomial hierarchy, because the classes ΣkP{\Sigma}_{k}^{P} and Δk+1P{\Delta}_{k+1}^{P} have the same closure, Turing style reductions turn out to be meaningful in our case. In this section we introduce two types of reductions that are motivated by Turing reductions. Both of them are able to reduce between enumeration problems for which the ee-reductions seem to be too weak.

Towards this goal, we first have to define the concept of RAMs with an oracle for enumeration problems (such oracles were already introduced in [2]). The intuition behind the definition of such enumeration oracle machines is the following: For algorithms (i.e., Turing machines or RAMs in the case of enumeration) using a decision oracle for the language LL, we usually have a special instruction that given an input xx decides in one step whether xLx\in L, and then executes the next step of the algorithm accordingly. For an algorithm 𝒜{\mathcal{A}} using an enumeration oracle, an input xx to some Enum_R\text{\sc Enum}{\_}R-oracle returns in a single step (using the instruction 𝖭𝖮𝖮\mathsf{NOO}, see the definition below) a single element of R(x)R(x), and then 𝒜{\mathcal{A}} can proceed according to this output.

Definition 6 (Enumeration Oracle Machines).

Let Enum_R\text{\sc Enum}{\_}R be an enumeration problem. An Enumeration Oracle Machine with an enumeration oracle Enum_R\text{\sc Enum}{\_}R (EOM_R) is a RAM that has a sequence of new registers Ae,Oe(0),Oe(1),A_{e},O^{e}(0),O^{e}(1),\ldots and a new instruction 𝖭𝖮𝖮\mathsf{NOO} (next Oracle output). An EOM_R is oracle-bounded if the size of all inputs to the oracle is at most polynomial in the size of the input to the EOM_R.

When executing 𝖭𝖮𝖮\mathsf{NOO}, the machine writes – in one step – some yiR(x)y_{i}\in R(x) to register AeA_{e}, where xx is the word stored in Oe(0),Oe(1),O^{e}(0),O^{e}(1),\ldots and yiy_{i} is defined as follows:

Definition 7 (Next Oracle Output).

Let RR be a binary relation, π1,π2,\pi_{1},\pi_{2},\dots be the run of an EOM_R and assume that the kthk^{th} instruction is 𝖭𝖮𝖮\mathsf{NOO}, i.e., πk=𝖭𝖮𝖮\pi_{k}=\mathsf{NOO}. Denote with xix_{i} the word stored in Oe(0),Oe(1),O^{e}(0),O^{e}(1),\dots at step ii. Let K={πi{π1,,πk1}πi=𝖭𝖮𝖮 and xi=xk}K=\{\pi_{i}\in\{\pi_{1},\dots,\pi_{k-1}\}\mid\pi_{i}=\mathsf{NOO}\text{ and }x_{i}=x_{k}\}. Then the oracle output yky_{k} in πk\pi_{k} is defined as an arbitrary ykR(xk)y_{k}\in R(x_{k}) s.t. yky_{k} has not been the oracle output in any πiK\pi_{i}\in K. If no such yky_{k} exists, then the oracle output in πk\pi_{k} is undefined.

When executing 𝖭𝖮𝖮\mathsf{NOO} in step πk\pi_{k}, if the oracle output yky_{k} is undefined, then the register AeA_{e} contains some special symbol in step πk+1\pi_{k+1}. Otherwise in step πk+1\pi_{k+1} the register AeA_{e} contains yky_{k} .

Observe that since an EOM MeM^{e} is a polynomially bounded RAM and the complete oracle output is stored in the register AeA_{e}, only such oracle calls are allowed where the size of each oracle output is guaranteed to be polynomially bounded in the size of the input of MeM^{e}.

Using EOMs, we can now define another type of reductions among enumeration problems, reminiscent of classical Turing reductions. I.e., we say that one problem Enum_R1\text{\sc Enum}{\_}R_{1} reduces to another problem Enum_R2\text{\sc Enum}{\_}R_{2}, if Enum_R1\text{\sc Enum}{\_}R_{1} can be solved by an EOM using Enum_R2\text{\sc Enum}{\_}R_{2} as an enumeration oracle.

Definition 8 (DD-reductions, II-reductions).

Let R1R_{1} and R2R_{2} be binary relations.

  • We say that Enum_R1\text{\sc Enum}{\_}R_{1} reduces to Enum_R2\text{\sc Enum}{\_}R_{2} via DD-reductions, Enum_R1DEnum_R2\text{\sc Enum}{\_}R_{1}\leq_{D}\text{\sc Enum}{\_}R_{2}, if there is an oracle-bounded EOM_R2R_{2} that enumerates R1R_{1} in DelayP and is independent of the order in which the Enum_R2\text{\sc Enum}{\_}R_{2}-oracle enumerates its answers.

  • We say that Enum_R1\text{\sc Enum}{\_}R_{1} reduces to Enum_R2\text{\sc Enum}{\_}R_{2} via II-reductions, Enum_R1IEnum_R2\text{\sc Enum}{\_}R_{1}\leq_{I}\text{\sc Enum}{\_}R_{2}, if there is an EOM_R2R_{2} that enumerates R1R_{1} in IncP and is independent of the order in which the Enum_R2\text{\sc Enum}{\_}R_{2}-oracle enumerates its answers.

The following proposition shows that these reductions have desirable properties:

Proposition 9.

Reducibility via DD-reductions as well as reducibility via II-reductions are transitive relations.

Proof.

This can be proven along the same lines as Proposition 10 by substituting occurrences of enumeration RAMs with decision oracles by enumeration RAMs ∎

For DD-reductions, we require the EOM_R2R_{2} to be oracle-bounded. We would like to point out that this restriction is essential: if we drop it, then the classes DelayPp𝒞\text{\sf DelayP}_{p}^{\mathcal{C}} are not closed under the resulting reduction. Indeed, suppose that the DuD_{u}-reduction is defined similar to the DD-reduction but without the restriction to an oracle-bounded EOM. Then, abusing the decision problem AnotherSolExtR𝒜\text{\sc AnotherSolExt}_{R}^{\mathcal{A}} from the proof of Theorem 1 as an enumeration problem Enum_RA\text{\sc Enum}{\_}R_{A} (with output ’yes’ or ’no’), we can show that for any k1k\geq 1 and any Enum_RIncPΣkP\text{\sc Enum}{\_}R\in\text{\sf IncP}^{{\Sigma}_{k}^{P}} we have that Enum_RDuEnum_RA\text{\sc Enum}{\_}R\leq_{D_{u}}\text{\sc Enum}{\_}R_{A} but Enum_RADelayPpΣkP\text{\sc Enum}{\_}R_{A}\in\text{\sf DelayP}^{{\Sigma}_{k}^{P}}_{p}.

Proposition 10.

Let 𝒞ΣkP,k0{\mathcal{C}}\in{\Sigma}_{k}^{P},k\geq 0. The class DelayPp𝒞\text{\sf DelayP}_{p}^{{\mathcal{C}}} is closed under DD-reductions and the class IncP𝒞\text{\sf IncP}^{{\mathcal{C}}} is closed under II-reductions.

Proof.

Let MM be an oracle-bounded enumeration oracle machine with an enumeration oracle Enum_R2\text{\sc Enum}{\_}R_{2} witnessing that Enum_RDEnum_R2\text{\sc Enum}{\_}R\leq_{D}\text{\sc Enum}{\_}R_{2}. Let 𝒜{\mathcal{A}} be the polynomial delay algorithm with access to a polynomially bounded 𝒞{\mathcal{C}}-oracle We can construct a RAM MM^{\prime} that enumerates Enum_R1\text{\sc Enum}{\_}R_{1} with a polynomial delay using a polynomially bounded decision oracle 𝒞{\mathcal{C}}, by modifying the RAM MM as follows: Every time MM makes a call to an Enum_R2\text{\sc Enum}{\_}R_{2}-oracle, we use the algorithm 𝒜{\mathcal{A}} to retrieve what should be written to the register AeA_{e}. Assume that xx is the input to an oracle call of the RAM MM. Then the new RAM NN assigns two fixed addresses ax0a_{x}^{0} and ax1a_{x}^{1} to xx. Then NN can simulate the algorithm 𝒜{\mathcal{A}} on the registers R(2ax0),,R(2ax1)R(2^{a_{x}^{0}}),\ldots,R(2^{a_{x}^{1}}) until 𝒜{\mathcal{A}} would output some yΣy\in\Sigma^{*}. The RAM NN writes yy to AeA_{e}, and a simulation of a single oracle call is completed. Whenever xx is the input for a 𝖭𝖮𝖮\mathsf{NOO}-call, NN continues to simulate 𝒜{\mathcal{A}} on those registers; this way, the enumeration of R2(x){R_{2}}(x) does not need to start from the beginning every time xx is the input of an oracle call. The proof of the closure of IncP𝒞\text{\sf IncP}^{\mathcal{C}} under II-reductions can be done along the same lines. ∎

We note that all of these properties still hold when there is no oracle at all, i.e., for the classes DelayP and IncP.

Observe that the ee-reductions introduced in the previous section are a particular case of DD- and II-reductions. We will also use ee-reductions later when we establish completeness results for specific problems.

Proposition 11.

Let R1R_{1} and R2R_{2} be binary relations.

  • If Enum_R1eEnum_R2\text{\sc Enum}{\_}R_{1}\leq_{e}\text{\sc Enum}{\_}R_{2}, then Enum_R1DEnum_R2\text{\sc Enum}{\_}R_{1}\leq_{D}\text{\sc Enum}{\_}R_{2}.

  • If Enum_R1DEnum_R2\text{\sc Enum}{\_}R_{1}\leq_{D}\text{\sc Enum}{\_}R_{2}, then Enum_R1IEnum_R2\text{\sc Enum}{\_}R_{1}\leq_{I}\text{\sc Enum}{\_}R_{2}.

Proof.

The proof of the second claim follows immediately from the definitions. Now, if Enum_R1eEnum_R2\text{\sc Enum}{\_}R_{1}\leq_{e}\text{\sc Enum}{\_}R_{2}, then Algorithm 1 developed in the proof of Proposition 8 provides an oracle bounded EOM_R2R_{2} that enumerates R1R_{1} in DelayP. For enumerating R1(x)R_{1}(x) the calls to the enumeration oracle Enum_R2\text{\sc Enum}{\_}R_{2} are only made on the input σ(x)\sigma(x), where σ\sigma is the function used in the ee-reduction. ∎

Now, unlike for ee-reductions, the next theorem shows that the DD- and II-reduction induce complete problems for the enumeration complexity classes introduced in Section 3.

Theorem 12.

Let RR be a binary relation and k1k\geq 1 such that Exist_R\text{\sc Exist}{\_}R is ΣkP{\Sigma}_{k}^{P}-hard.

  • Enum_R\text{\sc Enum}{\_}R is DelayPpΣkP\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}}-hard via DD-reductions.

  • Enum_R\text{\sc Enum}{\_}R is IncPΣkP\text{\sf IncP}^{{\Sigma}_{k}^{P}}-hard via II-reductions.

  • If additionally Exist_R\text{\sc Exist}{\_}R is in ΣkP{\Sigma}_{k}^{P} and RR is self-reducible, then Enum_R\text{\sc Enum}{\_}R is DelayPpΣkP\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}}-complete via DD-reductions and IncPΣkP\text{\sf IncP}^{{\Sigma}_{k}^{P}}-complete via II-reductions.

Proof.

Let RR be a relation such that Exist_R\text{\sc Exist}{\_}R is ΣkP{\Sigma}_{k}^{P}-complete for some k1k\geq 1.

  • We have to prove that for any Enum_RDelayPpΣkP\text{\sc Enum}{\_}R^{\prime}\in\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}}, Enum_RDEnum_R\text{\sc Enum}{\_}R^{\prime}\leq_{D}\text{\sc Enum}{\_}R (IncPΣkP\text{\sf IncP}^{{\Sigma}_{k}^{P}}-hardness via II-reductions can be shown along the same lines). So let RR^{\prime} be a binary relation such that Enum_RDelayPpΣkP\text{\sc Enum}{\_}R^{\prime}\in\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}}. By definition there is some LΣkPL\in{\Sigma}_{k}^{P} such that Enum_RDelayPpL\text{\sc Enum}{\_}R^{\prime}\in\text{\sf DelayP}_{p}^{L}. Moreover let 𝒜{\mathcal{A}} be an algorithm witnessing this membership. As Exist_R\text{\sc Exist}{\_}R is ΣkP{\Sigma}_{k}^{P}-complete, we have that LmExist_RL\leq_{m}\text{\sc Exist}{\_}R, so any input xx to an LL-decision oracle when enumerating Enum_R\text{\sc Enum}{\_}R can be transformed to an instance xExist_Rx^{\prime}\in\text{\sc Exist}{\_}R such that xLx\in L iff xExist_Rx^{\prime}\in\text{\sc Exist}{\_}R, and this transformation can by done in polynomial time in the size of xx. Moreover, since the size of the oracle input is polynomial, this reduction can be computed within the time bounds of a polynomial delay, i.e. whenever a polynomial delay algorithm with an LL-oracle makes an oracle call with an input xx, the same algorithm can also perform a transformation to some xx^{\prime} before that oracle call, without violating the polynomial delay restriction. Therefore we can enumerate Enum_R\text{\sc Enum}{\_}R^{\prime} with an oracle bounded enumeration oracle machine with Enum_R\text{\sc Enum}{\_}R as follows: Whenever 𝒜{\mathcal{A}} would make a decision oracle call to LL with input xx, instead the machine transforms this to some xΣx^{\prime}\in\Sigma^{*}, and then makes a 𝖭𝖮𝖮\mathsf{NOO}-instruction with input xx^{\prime} to the Enum_R\text{\sc Enum}{\_}R-oracle. The 𝖭𝖮𝖮\mathsf{NOO}-instruction writes a nonempty string to the register AeA_{e} if and only if xExist_Rx^{\prime}\in\text{\sc Exist}{\_}R and thus if and only if xLx\in L. It follows that we can simulate the decision oracle call with an enumeration oracle call.

  • Membership of Enum_R\text{\sc Enum}{\_}R in DelayPpΣkP\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}} in this case follows immediately from Proposition 5. Since DelayPpΣkPIncPΣkP\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}}\subseteq\text{\sf IncP}^{{\Sigma}_{k}^{P}}, this also shows membership in IncPΣkP\text{\sf IncP}^{{\Sigma}_{k}^{P}}.

As a consequence, the enumeration problems ΣkSATe\Sigma_{k}\mathrm{SAT}^{e} and also ΠkSATe\Pi_{k}\mathrm{SAT}^{e} are natural complete problems for our enumeration complextiy classes:

Corollary 13.

Let k1k\geq 1. Then

  1. 1.

    ΣkSATe\Sigma_{k}\mathrm{SAT}^{e} is complete for DelayPpΣkP\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}} via DD-reductions.

  2. 2.

    ΠkSATe\Pi_{k}\mathrm{SAT}^{e} and Σk+1SATe\Sigma_{k+1}\mathrm{SAT}^{e} are complete for IncPΣk+1P\text{\sf IncP}^{{\Sigma}_{k+1}^{P}} via II-reductions. In particular SATe\mathrm{SAT}^{e} the enumeration variant of the traditional SAT problem is IncPNP\text{\sf IncP}^{\text{\sf NP}}-complete via II-reductions.

Proof.

The results for ΣkSATe\Sigma_{k}\mathrm{SAT}^{e} follow immediately from Theorem 12. It only remains to prove that that ΠkSATe\Pi_{k}\mathrm{SAT}^{e} and Σk+1SATe\Sigma_{k+1}\mathrm{SAT}^{e} are equivalent under II-reductions. Note that ΠkSATeIΣk+1SATe\Pi_{k}\mathrm{SAT}^{e}\leq_{I}\Sigma_{k+1}\mathrm{SAT}^{e} follows immediately from the fact that ΠkSATe\Pi_{k}\mathrm{SAT}^{e} is a special case of Σk+1SATe\Sigma_{k+1}\mathrm{SAT}^{e}, so it suffices to show that Σk+1SATeIΠkSATe\Sigma_{k+1}\mathrm{SAT}^{e}\leq_{I}\Pi_{k}\mathrm{SAT}^{e}. Thus consider an instance ψ\psi of Σk+1SATe\Sigma_{k+1}\mathrm{SAT}^{e} given as ψ(x):=y0y1Qkykϕ(x,y0,,yk)\psi(x):=\exists y_{0}\forall y_{1}\ldots Q_{k}y_{k}\phi(x,y_{0},\ldots,y_{k}). We can enumerate all solutions to ψ\psi as follows: The first input to a ΠkSATe\Pi_{k}\mathrm{SAT}^{e}-oracle is ψ0(x,y0):=y1Qkykϕ(x,y0,,yk)\psi_{0}(x,y_{0}):=\forall y_{1}\ldots Q_{k}y_{k}\phi(x,y_{0},\ldots,y_{k}), with free variables xx and y0y_{0}. A single 𝖭𝖮𝖮\mathsf{NOO} instruction thus gives a solution x0,y0x_{0},y^{\prime}_{0} for ψ0\psi_{0}, and x0x_{0} can be output as a solution to ψ\psi. The next solution can be found by calling a 𝖭𝖮𝖮\mathsf{NOO} instruction with the input ψ1(x,y0)=y1Qkyk(ϕ(x,y0,,yk)(x0x))\psi_{1}(x,y_{0})=\forall y_{1}\ldots Q_{k}y_{k}(\phi(x,y_{0},\ldots,y_{k})\wedge(x_{0}\neq x)). We only need to add the clauses of (x0x)(x_{0}\neq x) to the input registers of the oracle tape, and we can choose an encoding such that this does not alter the previous input, but extends it. The output x1,y0′′x_{1},y^{\prime\prime}_{0} of the second oracle call gives the second output x1x_{1} for the Σk+1SATe\Sigma_{k+1}\mathrm{SAT}^{e} problem. By repeating this method until an oracle call gives back the empty solution, we can enumerate the solutions of ψ\psi. ∎

Observe that, via different reductions, ΣkSATe\Sigma_{k}\mathrm{SAT}^{e} is complete for both, IncPΣkP\text{\sf IncP}^{{\Sigma}_{k}^{P}} and for the presumably smaller class DelayPpΣkP\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}}. This provides additional evidence that the two reductions nicely capture IncPΣkP\text{\sf IncP}^{{\Sigma}_{k}^{P}} and DelayPpΣkP\text{\sf DelayP}_{p}^{{\Sigma}_{k}^{P}}, respectively.

Roughly speaking Theorem 12 says that any enumeration problem whose corresponding decision problem is hard, is hard as well. An interesting question is whether there exist easy decision problems for which the corresponding enumeration problem is hard. We answer positively to this question in the next section.

6 Completeness Results

In this section, we prove completeness results under procedural-style reductions for several problems. We start by considering generalized satisfiability in Schaefer’s framework, and then continue by looking into minimal models of Boolean formulæ. Next, we study enumeration within the framework of abduction, and finally turn to the problem of enumerating repairs of an inconsistent database.

6.1 Generalized Satisfiability

In this subsection, we revisit a classification theorem obtained for the enumeration of generalized satisfiability [19] in our framework. It is convenient to first introduce some notation.

A logical relation of arity kk is a relation R{0,1}kR\subseteq\{0,1\}^{k}. A constraint, CC, is a formula C=R(x1,,xk)C=R(x_{1},\dots,x_{k}), where RR is a logical relation of arity kk and the xix_{i}’s are variables. An assignment mm of truth values to the variables satisfies the constraint CC if (m(x1),,m(xk))R\bigl{(}m(x_{1}),\dots,m(x_{k})\bigr{)}\in R. A constraint language Γ\Gamma is a finite set of nontrivial logical relations. A Γ\Gamma-formula ϕ\phi is a conjunction of constraints using only logical relations from Γ\Gamma. A Γ\Gamma-formula ϕ\phi is satisfied by an assignment m:var(ϕ){0,1}m:\mathrm{var}(\phi)\to\{0,1\} if mm satisfies all constraints in ϕ\phi.

Throughout the text we refer to different types of Boolean relations following Schaefer’s terminology, see [20, 19]. We say that a constraint language is Schaefer if every relation in Γ\Gamma is either Horn\mathrm{Horn}, dualHorn\mathrm{dualHorn}, bijunctive\mathrm{bijunctive}, or affine\mathrm{affine}.

SAT(Γ)e\mathrm{SAT}(\Gamma)^{e} Instance: ϕ\phi a Γ\Gamma-formula Output: All satisfying assignments of ϕ\phi.

The following theorem gives the complexity of this problem according to Γ\Gamma.

Theorem 14.

Let Γ\Gamma be a finite constraint language. If Γ\Gamma is Schaefer, then SAT(Γ)e\mathrm{SAT}(\Gamma)^{e} is in DelayP, otherwise it is DelayPpNP\text{\sf DelayP}_{p}^{\text{\sf NP}}-complete via DD-reductions and IncPNP\text{\sf IncP}^{\text{\sf NP}}-complete via II-reductions.

Proof.

The polynomial cases were studied in [19]. Let us now consider the case where Γ\Gamma is not Schaefer. Membership of SAT(Γ)e\mathrm{SAT}(\Gamma)^{e} in DelayPpNP\text{\sf DelayP}_{p}^{\text{\sf NP}} is clear. For the hardness, let us introduce T\mathrm{T} and F\mathrm{F} as the two unary constant relations T={1}\mathrm{T}=\{1\} and F={0}\mathrm{F}=\{0\}. According to Schaefer’s dichotomy theorem [20], deciding whether a Γ{F,T}\Gamma\cup\{\mathrm{F},\mathrm{T}\}-formula is satisfiable is NP-complete. Since this problem is self-reducible, according to Theorem 12, SAT(Γ{F,T})e\mathrm{SAT}(\Gamma\cup\{\mathrm{F},\mathrm{T}\})^{e} is DelayPpNP\text{\sf DelayP}_{p}^{\text{\sf NP}}-complete via DD-reductions. Let Imp\mathrm{Imp} denote the binary implication relation Imp(x,y)(xy)\mathrm{Imp}(x,y)\equiv(x\longrightarrow y). Given a Γ{F,T}\Gamma\cup\{\mathrm{F},\mathrm{T}\}-formula φ\varphi, one can construct a Γ{Imp}\Gamma\cup\{\mathrm{Imp}\} formula φ\varphi^{\prime} as follows. Let VV denote the set of variables in φ\varphi, V0V_{0} the set of variables xx on which lies the constraint F(x)F(x), and V1V_{1} the set of variables xx on which lies the constraint T(x)T(x). Let ff and tt be two fresh variables. Given a set of variables WW and a variable zz, φ[W/z]\varphi[W/z] denotes the formula obtained from φ\varphi in replacing each occurrence of a variable from WW by the variable zz. Then we set φ=φ[V0/f]φ[V1/t]xVImp(x,t)xVImp(f,x)\varphi^{\prime}=\varphi[V_{0}/f]\land\varphi[V_{1}/t]\land\bigwedge_{x\in V}\mathrm{Imp}(x,t)\land\bigwedge_{x\in V}\mathrm{Imp}(f,x). Clearly models of φ\varphi coincide with models of φ\varphi^{\prime} in which ff is set to false and tt to true, and φ\varphi^{\prime} might have two additional models, the all-zero one and the all-one one. In [19] it is essentially proven that if Γ\Gamma is not Schaefer then the implication relation Imp\mathrm{Imp} can be expressed by a Γ\Gamma-formula. Therefore, in this case the construction described above shows that SAT(Γ{F,T})eeSAT(Γ)e\mathrm{SAT}(\Gamma\cup\{\mathrm{F},\mathrm{T}\})^{e}\leq_{e}\mathrm{SAT}(\Gamma)^{e}, thus proving the DelayPpNP\text{\sf DelayP}_{p}^{\text{\sf NP}}-completeness via DD-reductions and IncPNP\text{\sf IncP}^{\text{\sf NP}}-completeness via II-reductions of the latter problem, according to Proposition 11. ∎

To come back to the above discussion, we point out that there exist constraint languages Γ\Gamma such that the decision problem SAT(Γ)\mathrm{SAT}(\Gamma) is in P, while the enumeration problem SAT(Γ)e\mathrm{SAT}(\Gamma)^{e} is DelayPpNP\text{\sf DelayP}_{p}^{\text{\sf NP}}-complete, namely 0-valid or 1-valid constraint languages that are not Schaefer.

6.2 Enumeration of Minimal Models

Let us now turn to the complexity of enumerating minimal models of a Boolean formula. Such an enumeration is ubiquitous in practical settings, ranging from verification, to databases and to knowledge representation among many others. One can consider subset-minimality as well as cardinal-minimality. Therefore we consider the two following enumeration problems: Circumscriptione\text{\sc Circumscription}^{e} denotes the problem of enumerating all subset-minimal models of a boolean formula and CardMinSATe\text{\sc CardMinSAT}^{e} denotes the problem of enumerating all cardinality-minimal models of a boolean formula. We pinpoint the complexity of these two enumeration problems.

Observe that contrary to the satisfiability problems we discussed above, enumeration of minimal models is not obviously self-reducible. In particular, the problem Circumscriptione\text{\sc Circumscription}^{e} is very unlikely to be self-reducible: The problem of deciding if a partial truth assignment can be extended to a subset minimal model is Σ2P{\Sigma}_{2}^{P}-complete [21], while deciding the existence of a minimal model is clearly NP-complete. Thus Circumscriptione\text{\sc Circumscription}^{e} is not self-reducible unless the polynomial hierarchy collapses to the first level.

Theorem 15.

Circumscriptione\text{\sc Circumscription}^{e} is IncPNP\text{\sf IncP}^{\text{\sf NP}}-complete via II-reductions.

Proof.

Hardness follows immediately from Theorem 12, since deciding the existence of a (minimal) model of a Boolean formula is NP-complete.

To obtain membership, we show that Circumscriptione\text{\sc Circumscription}^{e} can be even enumerated in DelayPNP\text{\sf DelayP}^{\text{\sf NP}}. Consider a boolean formula ϕ(x1,,xn)\phi(x_{1},\ldots,x_{n}), and assume that we want to enumerate the minimal models of ϕ\phi. We start by copying ϕ\phi to the oracle registers. A very first minimal model xx^{\prime} can be achieved by a greedy algorithm using an NP oracle. Next we extend ϕ\phi in the oracle registers to ϕ=ϕ((x1<x1)(xn<xn))\phi^{\prime}=\phi\wedge((x_{1}<x_{1}^{\prime})\vee\ldots\vee(x_{n}<x_{n}^{\prime})) and again get a minimal model x′′x^{\prime\prime} for ϕ\phi^{\prime} using a greedy algorithm with an NP-oracle. This is also a minimal model for ϕ\phi; repeatedly extending ϕ\phi and then computing a minimal model via a greedy algorithm achieves the membership CircumscriptioneDelayPNP\text{\sc Circumscription}^{e}\in\text{\sf DelayP}^{\text{\sf NP}} and thus also CircumscriptioneIncPNP\text{\sc Circumscription}^{e}\in\text{\sf IncP}^{\text{\sf NP}}. ∎

What makes the completeness result obtained for Circumscriptione\text{\sc Circumscription}^{e} surprising is the discrepancy from the behaviour of the counting variant of the problem: The counting variant of Circumscriptione\text{\sc Circumscription}^{e} is a prototypical #coNP\#\cdot\text{\sf coNP}-complete problem [22], and thus of the same hardness as the counting variant of Π1SATe\Pi_{1}\mathrm{SAT}^{e}. However, for enumeration we have that Circumscriptione\text{\sc Circumscription}^{e} shows the same complexity as Σ1SATe\Sigma_{1}\mathrm{SAT}^{e}, which is considered to be lower than that of Π1SATe\Pi_{1}\mathrm{SAT}^{e}.

Theorem 16.

CardMinSATe\text{\sc CardMinSAT}^{e} is DelayPpNP\text{\sf DelayP}_{p}^{\text{\sf NP}}-complete via DD-reductions and IncPNP\text{\sf IncP}^{\text{\sf NP}}-complete via II-reductions.

Proof.

Hardness follows again immediately from Theorem 12.

Membership of CardMinSATe\text{\sc CardMinSAT}^{e} in DelayPpNP\text{\sf DelayP}_{p}^{\text{\sf NP}} (and a fortiori in IncPNP\text{\sf IncP}^{\text{\sf NP}}) follows from the fact that polynomial time with access to an NP-oracle gives us the possibility to compute first the minimal cardinality of models. Having this information we can enumerate all cardinality-minimal models by the standard binary search tree with an NP-oracle that enumerates them in lexicographical order. ∎

6.3 Model-based Diagnosis

The problem of model-based diagnosis [23] is ubiquitous in practical settings. A usual formulation of this problem is as follows: given a system description composed of some components, and an observation inconsistent with the system description, the goal is to identify a cardinality-minimal set of components which, if declared faulty and thus put out of the system description, restores the consistency between the model and the observation. In recent years the practical enumeration of minimum-size diagnoses has gained interest through translations to MaxSAT instances and the use of efficient MaxSAT solvers (see e.g. [24]).

Formally a system description can be represented by a consistent set of propositional formulæ, each encoding the normal behavior of a component. The observation is represented by an additional formula that is inconsistent with the former set of formulæ. Thus we get the following enumeration problem.

Model-Based Diagnosise\text{\sc Model-Based Diagnosis}^{e} Instance: ={ϕ1,,ϕn}{\cal B}=\{\phi_{1},\ldots,\phi_{n}\} a consistent set of formulæ, μ\mu a satisfiable formula inconsistent with {\mathcal{B}} Output: All cardinality-maximal subsets {\cal B^{\prime}}\subseteq{\cal B} such that ϕϕμ\displaystyle\bigwedge_{\phi\in{\cal B^{\prime}}}\phi\land\mu is satisfiable.

Observe that for this enumeration problem, the corresponding decision problem Exist_R\text{\sc Exist}{\_}R is trivial because there always is a solution {\mathcal{B}}^{\prime}. Nevertheless we prove hardness by an ee-reduction from a previously identified hard problem. So contrary to all results above, we obtain here a hardness result for an enumeration problem which does not rely on hardness of any related decision problem.

The following theorem settles the complexity of Model-Based Diagnosise\text{\sc Model-Based Diagnosis}^{e} in our hierarchy.

Theorem 17.

Model-Based Diagnosise\text{\sc Model-Based Diagnosis}^{e} is DelayPpNP\text{\sf DelayP}_{p}^{\text{\sf NP}}-complete via DD-reductions and IncPNP\text{\sf IncP}^{\text{\sf NP}}-complete via II-reductions.

Proof.

Membership of Model-Based Diagnosise\text{\sc Model-Based Diagnosis}^{e} in DelayPpNP\text{\sf DelayP}_{p}^{\text{\sf NP}} (and a fortiori in IncPNP\text{\sf IncP}^{\text{\sf NP}}) follows from the fact that polynomial time with access to an NP-oracle gives us the possibility to compute first the maximal cardinality of subsets of {\cal B} that are consistent with μ\mu. Having this information we can enumerate all such cardinality-maximal subsets by the standard binary search tree with an NP-oracle that enumerates them in lexicographical order.

For hardness we show that CardMinSATeeModel-Based Diagnosise\text{\sc CardMinSAT}^{e}\leq_{e}\text{\sc Model-Based Diagnosis}^{e}, thus proving that Model-Based Diagnosise\text{\sc Model-Based Diagnosis}^{e} is DelayPpNP\text{\sf DelayP}_{p}^{\text{\sf NP}}-hard via DD-reductions and IncPNP\text{\sf IncP}^{\text{\sf NP}}-hard via II-reductions, according to Proposition 11 and Proposition 15. Let ϕ\phi be a formula given as an instance of CardMinSATe\text{\sc CardMinSAT}^{e}, and assume var(ϕ)={x1,,xn}\mathrm{var}(\phi)=\{x_{1},\ldots,x_{n}\}. Without loss of generality suppose in addition that ϕ\phi is not 0-valid, i.e., is not satisfied by the all-zero assignment. We define a corresponding instance σ(ϕ)\sigma(\phi) of Model-Based Diagnosise\text{\sc Model-Based Diagnosis}^{e} as follows: Let {\cal B} consist of the nn formulæ  ϕi=(ϕx0)(¬xix0)\phi^{\prime}_{i}=(\phi\lor x_{0})\land(\neg x_{i}\lor x_{0}) for i=1,,ni=1,\ldots,n, and let μ=¬x0\mu=\neg x_{0}, where x0x_{0} is a fresh variable. Observe that on the one hand the set {\cal B} is consistent (set x0x_{0} to true), and on the other hand it is inconsistent with μ\mu (since by assumption ϕ\phi is not 0-valid). It is easy to see that there is a bijection π\pi mapping the cardinality-minimal models xx^{\prime} of ϕ\phi to cardinality-maximal subsets of {\cal B} that are consistent with μ\mu. Thus we can define a relation τ\tau with τ(σ(ϕ),x,)=π(x)\tau(\sigma(\phi),x^{\prime},-)=\pi(x^{\prime}), showing that CardMinSATeeModel-Based Diagnosise\text{\sc CardMinSAT}^{e}\leq_{e}\text{\sc Model-Based Diagnosis}^{e}. ∎

6.4 Abduction

We now provide an example of an enumeration problem hard in a higher level of the hierarchy, namely abduction. Abduction is a well-studied form a non-monotonic reasoning. Given a certain consistent knowledge, abductive reasoning is used to generate explanations for observed manifestations. We consider here propositional abduction, in which the knowledge base as well as the manifestations are represented by propositional formulæ  [21].

The enumeration problem can be formalized as follows:

Abductione\text{\sc Abduction}^{e} Instance: Γ\Gamma a set of formulæ (knowledge), HH a set of literals (hypotheses), qq a variable that does not occur in HH (manifestation). Output: All sets EHE\subseteq H such that ΓE\Gamma\land E is satisfiable and ΓEq\Gamma\land E\models q (equivalently, ΓE¬q\Gamma\land E\land\neg q is unsatisfiable).

The decision problem Abduction corresponding to this variant of abduction is known to be Σ2P{\Sigma}_{2}^{P}-complete, see, e.g., [25]. Based on this we obtain hardness of the enumeration problem. Though this is maybe not very surprising, we mention this problem here as a first example of a problem whose enumeration is even harder than those we studied before, at least under the assumption that the polynomial hierarchy does not collapse.

Theorem 18.

Abductione\text{\sc Abduction}^{e} is DelayPpΣ2P\text{\sf DelayP}_{p}^{{\Sigma}_{2}^{P}}-complete via DD-reductions and IncPΣ2P\text{\sf IncP}^{{\Sigma}_{2}^{P}}-complete via II-reductions.

Proof.

As we have mentioned above, the associated decision problem is Σ2P{\Sigma}_{2}^{P}-complete. Also, note that the problem is self-reducible in the sense of Definition 3. Given an instance (Γ,H,q)(\Gamma,H,q) of Abductione\text{\sc Abduction}^{e} and a partial solution EHE\subseteq H, EE can be extended to an explanation iff (ΓE,H,q)Abduction(\Gamma\land E,H,q)\in\text{\sc Abduction}. Therefore, according to the last statement of Theorem 12, the theorem follows. ∎

6.5 Database Repairs

Finally, we provide an example of an enumeration problem from the database domain, more specifically the problem of enumerating all “repairs” of an inconsistent database. In this problem, we are given a database instance DD (i.e, simply a finite structure given by a domain and a collection of relations; for our purposes, it is most convenient to represent DD as a set of ground atoms) and a set CC of integrity constraints (i.e., in general, a set of formulæ  from some fragment of first-order logic). Now suppose that DD is inconsistent, i.e., D⊧̸CD\not\models C holds. Then we are interested in enumerating the possible repairs. A repair is a database instance II which satisfies CC and which differs minimally from DD. The term “differs minimally” can be defined in several ways. The most common approach is the one introduced by Arenas et al. [26]: here, repairs are obtained from the original database by inserting or deleting ground atoms to or from DD, respectively. Then “minimal difference” means that the symmetric set difference Δ(D,I)\Delta(D,I) is minimal w.r.t. subset inclusion. More formally, let Δ(D,I)=(DI)(ID)\Delta(D,I)=(D\setminus I)\cup(I\setminus D). Then II is a repair of DD w.r.t. CC if ICI\models C (i.e., II is consistent w.r.t. CC) and there does not exist an instance II^{\prime} that satisfies CC and Δ(D,I)Δ(D,I)\Delta(D,I^{\prime})\subsetneq\Delta(D,I).

Many different fragments of first-order logic have been studied for the definition of the integrity constraints CC. We only look at one such fragment here, namely equality generating dependencies (EGDs, for short). EGDs are a classical formalism for defining database constraints [27]. They generalize functional dependencies (FDs), which in turn generalize key dependencies (KDs). Formally, they are defined as formulæ of the form

x(ϕ(x)xi=xj),\forall\vec{x}\big{(}\phi(\vec{x})\rightarrow x_{i}=x_{j}\big{)},

where ϕ\phi is a conjunction of atoms over the predicate symbols occurring in DD, x\vec{x} denotes the variables occurring in these atoms, and xi,xjx_{i},x_{j} are two variables from x\vec{x}. The meaning of such an EGD is that, for every variable binding λ\lambda on the variables x\vec{x}, such that applying λ\lambda to the atoms in ϕ(x)\phi(\vec{x}) sends all atoms of ϕ(x)\phi(\vec{x}) into the database instance DD, it must be the case that λ(xi)=λ(xj)\lambda(x_{i})=\lambda(x_{j}) holds. Following the usual notational convention in the database literature, we will omit the quantifiers and denote EGDs of the above form simply as ϕ(x)xi=xj\phi(\vec{x})\rightarrow x_{i}=x_{j} with the understanding that all variables occurring in an EGD are universally quantified.

The enumeration problem considered here is defined as follows:

Repaire\text{\sc Repair}^{e} Instance: Database instance DD, set CC of EGDs Output: DD             if DCD\models C and All repairs II of DD w.r.t. CC  if D⊧̸CD\not\models C.

As in Section 6.3, we observe that for this enumeration problem, the corresponding decision problem Exist_R\text{\sc Exist}{\_}R is trivial because for every inconsistent database instance, the existence of a repair is guaranteed. Moreover, it is worth mentioning that a different variant of repair enumeration has been recently studied in [28], where a different type of integrity constraints was considered and prereferences were taken into account.

Several decision problems have been studied in the context of repairs. The most intensively studied one is the Consistent Query Answering problem, i.e., given a database instance DD, a set CC of integrity constraints and a boolean query QQ, is the query QQ true in every repair II of DD, w.r.t. CC. For EGDs as constraint language and conjunctive queries as query language, this problem has been shown to be Π2P{\Pi}_{2}^{P}-complete [29]. Another decision problem is the Repair Checking problem, i.e., given database instances DD and II, and a set CC of integrity constraints, is II a repair of DD w.r.t. CC. In other words, this is the Check problem corresponding to the enumeration problem Repaire\text{\sc Repair}^{e}. For EGDs, this decision problem is DP-complete [29]. Definitely a bit more surprising than in case of Abductione\text{\sc Abduction}^{e}, we get IncPΣ2P\text{\sf IncP}^{{\Sigma}_{2}^{P}}-completeness also for the Repaire\text{\sc Repair}^{e} problem. In particular, the hardness-proof is more involved than for the previously studied problems.

Theorem 19.

Repaire\text{\sc Repair}^{e} is IncPΣ2P\text{\sf IncP}^{{\Sigma}_{2}^{P}}-complete via II-reductions.

Proof.

For the membership proof, it is important to note that repairs of DD w.r.t. a set of EGDs can only be obtained by deletions, i.e., if a constraint is violated, it does not help to add further atoms. In other words, EGDs have a monotonic behaviour in the sense that if a database instance II violates an EGD, then also every superset of II does. This allows us to redefine Repaire\text{\sc Repair}^{e} as Enum_R\text{\sc Enum}{\_}R, where the relation RR consists of pairs ((D,C),V)((D,C),V) such that

  • DD is a database instance containing N0N\geq 0 atoms, which are numbered as A1,,ANA_{1},\dots,A_{N},

  • CC is a set of EGDs and

  • VV is a word of length NN over {0,1}\{0,1\}, where V(i)=0V(i)=0 means that we delete AiA_{i} from DD and V(i)=1V(i)=1 means that we retain AiA_{i} in DD.

We observe that ExtSol_RΣ2P\text{\sc ExtSol}{\_}R\in{\Sigma}_{2}^{P}: Given some word V1{0,1}NkV_{1}\in\{0,1\}^{N-k}, we need a non-deterministic guess for the instantiation of some V2{0,1}kV_{2}\in\{0,1\}^{k} and then we need to call a DP-oracle (or, equivalently, two NP-oracles) to check if the word V1V2V_{1}V_{2} represents a repair. Thus Enum_RDelayPpΣ2P\text{\sc Enum}{\_}R\in\text{\sf DelayP}^{{\Sigma}_{2}^{P}}_{p} by Proposition 5, meaning that RepaireIncPΣ2P\text{\sc Repair}^{e}\in\text{\sf IncP}^{{\Sigma}_{2}^{P}}.

For the hardness proof, we first note that the IncPΣ2P\text{\sf IncP}^{{\Sigma}_{2}^{P}}-completeness of Π1SATe\Pi_{1}\mathrm{SAT}^{e} via II-reductions from Corollary 13 can be strengthened in the sense that we may restrict the instances to 3-DNF (i.e., the matrix of the formulæ under investigation is in DNF such that each implicant consists of 3 literals. Then our IncPΣ2P\text{\sf IncP}^{{\Sigma}_{2}^{P}}-completeness proof is by an ee-reduction from Π1SATe\Pi_{1}\mathrm{SAT}^{e}, where we assume w.l.o.g., that the instances of Π1SATe\Pi_{1}\mathrm{SAT}^{e} are in 3-DNF.

Consider an arbitrary instance of Π1SATe\Pi_{1}\mathrm{SAT}^{e}, i.e., a quantified boolean formula ψ(x)=yϕ(x,y)\psi(\vec{x})=\forall\vec{y}\phi(\vec{x},\vec{y}). Let x=x1,,xk\vec{x}=x_{1},\dots,x_{k} and y=y1,,y\vec{y}=y_{1},\dots,y_{\ell}. By the restriction to 3-DNF, ϕ(x,y)\phi(\vec{x},\vec{y}) is of the form ϕ(x,y)=i=1m(li1li2li3)\phi(\vec{x},\vec{y})=\bigvee_{i=1}^{m}(l_{i1}\wedge l_{i2}\wedge l_{i3}), where mm denotes the number of implicants in ϕ\phi and lijl_{ij} with j{1,2,3}j\in\{1,2,3\} is the jj-th literal in the ii-th implicant, i.e., each lijl_{ij} is of the form xαx_{\alpha}, ¬xα\neg x_{\alpha}, yβy_{\beta}, or ¬yβ\neg y_{\beta} with α{1,,k}\alpha\in\{1,\dots,k\} and β{1,,}\beta\in\{1,\dots,\ell\}.

From this we define an instance σ(ψ(x))=(D,C)\sigma(\psi(\vec{x}))=(D,C) of Repaire\text{\sc Repair}^{e}. The relation symbols used in this instance are {a,q}{p1,,pk}{b0,b1}\{a,q\}\cup\{p_{1},\dots,p_{k}\}\cup\{b_{0},b_{1}\} It is convenient to define the following subformulæ:

χ=\displaystyle\chi={} b0(v0)b1(v1)q(v0,v1)q(v1,v0)\displaystyle b_{0}(v_{0})\wedge b_{1}(v_{1})\wedge q(v_{0},v_{1})\wedge q(v_{1},v_{0})\wedge\mbox{}
a(v0,v0,v0)a(v0,v0,v1)a(v0,v1,v0)a(v0,v1,v1)\displaystyle a(v_{0},v_{0},v_{0})\wedge a(v_{0},v_{0},v_{1})\wedge a(v_{0},v_{1},v_{0})\wedge a(v_{0},v_{1},v_{1})\wedge\mbox{}
a(v1,v0,v0)a(v1,v0,v1)a(v1,v1,v0)\displaystyle a(v_{1},v_{0},v_{0})\wedge a(v_{1},v_{0},v_{1})\wedge a(v_{1},v_{1},v_{0})
π=\displaystyle\pi={} i=1kpi(wi,wi)\displaystyle\bigwedge_{i=1}^{k}p_{i}(w_{i},w^{\prime}_{i})
ψ=\displaystyle\psi^{*}={} i=1ma(li1,li2,li3)\displaystyle\bigwedge_{i=1}^{m}a(l^{*}_{i1},l^{*}_{i2},l^{*}_{i3})

where we define lij=zl^{*}_{ij}=z if lijl_{ij} is the positive literal zz and lij=zl_{ij}^{*}=z^{\prime} if lijl_{ij} is the negative literal ¬z\neg z. For example, [(x¬yz)(¬xyz)]=a(x,yz)a(x,y,z)[(x\wedge\neg y\wedge z)\vee(\neg x\wedge y\wedge z)]^{*}=a(x,y^{\prime}z)\wedge a(x^{\prime},y,z).

Then the database DD of our instance of Repaire\text{\sc Repair}^{e} looks as follows:

D=\displaystyle D={} PQAE with\displaystyle P\cup Q\cup A\cup E\mbox{ with }
P=\displaystyle P={} {p1(0,1),p1(1,0),p2(0,1),p2(1,0),,pk(0,1),pk(1,0)}\displaystyle\{p_{1}(0,1),p_{1}(1,0),p_{2}(0,1),p_{2}(1,0),\dots,p_{k}(0,1),p_{k}(1,0)\}
Q=\displaystyle Q={} {q(0,1),q(1,0)}\displaystyle\{q(0,1),q(1,0)\}
A=\displaystyle A={} {a(0,0,0),a(0,0,1),a(0,1,0),a(0,1,1),a(1,0,0),a(1,0,1),a(1,1,0)}\displaystyle\{a(0,0,0),a(0,0,1),a(0,1,0),a(0,1,1),a(1,0,0),a(1,0,1),a(1,1,0)\}
E=\displaystyle E={} {b0(0),b1(1)}\displaystyle\{b_{0}(0),b_{1}(1)\}

Finally, we define the set CC of integrity constraints:

C=\displaystyle C={} 1ik{χπpi(x,x)pi(x,x)x=x}\displaystyle\bigcup_{1\leq i\leq k}\{\chi\wedge\pi\wedge p_{i}(x,x^{\prime})\wedge p_{i}(x^{\prime},x)\rightarrow x=x^{\prime}\} (C1)
{χπi=1kpi(xi,xi)j=1q(yj,yj)ψx1=x1}\displaystyle\cup\{\chi\wedge\pi\wedge\bigwedge_{i=1}^{k}p_{i}(x_{i},x^{\prime}_{i})\wedge\bigwedge_{j=1}^{\ell}q(y_{j},y^{\prime}_{j})\wedge\psi^{*}\rightarrow x_{1}=x^{\prime}_{1}\} (C2)

The intuition of this reduction is as follows: all of the EGDs in line (C1) are clearly violated, i.e.: χ\chi can be sent into the database DD by instantiating v0v_{0} to 0 and v1v_{1} to 1; likewise π\pi can be sent into the database DD by instantiating each pair (wi,wi)(w_{i},w^{\prime}_{i}) either to (0,1)(0,1) or to (1,0)(1,0). Finally, each of the atoms pi(x,x)p_{i}(x,x^{\prime}) and pi(x,x)p_{i}(x^{\prime},x) can be sent into DD by instantiating (x,x)(x,x^{\prime}) to either (0,1)(0,1) or (1,0)(1,0). In either case, the left-hand side of the EGD is satisfied but the right-hand side is not. Hence, there are three possibilities to eliminate this EGD-violation:

(D1)

we can delete one of the atoms in QAEQ\cup A\cup E,

(D2)

we can delete both atoms pi(0,1)p_{i}(0,1) and pi(1,0)p_{i}(1,0) for some i{1,,k}i\in\{1,\dots,k\}, or

(D3)

we can delete one of the atoms pi(0,1),pi(1,0)p_{i}(0,1),p_{i}(1,0) for every i{1,,k}i\in\{1,\dots,k\}.

Both (D1) as well as (D2) lead to a repair, as the subformulæ χ\chi respectively π\pi are always violated, so we need to consider (D3). The effect of retaining pi(0,1)p_{i}(0,1) with i{1,,k}i\in\{1,\dots,k\} is that the variables (xi,xi)(x_{i},x^{\prime}_{i}) in line (C2) are instantiated to (0,1); likewise, the effect of retaining pi(1,0)p_{i}(1,0) is that the the variables (xi,xi)(x_{i},x^{\prime}_{i}) in line (C2) are instantiated to (1,0). Hence, there is a one-to-one correspondence between the choices of retained ground atom pi(.,.)p_{i}(.,.) for every i{1,,k}i\in\{1,\dots,k\} and truth assignments to the xix_{i}-variables in ψ\psi, namely retaining pi(0,1)p_{i}(0,1) (resp. pi(1,0)p_{i}(1,0)) corresponds to setting the propositional variable xix_{i} in ψ\psi to false (resp. true) and to set its dual ¬xi\neg x_{i}, which is encoded by xix^{\prime}_{i} according to our definition of ψ\psi^{*}, to true (resp. false). For a repair II that only uses deletions of the form (D3), denote by ρ(I)\rho(I) the corresponding truth assignment on the propositional variables {x1,,xk}\{x_{1},\dots,x_{k}\}. We then define the relation τ\tau for the ee-reduction as follows:

τ(σ(ψ(x)),I,)={:I is the result of a deletion of the form (D1) or (D2),ρ(I):otherwise.\tau(\sigma(\psi(\vec{x})),I,-)=\left\{\begin{array}[]{ll}\emptyset&:I\text{ is the result of a deletion of the form (D1) or (D2)},\\ \rho(I)&:\text{otherwise}.\end{array}\right.

To show that τ\tau and σ\sigma indeed define a valid ee-reduction from Π1SATe\Pi_{1}\mathrm{SAT}^{e}, first note that τ(σ(ψ(x)),I,)\tau(\sigma(\psi(x)),I,-) maps to the empty set at most k+11k+11 times. So it suffices to show that the repairs we can get if we apply a deletion of the form (D3) are indeed models of ψ\psi. We distinguish two cases: First suppose that the EGD in line (C2) is violated by the instance resulting from the deletion of exactly one of pi(0,1),pi(1,0)p_{i}(0,1),p_{i}(1,0) for every i{1,,k}i\in\{1,\dots,k\}. Then we have to delete at least one more atom from DD. This means that we either delete one atom from QAEQ\cup A\cup E to falsify χ\chi (and possibly also further atoms in q(yi,yi)ψq(y_{i},y^{\prime}_{i})\wedge\psi^{*}) or we delete the remaining atom with leading symbol pip_{i} to falsify atom pi(xi,xi)p_{i}(x_{i},x^{\prime}_{i}) on the left-hand side of the EGD. In either case, the resulting database instance is not a repair due to the minimality condition.

It remains to consider the case that the EGD in line (C2) is satisfied by the instance II resulting from the deletion of exactly one of pi(0,1),pi(1,0)p_{i}(0,1),p_{i}(1,0) for every i{1,,k}i\in\{1,\dots,k\}. Clearly, the equality on the right-hand side is always violated, no matter how we instantiate (x1,x1)(x_{1},x^{\prime}_{1}), since the only options are (0,1)(0,1) and (1,0)(1,0). This means that the only way to satisfy the EGD in line (C2) is that there is no way to send the left-hand side into the database instance II. This means that no matter how we instantiate (yj,yj)(y_{j},y^{\prime}_{j}) – i.e., either to (0,1)(0,1) or to (1,0)(1,0) – there is always one atom in ψ\psi^{*} that is instantiated to an aa-atom outside II, namely a(1,1,1)a(1,1,1). By our encoding of ψ\psi by ψ\psi^{*} this has the following meaning for the quantified boolean formula ψ\psi: no matter how we extend the truth assignment ρ(I)\rho(I) to an assignment on {y1,,y}\{y_{1},\dots,y_{\ell}\} (corresponding to the possible ways of instantiating (yj,yj)(y_{j},y^{\prime}_{j}) for every j{1,,}j\in\{1,\dots,\ell\}), there is at least one implicant in ψ\psi for which all three literals evaluate to true. In other words, there is a one-to-one correspondence between repairs obtained by deleting exactly one of pi(0,1),pi(1,0)p_{i}(0,1),p_{i}(1,0) for every i{1,,k}i\in\{1,\dots,k\} and models of ψ\psi. ∎

7 Conclusion

We introduced a hierarchy of enumeration complexity classes, extending the well-known tractable enumeration classes DelayP and IncP, just as the ΔkP{\Delta}_{k}^{P}-classes of the polynomial-time hierarchy extend the class P. We show that under reasonable complexity assumptions these hierarchies are strict. We introduced a declarative type of reduction among enumeration problems which is transitive and under which the classes in our hierarchies are closed. Moreover, they turn out to be special cases of the procedural-style DD- and II-reductions that we defined afterwards. These procedural style reductions allow one to get completeness results for the classes of our hierarchy. The ee-reductions are conceptually simpler and easier to obtain; so they will be used to obtain further hardness results for enumeration problems. In this way we obtain completeness results for diverse problems such as generalized satisfiability in the Schaefer framework, circumscription, model-based diagnosis, abduction, and repairs.

Prior to our work, lower bounds for enumeration problems were only of the form “Enum_R\text{\sc Enum}{\_}R is not in DelayP (or IncP) unless P=NP\text{\sf P}=\text{\sf NP}”. We have provided here a framework which allows one to pinpoint the complexity of such problems in a better way in terms of completeness in our enumeration hierarchy.

As far as future work is concerned, of course, we want to close the gap left in Figure 1, i.e., clarifying the precise relationship between the enumeration complexity classes DelayPΣkP\text{\sf DelayP}^{{\Sigma}_{k}^{P}} and DelayPΔk+1P\text{\sf DelayP}^{{\Delta}_{k+1}^{P}}. For a wider field of research activities in the area of hard enumeration problems, recall that our hierarchies of enumeration complexity classes build upon the tractable classes DelayP and IncP. Note that in [1], yet another notion of tractable enumeration is proposed, namely the class OutputP (also referred to as TotalP in [2]). A problem is in OutputP if the time needed to output all solutions to a given instance is bounded by a polynomial in the combined size of the input plus the output. It is easy to show that this class is closed w.r.t. ee-reductions and only minor modifications of the DD- and II-reductions are needed to close OutputP also under these reductions. However, while we have seen quite a close relationship between DelayP and IncP in this work, the class OutputP seems to behave very differently from the others. For instance, OutputP seems to be incomparable (under common complexity-theoretic assumptions) with all higher classes from our hierarchies built upon DelayP or IncP. Sure, we may also define a hierarchy of classes by allowing, for instance, a ΣkP{\Sigma}_{k}^{P} oracle for some k1k\geq 1 on top of OutputP. However, it is unclear what complete problems for any of the resulting classes would look like. A major research effort is required to even get a basic understanding of such classes.

Finally, a natural next research target is to put the machinery developed here to work. In Section 6, we have already proved a few completeness results for our new complexity classes. Many more intractable enumeration problems (especially in the AI and database domains) wait for a precise complexity classification. We believe that such work – complementing the search for restrictions to make intractable enumeration problems tractable, cf. [30, 28] – is needed to get a better understanding of the true sources of complexity of hard enumeration problems.

Acknowledgments

We would like to thank Phokion Kolaitis for his encouragement on this work during his visit to Marseilles and for suggesting to consider database repairs as complete problems for our complexity classes.

This work was supported by the Vienna Science and Technology Fund (WWTF) through project ICT12-015, the Austrian Science Fund (FWF): P25207-N23, P25518-N23, I836-N23, W1255-N23 and the French Agence Nationale de la Recherche, AGGREG project reference ANR-14-CE25-0017.

References