KR Conference 2010 Conference Paper
- Reinhard Pichler
- Stefan Rümmele
- Stefan Szeider
- Stefan Woltran
Cardinality constraints or, more generally, weight constraints are well recognized as an important extension of answer-set programming. Clearly, all common algorithmic tasks related to programs with cardinality or weight constraints (PWCs) – like checking the consistency of a program – are intractable. Many intractable problems in the area of knowledge representation and reasoning have been shown to become tractable if the treewidth of the programs or formulas under consideration is bounded by some constant. The goal of this paper is to apply the notion of treewidth to PWCs and to identify tractable fragments. It will turn out that the straightforward application of treewidth to PWCs does not suffice to obtain tractability. However, by imposing further restrictions, tractability can be achieved. Main results of the paper • We show that the consistency problem of PWCs remains NP-complete even if the treewidth of the considered programs is bounded by a constant (actually, even if this constant is 1). Hence, we have to search for further restrictions on the PWCs to ensure tractability. • We thus consider the largest integer occurring in (lower and upper) bounds of the constraints in the PWC, and call this parameter constraint-width. If also the constraint-width is bounded by an arbitrary but fixed constant, then the consistency problem of PWCs becomes linear time tractable (the bound on the running time entails a constant factor that is exponential in constraint-width and treewidth). • For PCCs (i. e., PWCs where all weights are equal to 1) we obtain non-uniform polynomial time tractability by designing a new dynamic programming algorithm, i. e.: Let w denote the treewidth of a PCC and let n denote the size of the PCC. Then our algorithm works in time O(f (w) · n2w) for some function f that only depends on the treewidth, but not on the size n of the program. The term “non-uniform” refers to the factor n2w in the time bound, where the size n of the program is raised to the power of an expression that depends on the treewidth w. We shall also discuss further extensions of this dynamic programming algorithm for PCCs, e. g.: it can be used to solve in non-uniform polynomial time the consistency problem of PWCs if the weights are given in unary representation. • Of course, an algorithm for the PCC consistency problem that operates in time O(f (w) · nO(1)) would be preferable, i. e., the parameter w does not occur in the exponent