#
DynASP2.5: Dynamic Programming on Tree Decompositions in Action^{ †}

^{1}

^{2}

^{3}

^{4}

^{*}

^{†}

## Abstract

**:**

## 1. Introduction

#### 1.1. Contributions

- We present a new dynamic programming algorithm on a graph representation that is somewhat in-between the incidence and primal graph and show its correctness.
- We establish a novel fixed-parameter linear algorithm ($\mathtt{M}-\phantom{\rule{0.0pt}{0ex}}{\mathtt{DP}}_{\mathbb{SINC}}$), which works in multiple traversals and computes existential and universal parts separately.
- We present an implementation (DynASP2.5) and an experimental evaluation.

#### 1.2. Related Work

#### 1.3. Journal Version

## 2. Preliminaries

#### 2.1. Tree Decompositions

- 1.
- for every vertex $v\in V$ there is a node $t\in N$ with $v\in \chi \left(t\right)$;
- 2.
- for every edge $e\in E$ there is a node $t\in N$ with $e\subseteq \chi \left(t\right)$; and
- 3.
- for any three nodes ${t}_{1},{t}_{2},{t}_{3}\in N$ whenever ${t}_{2}$ lies on the unique path from ${t}_{1}$ to ${t}_{3}$, then we have $\chi \left({t}_{1}\right)\cap \chi \left({t}_{3}\right)\subseteq \chi \left({t}_{2}\right)$.

#### 2.2. Answer Set Programming (ASP)

#### 2.2.1. Syntax

#### 2.2.2. Semantics

**Example**

**1.**

#### 2.3. Graph Representations of Programs

#### 2.4. Sub-Programs

**Example**

**2.**

## 3. A Single Traversal DP Algorithm

- 1.
- Construct a graph representation $G\left(P\right)$ of the given input program P.
- 2.
- Compute a TD $\mathcal{T}$ of the graph $G\left(P\right)$ by means of some heuristic, thereby decomposing $G\left(P\right)$ into several smaller parts and fixing an ordering in which P will be evaluated.
- 3.
- For every node $t\in T$ in the tree decomposition $\mathcal{T}=\left(\right(T,E,n),\chi )$ (in a bottom-up traversal), run an algorithm $\mathbb{A}$, which we call table algorithm, and compute a “table” $\mathbb{A}-\mathrm{Tabs}[t]$, which is a set of tuples (or rows for short). Intuitively, algorithm $\mathbb{A}$ transforms tables of child nodes of t to the current node, and solves a “local problem” using bag-program ${P}_{t}$. The algorithm thereby computes (i) sets of atoms called (local) witness sets and (ii) for each local witness set M subsets of M called counter-witness sets [11], and directly follows the definition of answer sets being (i) models of P and (ii) subset minimal with respect to ${P}^{M}$.
- 4.
- For root n interpret the table $\mathbb{A}-\mathrm{Tabs}[n]$ (and tables of children, if necessary) and print the solution to the considered ASP problem.

Algorithm 1: Algorithm ${\mathtt{DP}}_{\mathbb{A}}\left(\mathcal{T}\right)$ for Dynamic Programming on TD $\mathcal{T}$ for ASP [11]. |

#### An Algorithm on the Semi-Incidence Graph

Algorithm 2: Table algorithm $\mathbb{SINC}(t,{\chi}_{t},{P}_{t},{\mathrm{at}}_{\phantom{\rule{-0.50003pt}{0ex}}\le \phantom{\rule{-0.50003pt}{0ex}}t},{\mathrm{Child}-\mathrm{Tabs}}_{t})$. |

**Definition**

**1.**

**Definition**

**2.**

#### 3.1. Correctness and Runtime of Algorithm 2 ($\mathbb{SINC}$)

**Proposition**

**1.**

**Proof**

**(Idea/Main**

**Arguments)**

**Definition**

**3.**

- 1.
- $C\vDash {\left({P}_{\phantom{\rule{-0.50003pt}{0ex}}<\phantom{\rule{-0.50003pt}{0ex}}t}\right)}^{M}$,
- 2.
- for $r\in {P}_{\phantom{\rule{-0.50003pt}{0ex}}\le \phantom{\rule{-0.50003pt}{0ex}}t}$ we require:
- 3.
- (a)
- for disjunctive rule $r\in {P}_{\phantom{\rule{-0.50003pt}{0ex}}\le \phantom{\rule{-0.50003pt}{0ex}}t}$, we have ${B}_{r}^{-}\cap M\ne \varnothing $ or ${B}_{r}^{+}\cap {\mathrm{at}}_{\phantom{\rule{-0.50003pt}{0ex}}\le \phantom{\rule{-0.50003pt}{0ex}}t}\neg \subseteq C$ or ${H}_{r}\cap C\ne \varnothing $ if and only if $r\in \sigma $;
- (b)
- for choice rule $r\in {P}_{t}$, we have ${B}_{r}^{-}\cap M\ne \varnothing $ or ${B}_{r}^{+}\cap {\mathrm{at}}_{t}\neg \subseteq C$ or both ${H}_{r}\subseteq {\mathrm{at}}_{t}$ and ${H}_{r}\cap (M\setminus C)=\varnothing $ if and only if $r\in \sigma $.

**Definition**

**4.**

**Observation**

**1.**

**Proof.**

**Definition**

**5.**

- 1.
- $M=\widehat{M}\cap \chi \left(t\right)$,
- 2.
- $\sigma =\widehat{\sigma}$, and
- 3.
- $\mathcal{C}=\{\langle \widehat{C}\cap \chi \left(t\right),{\widehat{\rho}}^{t,\widehat{M},\widehat{C}}\rangle \mid (\widehat{C},\widehat{\rho})\in \widehat{\mathcal{C}}\}$.

**Observation**

**2.**

**Proof.**

**Lemma**

**1**

**Proof.**

**Lemma**

**2**

**Proof.**

**Proof**

**of**

**Proposition**

**1**

**(Correctness).**

**Lemma**

**3.**

**Proof**

**(Sketch).**

**Proof**

**of**

**Proposition**

**1**

**(Runtime).**

#### 3.2. An Extended Example

**Example**

**3.**

**Example**

**4.**

## 4. DynASP2.5: Towards a III Traversal DP Algorithm

#### 4.1. The Algorithm

- 3.I.
- First, we run the algorithm ${\mathtt{DP}}_{\mathbb{MOD}}$, which computes in a bottom-up traversal for every node t in the tree decomposition a table $\mathbb{MOD}-\mathrm{Tabs}[t]$ of witnesses for t. Then, in a top-down traversal for every node t in the TD remove from tables $\mathbb{MOD}-\mathrm{Tabs}[t]$ witnesses, which do not extend to a witness in the table for the parent node (“Purge non-witnesses”); these witnesses can never be used to construct a model (nor answer set) of the program.
- 3.II.
- For this step, let $\mathbb{CMOD}$ be a table algorithm computing only counter-witnesses of $\mathbb{SINC}$ (blue parts of Algorithm 2). We execute ${\mathtt{DP}}_{\mathbb{CMOD}}$, for all witnesses, compute counter-witnesses at once and store the resulting tables in $\mathbb{CMOD}-\mathrm{Tabs}[\xb7]$. For every node t, table $\mathbb{CMOD}-\mathrm{Tabs}[t]$ contains counter-witnesses to witness being ⊂-minimal. Again, irrelevant rows are removed (“Purge non-counter-witnesses”).
- 3.III.
- Finally, in a bottom-up traversal for every node t in the TD, witnesses and counter-witnesses are linked using algorithm ${\mathtt{DPL}}_{\mathbb{MOD},\mathbb{CMOD}}$ (see Algorithm 3). ${\mathtt{DPL}}_{\mathbb{MOD},\mathbb{CMOD}}$ takes previous results and maps rows in $\mathbb{MOD}-\mathrm{Tabs}[t]$ to a table (set) of rows in $\mathbb{CMOD}-\mathrm{Tabs}[t]$.

Algorithm 3: Algorithm ${\mathtt{DPL}}_{\mathbb{W},\mathbb{C}}(\mathcal{T},\mathbb{W}-\mathrm{Tabs},\mathbb{C}-\mathrm{Tabs})$ for linking counter-witnesses to witnesses. |

#### 4.2. An Elaborated Example

**Example**

**5.**

#### 4.3. Correctness and Runtime of DynASP2.5

**Theorem**

**1.**

**Proof**

**(Sketch).**

**Definition**

**6.**

**Remark**

**1.**

**Definition**

**7.**

**Definition**

**8.**

**Definition**

**9.**

- 1.
- For all rows of the form $\langle M,\cdots ,\mathcal{C}\rangle $, we have $\mathcal{C}=\varnothing $.
- 2.
- For all $\overrightarrow{u},\overrightarrow{v}s.\in {\tau}_{}$ with $\overrightarrow{u}\ne \overrightarrow{v}$ it holds that $\alpha \left(\overrightarrow{u}\right)\cup \beta \left(\overrightarrow{u}\right)\ne \alpha \left(\overrightarrow{v}\right)\cup \beta \left(v\right)$.
- 3.
- For all $\overrightarrow{u}=\langle M,\sigma ,\cdots \rangle \in {\tau}_{}$, $\{\left\{{\overrightarrow{u}}_{1}^{\prime}\right\},\cdots ,\left\{{\overrightarrow{u}}_{k}^{\prime}\right\}\}\in {orig}_{t}\left(\overrightarrow{u}\right)$, $1\le i<j\le k$, $I\in E\left({\overrightarrow{u}}_{i}^{\prime}\right)$ and $J\in E\left({\overrightarrow{u}}_{j}^{\prime}\right)$ it holds that ${\alpha}^{*}\left(I\right)\cap {\alpha}^{*}\left(J\right)\subseteq M$ and ${\beta}^{*}\left(I\right)\cap {\beta}^{*}\left(J\right)\subseteq \sigma $.
- 4.
- No element of ${\alpha}^{*}\left({\tau}_{}\right)$ has been α-illegally introduced and no element of ${\beta}^{*}\left({\tau}_{}\right)$ has been β-illegally introduced.
- 5.
- No element of ${\alpha}^{*}\left({\tau}_{}\right)$ has been α-illegally removed and no element of ${\beta}^{*}\left({\tau}_{}\right)$ has been β-illegally removed.

**Observation**

**3.**

**Lemma**

**4.**

**Proof.**

- 1.
- $sol\in X$: By construction of F we have $X\vDash {a}^{\prime}\leftrightarrow a$ for any ${a}^{\prime}\in {\left({B}_{P}^{-}\right)}^{\prime}$, which implies that $X\cap \mathrm{at}\left(P\right)\vDash {P}^{M}$. However, this contradicts our assumption that M is an answer set of P.
- 2.
- $sol\notin X$: By construction of F there is at least one atom $a\in {B}_{P}^{-}$ with ${a}^{\prime}\in X$, but $a\notin X$. Consequently, $X\cap \mathrm{at}\left(P\right)\vDash {P}^{M}$. This contradicts again that M is an answer set of P.

- 1.
- N is not a model of P: We construct $X\phantom{\rule{0.166667em}{0ex}}:=N\cup [Y\cap {\left({B}_{P}^{-}\right)}^{\prime}]$ and show that X is indeed a model of F. For this, for every $r\in P$ where ${B}^{-}\left(r\right)\cap M\ne \varnothing $ we have $X\vDash {F}^{\mathrm{r}}\left(r\right)$, since $(Y\cap {\left({B}_{P}^{-}\right)}^{\prime})\subseteq X$ by definition of X. For formulas $\left(A1\right)$ constructed by ${F}^{\mathrm{r}}\left(r\right)$ using remaining rules r, we also have $X\vDash {F}^{\mathrm{r}}\left(r\right)$, since $N\vDash {\left\{r\right\}}^{M}$. In conclusion, $X\vDash F$ and $X\u228aY$, and therefore X contradicts Y is a subset-minimal model of F.
- 2.
- N is also a model of P: Observe that then $X\phantom{\rule{0.166667em}{0ex}}:=N\cup {[N\cap {B}_{P}^{-}]}^{\prime}\cup \left\{sol\right\}$ is also a model of F, which contradicts optimality of Y since $X\u228aY$.

**Definition**

**10.**

- 1.
- For any $\overrightarrow{u}\in {\tau}_{}$, $\{\left\{{\overrightarrow{u}}_{1}^{\prime}\right\},\cdots ,\left\{{\overrightarrow{u}}_{k}^{\prime}\right\}\}\in {orig}_{t}\left(\overrightarrow{u}\right)$ and $\{\left\{{\overrightarrow{v}}_{1}^{\prime}\right\},\cdots ,\left\{{\overrightarrow{v}}_{k}^{\prime}\right\}\}\in {\widehat{\prod}}_{1\le i\le k}res\left({\overrightarrow{u}}_{i}^{\prime}\right)$, there is a row $\overrightarrow{v}s.\in aug\left({\tau}_{}\right)$ with $\alpha \left(\overrightarrow{u}\right)=\alpha \left(\overrightarrow{v}\right)$ and $\{\left\{{\overrightarrow{v}}_{1}^{\prime}\right\},\cdots ,\left\{{\overrightarrow{v}}_{k}^{\prime}\right\}\}\in {orig}_{t}\left(\overrightarrow{v}\right)$.
- 2.
- For any $\overrightarrow{u},\overrightarrow{v}s.\in aug\left({\tau}_{}\right)$ with $\overrightarrow{u}=\langle \cdots ,\mathcal{C}\rangle $ such that $\alpha \left(\overrightarrow{v}\right)\subseteq \alpha \left(\overrightarrow{u}\right)$, $\{\left\{{\overrightarrow{u}}_{1}^{\prime}\right\},\cdots ,\left\{{\overrightarrow{u}}_{k}^{\prime}\right\}\}\in {orig}_{t}\left(\overrightarrow{u}\right)$ and $\{\left\{{\overrightarrow{v}}_{1}^{\prime}\right\},\cdots ,\left\{{\overrightarrow{v}}_{k}^{\prime}\right\}\}\in {orig}_{t}\left(\overrightarrow{v}\right)$ the following holds: Let $1\le i\le k$ with ${\overrightarrow{u}}_{i}^{\prime}=\langle \cdots ,{\mathcal{C}}_{i}\rangle $, ${\overrightarrow{c}}_{i}=\langle {C}_{i},\cdots \rangle \in ({\mathcal{C}}_{i}\cup \left\{{\overrightarrow{u}}_{i}^{\prime}\right\})$ with ${C}_{i}\subseteq \alpha \left({\overrightarrow{v}}_{i}^{\prime}\right)$, and $1\le j\le k$ with ${\overrightarrow{c}}_{j}\ne {\overrightarrow{u}}_{j}^{\prime}$ or $\alpha \left(\overrightarrow{v}\right)\u228a\alpha \left(\overrightarrow{u}\right)$. Then, there is a row $\overrightarrow{c}\in \mathcal{C}$ with $\alpha \left(\overrightarrow{c}\right)\subseteq \alpha \left(\overrightarrow{v}\right)$ if and only if $\overrightarrow{c}\in {\tau}_{}$ and $\{\left\{{\overrightarrow{c}}_{1}\right\},\cdots ,\left\{{\overrightarrow{c}}_{k}\right\}\}\in {orig}_{t}\left(\overrightarrow{c}\right)$.

**Proposition**

**2.**

**Proof**

**(Sketch).**

**Theorem**

**2.**

**Proof.**

**Proposition**

**3.**

**Proof**

**(Idea).**

**Corollary**

**1.**

## 5. Experimental Evaluation

#### 5.1. Implementation Details

#### 5.2. Benchmark Set

#### 5.2.1. Steiner Tree Problem

**Definition**

**11**

- 1.
- all terminal vertices are covered : ${V}_{T}\subseteq {V}_{S}$, and
- 2.
- the number of edges in ${E}_{S}$ forms a minimum : there is no tree, where all terminal vertices are covered that consists of no more than $|{E}_{S}|-1$ many edges.

**Example**

**6**

#### 5.2.2. Considered Encodings

**Listing 1.**Encoding for St.

vertex(X) ← edge(X,_). vertex(Y) ← edge(_,Y). edge(X,Y) ← edge(Y,X). 0 { selectedEdge(X,Y) } 1 ← edge(X,Y), X < Y. s1(X) ∨ s2(X) ← vertex(X). saturate ← selectedEdge(X,Y), s1(X), s2(Y), X < Y. saturate ← selectedEdge(X,Y), s2(X), s1(Y), X < Y. saturate ← N #count{ X : s1(X), terminalVertex(X) }, numVertices(N). saturate ← N #count{ X : s2(X), terminalVertex(X) }, numVertices(N). s1(X) ← saturate, vertex(X). s2(X) ← saturate, vertex(X). ← not saturate. #minimize{ 1,X,Y : selectedEdge(X,Y) }.

**Listing 2.**Alternative encoding for St.

edge(X,Y) ← edge(Y,X). { selectedEdge(X,Y) : edge(X,Y), X < Y }. reached(Y) ← Y = #min{ X : terminalVertex(X) }. reached(Y) ← reached(X), selectedEdge(X,Y). reached(Y) ← reached(X), selectedEdge(Y,X). ← terminalVertex(X), not reached(X). #minimize{ 1,X,Y : selectedEdge(X,Y) }.

#### 5.3. Experimental Evaluation

#### 5.3.1. Benchmark Environment

#### 5.3.2. Runtime Limits

#### 5.3.3. Summary of the Results

#### 5.4. A Brief Remark on Instances without Optimization

## 6. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- Janhunen, T.; Niemelä, I. The Answer Set Programming Paradigm. AI Mag.
**2016**, 37, 13–24. [Google Scholar] [CrossRef][Green Version] - Simons, P.; Niemelä, I.; Soininen, T. Extending and implementing the stable model semantics. Artif. Intell.
**2002**, 138, 181–234. [Google Scholar] [CrossRef][Green Version] - Eiter, T.; Gottlob, G. On the computational cost of disjunctive logic programming: Propositional case. Ann. Math. Artif. Intell.
**1995**, 15, 289–323. [Google Scholar] [CrossRef] - Egly, U.; Eiter, T.; Tompits, H.; Woltran, S. Solving Advanced Reasoning Tasks Using Quantified Boolean Formulas. In Proceedings of the 17th National Conference on Artificial Intelligence (AAAI’00), Austin, TX, USA, 30 July–3 August 2000; pp. 417–422. [Google Scholar]
- Egly, U.; Eiter, T.; Klotz, V.; Tompits, H.; Woltran, S. Computing Stable Models with Quantified Boolean Formulas: Some Experimental Results. In Proceedings of the 1st International Workshop on Answer Set Programming (ASP’01), Stanford, CA, USA, 26–28 March 2001. [Google Scholar]
- Jakl, M.; Pichler, R.; Woltran, S. Answer-Set Programming with Bounded Treewidth. In Proceedings of the 21st International Joint Conference on Artificial Research (IJCAI’09), Pasadena, CA, USA, 14–17 July 2009; pp. 816–822. [Google Scholar]
- Lampis, M.; Mitsou, V. Treewidth with a Quantifier Alternation Revisited. In Proceedings of the 12th International Symposium on Parameterized and Exact Computation (IPEC’17), Vienna, Austria, 6–8 September 2017; Volume 89, pp. 26:1–26:12. [Google Scholar]
- Fichte, J.K.; Hecher, M.; Pfandler, A. Lower Bounds for QBFs of Bounded Treewidth. In Proceedings of the 35th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS’20), Rome, Italy, 29 June–2 July 2021; pp. 410–424. [Google Scholar] [CrossRef]
- Gebser, M.; Kaufmann, B.; Schaub, T. The Conflict-Driven Answer Set Solver clasp: Progress Report. In Proceedings of the 10th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR’09), Potsdam, Germany, 14–18 September 2009; Erdem, E., Lin, F., Schaub, T., Eds.; Lecture Notes in Computer Science. Springer: Potsdam, Germany, 2009; Volume 5753, pp. 509–514. [Google Scholar] [CrossRef][Green Version]
- Alviano, M.; Dodaro, C.; Faber, W.; Leone, N.; Ricca, F. WASP: A Native ASP Solver Based on Constraint Learning. In Proceedings of the 12th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR’13); Son, P.C.C., Ed.; Lecture Notes in Computer Science; Springer: Corunna, Spain, 2013; Volume 8148, pp. 54–66. [Google Scholar] [CrossRef]
- Fichte, J.K.; Hecher, M.; Morak, M.; Woltran, S. Answer Set Solving with Bounded Treewidth Revisited. In Proceedings of the 14th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR’17), Espoo, Finland, 3–6 July 2017; Balduccini, M., Janhunen, T., Eds.; Lecture Notes in Computer Science. Springer: Espoo, Finland, 2017; Volume 10377, pp. 132–145. [Google Scholar] [CrossRef][Green Version]
- Abseher, M.; Musliu, N.; Woltran, S. Improving the Efficiency of Dynamic Programming on Tree Decompositions via Machine Learning. J. Artif. Intell. Res.
**2017**, 58, 829–858. [Google Scholar] [CrossRef] - Fichte, J.K.; Hecher, M. Treewidth and Counting Projected Answer Sets. In Proceedings of the 15th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR’19), Philadelphia, PA, USA, 3–7 June 2019; Lecture Notes in Computer Science. Springer: Philadelphia, PA, USA, 2019; Volume 11481, pp. 105–119. [Google Scholar] [CrossRef][Green Version]
- Hecher, M.; Morak, M.; Woltran, S. Structural Decompositions of Epistemic Logic Programs. In Proceedings of the 34th AAAI Conference on Artificial Intelligence (AAAI’20), New York, NY, USA, 7–12 February 2020; Conitzer, V., Sha, F., Eds.; The AAAI Press: New York, NY, USA, 2020; pp. 2830–2837. [Google Scholar] [CrossRef]
- Hecher, M. Treewidth-aware Reductions of Normal ASP to SAT—Is Normal ASP Harder than SAT after All? In Proceedings of the 17th International Conference on Principles of Knowledge Representation and Reasoning (KR’20), Rhodes, Greece, 12–18 September 2020; Calvanese, D., Erdem, E., Thielscher, M., Eds.; IJCAI Organization: Rhodes, Greece, 2020; pp. 485–495. [Google Scholar] [CrossRef]
- Kneis, J.; Langer, A.; Rossmanith, P. Courcelle’s theorem—A game-theoretic approach. Discret. Optim.
**2011**, 8, 568–594. [Google Scholar] [CrossRef][Green Version] - Bliem, B.; Charwat, G.; Hecher, M.; Woltran, S. D-FLAT^2: Subset Minimization in Dynamic Programming on Tree Decompositions Made Easy. Fundam. Inf.
**2016**, 147, 27–34. [Google Scholar] [CrossRef][Green Version] - Abseher, M.; Musliu, N.; Woltran, S. htd—A Free, Open-Source Framework for (Customized) Tree Decompositions and Beyond. In Proceedings of the CPAIOR’17, Padova, Italy, 5–8 June 2017; Volume 10335, pp. 376–386. [Google Scholar]
- Dell, H.; Komusiewicz, C.; Talmon, N.; Weller, M. The PACE 2017 Parameterized Algorithms and Computational Experiments Challenge: The Second Iteration. In Proceedings of the 12th International Symposium on Parameterized and Exact Computation (IPEC’17), Vienna, Austria, 6–8 September 2017; Lokshtanov, D., Nishimura, N., Eds.; Leibniz International Proceedings in Informatics (LIPIcs). Dagstuhl Publishing: Wadern, Germany, 2018; Volume 89, pp. 30:1–30:12. [Google Scholar] [CrossRef]
- Fichte, J.K.; Szeider, S. Backdoors to Tractable Answer-Set Programming. Artif. Intell.
**2015**, 220, 64–103. [Google Scholar] [CrossRef] - Fichte, J.K.; Truszczyński, M.; Woltran, S. Dual-normal logic programs—The forgotten class. Theory Pract. Log. Program.
**2015**, 15, 495–510. [Google Scholar] [CrossRef][Green Version] - Fichte, J.K.; Szeider, S. Backdoors to Normality for Disjunctive Logic Programs. ACM Trans. Comput. Log.
**2015**, 17. [Google Scholar] [CrossRef][Green Version] - Fichte, J.K.; Kronegger, M.; Woltran, S. A multiparametric view on answer set programming. Ann. Math. Artif. Intell.
**2019**, 86, 121–147. [Google Scholar] [CrossRef] - Diestel, R. Graph Theory, 4th ed.; Graduate Texts in Mathematics; Springer: Berlin/Heidelberg, Germany, 2012; Volume 173, p. 410. [Google Scholar]
- Bondy, J.A.; Murty, U.S.R. Graph Theory; Graduate Texts in Mathematics; Springer: New York, NY, USA, 2008; Volume 244, p. 655. [Google Scholar]
- Bodlaender, H.; Koster, A.M.C.A. Combinatorial Optimization on Graphs of Bounded Treewidth. Comput. J.
**2008**, 51, 255–269. [Google Scholar] [CrossRef][Green Version] - Brewka, G.; Eiter, T.; Truszczyński, M. Answer set programming at a glance. Commun. ACM
**2011**, 54, 92–103. [Google Scholar] [CrossRef] - Lifschitz, V. What is Answer Set Programming? In Proceedings of the 23rd AAAI Conference on Artificial Intelligence (AAAI’08), Chicago, IL, USA, 13–17 July 2008; Holte, R.C., Howe, A.E., Eds.; The AAAI Press: Chicago, IL, USA, 2008; pp. 1594–1597. [Google Scholar]
- Schaub, T.; Woltran, S. Special Issue on Answer Set Programming. KI
**2018**, 32, 101–103. [Google Scholar] [CrossRef][Green Version] - Bodlaender, H.L. A linear-time algorithm for finding tree-decompositions of small treewidth. SIAM J. Comput.
**1996**, 25, 1305–1317. [Google Scholar] [CrossRef] - Kloks, T. Treewidth, Computations and Approximations; LNCS; Springer: Berlin/Heidelberg, Germany, 1994; Volume 842. [Google Scholar]
- Samer, M.; Szeider, S. Algorithms for propositional model counting. J. Discrete Algorithms
**2010**, 8. [Google Scholar] [CrossRef][Green Version] - Morak, M.; Musliu, N.; Pichler, R.; Rümmele, S.; Woltran, S. Evaluating Tree-Decomposition Based Algorithms for Answer Set Programming. In Proceedings of the 6th International Conference on Learning and Intelligent Optimization (LION’12), Paris, France, 16–20 January 2012; Hamadi, Y., Schoenauer, M., Eds.; Lecture Notes in Computer Science. Springer: Paris, France, 2012; pp. 130–144. [Google Scholar] [CrossRef][Green Version]
- Gottlob, G.; Scarcello, F.; Sideri, M. Fixed-parameter complexity in AI and nonmonotonic reasoning. Artif. Intell.
**2002**, 138, 55–86. [Google Scholar] [CrossRef][Green Version] - Karp, R.M. Reducibility Among Combinatorial Problems. In Proceedings of the Complexity of Computer Computations, New York, NY, USA, 20–22 March 1972; The IBM Research Symposia Series; Plenum Press: New York, NY, USA, 1972; pp. 85–103. [Google Scholar]
- Fichte, J.K. daajoe/gtfs2graphs—A GTFS Transit Feed to Graph Format Converter. Available online: https://github.com/daajoe/gtfs2graphs (accessed on 17 September 2017).
- Bliem, B.; Morak, M.; Moldovan, M.; Woltran, S. The Impact of Treewidth on Grounding and Solving of Answer Set Programs. J. Artif. Intell. Res.
**2020**, 67, 35–80. [Google Scholar] [CrossRef] - Gebser, M.; Harrison, A.; Kaminski, R.; Lifschitz, V.; Schaub, T. Abstract gringo. Theory Pract. Log. Program.
**2015**, 15, 449–463. [Google Scholar] [CrossRef][Green Version] - Syrjänen, T. Lparse 1.0 User’s Manual. 2002. Available online: tcs.hut.fi/Software/smodels/lparse.ps (accessed on 17 May 2017).
- Alviano, M.; Dodaro, C. Anytime answer set optimization via unsatisfiable core shrinking. Theory Pract. Log. Program.
**2016**, 16, 533–551. [Google Scholar] [CrossRef][Green Version] - Fichte, J.K.; Hecher, M.; Morak, M.; Woltran, S. Answer Set Solving Using Tree Decompositions and Dynamic Programming—The DynASP2 System; Technical Report DBAI-TR-2016-101; TU Wien: Vienna, Austria, 2016. [Google Scholar]
- Dzulfikar, M.A.; Fichte, J.K.; Hecher, M. The PACE 2019 Parameterized Algorithms and Computational Experiments Challenge: The Fourth Iteration (Invited Paper). In Proceedings of the 14th International Symposium on Parameterized and Exact Computation (IPEC’19), Munich, Germany, 11–13 September 2019; Jansen, B.M.P., Telle, J.A., Eds.; Leibniz International Proceedings in Informatics (LIPIcs). Dagstuhl Publishing: Munich, Germany, 2019; Volume 148, pp. 25:1–25:23. [Google Scholar] [CrossRef]
- Fichte, J.K.; Hecher, M.; Thier, P.; Woltran, S. Exploiting Database Management Systems and Treewidth for Counting. In Proceedings of the 22nd International Symposium on Practical Aspects of Declarative Languages (PADL’20), New Orleans, LA, USA, 20–21 January 2020; Komendantskaya, E., Liu, Y.A., Eds.; Springer: New Orleans, LA, USA, 2020; pp. 151–167. [Google Scholar] [CrossRef][Green Version]
- Hecher, M.; Thier, P.; Woltran, S. Taming High Treewidth with Abstraction, Nested Dynamic Programming, and Database Technology. In Proceedings of the Theory and Applications of Satisfiability Testing—SAT 2020, Alghero, Italy, 5–9 July 2020; Pulina, L., Seidl, M., Eds.; Springer International Publishing: Cham, Switzerland, 2020; pp. 343–360. [Google Scholar]
- Fichte, J.K.; Hecher, M.; Schindler, I. Default Logic and Bounded Treewidth. In Proceedings of the 12th International Conference on Language and Automata Theory and Applications (LATA’18), Ramat Gan, Israel, 9–11 April 2018; Klein, S.T., Martín-Vide, C., Eds.; Lecture Notes in Computer Science. Springer: Ramat Gan, Israel, 2018. [Google Scholar]
- Fichte, J.K.; Hecher, M.; Meier, A. Counting Complexity for Reasoning in Abstract Argumentation. In Proceedings of the 33rd AAAI Conference on Artificial Intelligence (AAAI’19), Honolulu, HI, USA, 27 January–1 February 2019; Hentenryck, P.V., Zhou, Z.H., Eds.; The AAAI Press: Honolulu, HI, USA, 2019; pp. 2827–2834. [Google Scholar]
- Fichte, J.K.; Hecher, M.; Meier, A. Knowledge-Base Degrees of Inconsistency: Complexity and Counting. In Proceedings of the 35rd AAAI Conference on Artificial Intelligence (AAAI’21), Vancouver, BC, Canada, 2–9 February 2021; Leyton-Brown, K., Mausam, Eds.; The AAAI Press: Vancouver, BC, Canada, 2021. In Press. [Google Scholar]

**Figure 1.**Semi-Incidence graph of the program given in Example 1 (

**upper**) and a tree decomposition of this graph (

**lower**). The dashed lines indicate that where nodes have been omitted, which would be required to make the tree decomposition nice.

**Figure 2.**The tree decomposition $\mathcal{T}$ of the semi-incidence graph $S\left(P\right)$ for program P from Example 1 and Figure 1. Selected DP tables after ${\mathtt{DP}}_{\mathbb{MOD}}$. We explain details of the figure in Example 3.

**Figure 3.**Extends Figure 2. The figure illustrates a tree decomposition $\mathcal{T}$ of the semi-incidence graph $S\left(P\right)$ for program P from Example 1 (

**center**). Selected DP tables after ${\mathtt{DP}}_{\mathbb{MOD}}$ (

**left**) and after ${\mathtt{DP}}_{\mathbb{SINC}}$ (

**right**) for nice tree decomposition $\mathcal{T}$. We explain details of the figure in Example 4.

**Figure 5.**Selected DP tables after ${\mathtt{DP}}_{\mathbb{SINC}}$ (

**left**) and after $\mathtt{M}-\phantom{\rule{0.0pt}{0ex}}{\mathtt{DP}}_{\mathbb{SINC}}$ (

**right**) for TD $\mathcal{T}$.

**Figure 6.**Runtime results illustrated as cumulated solved instances. The y-axis labels consecutive integers that identify instances. The x-axis depicts the runtime. The instances are ordered by running time, individually for each solver. The first plot (

**top**) shows the best results among five TDs and the lower plot (

**bottom**) depicts the median runtime among five TDs.

**Table 1.**The table illustrates detailed benchmark results, where data for the best possible among all five runs is depicted (top) and results for the median run are shown (bottom). All columns illustrate values in seconds, except the first two columns. Column “Solver” indicates a solving system or configuration and “Solved” refers to the number of solved instances. Then, columns “TD”, “3.I”, “3.II”, and “3.III” list the total runtime in seconds over all solved instances for computation involving obtaining TDs, Pass 3.I, Pass 3.II, and Pass 3.III, respectively. Column “$\Sigma $” refers to the total runtime in seconds over all solved instances. The last column depicts the PAR2 score over all instances, where timeouts are treated as two times the timeout (“PAR2 score”). Bold-face text indicates the best result in the corresponding column.

Solver | Solved | Runtimes (Best) among Solved Instances | PAR2 Score | ||||
---|---|---|---|---|---|---|---|

TD | 3.I | 3.II | 3.III | $\mathsf{\Sigma}$ | |||

Clasp 3.3.0 | 35 | - | - | - | - | 11,493.98 | 93,093.98 |

DynASP2 | 13 | 7.96 (0.2%) | - | - | - | 3978.29 | 138,378.29 |

DynASP2.5 | 41 | 21.68 (0.2%) | 130.10 (1.4%) | 585.47 (6.2%) | 8656.48 (92.2%) | 9393.73 | 76,496.74 |

“depgraph” | 45 | 408.72 (4.0%) | 138.21 (1.4%) | 595.58 (5.8%) | 9033.70 (88.8%) | 10,176.21 | 67,667.71 |

“joinsize” | 37 | 22.82 (0.3%) | 120.19 (1.3%) | 544.18 (6.1%) | 8250.16 (92.3%) | 8937.35 | 85,654.00 |

Solver | Solved | Runtimes (median) among solved instances | PAR2 Score | ||||

TD | 3.I | 3.II | 3.III | $\Sigma $ | |||

Clasp 3.3.0 | 34 | - | - | - | - | 11,688.58 | 94,523.53 |

DynASP2 | 8 | 8.74 (0.2%) | - | - | - | 4370.83 | 149,289.20 |

DynASP2.5 | 32 | 21.91 (0.2%) | 140.08 (1.3%) | 685.15 (6.4%) | 9878.67 (92.1%) | 10,725.81 | 96,405.37 |

“depgraph” | 38 | 473.12 (4.1%) | 146.33 (1.3%) | 661.00 (5.8%) | 10,118.22 (88.8%) | 11,398.67 | 81,425.39 |

“joinsize” | 32 | 25.47 (0.2%) | 129.41 (1.3%) | 596.62 (5.8%) | 9538.77 (92.7%) | 10,290.27 | 97,260.77 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Fichte, J.K.; Hecher, M.; Morak, M.; Woltran, S. DynASP2.5: Dynamic Programming on Tree Decompositions in Action. *Algorithms* **2021**, *14*, 81.
https://doi.org/10.3390/a14030081

**AMA Style**

Fichte JK, Hecher M, Morak M, Woltran S. DynASP2.5: Dynamic Programming on Tree Decompositions in Action. *Algorithms*. 2021; 14(3):81.
https://doi.org/10.3390/a14030081

**Chicago/Turabian Style**

Fichte, Johannes K., Markus Hecher, Michael Morak, and Stefan Woltran. 2021. "DynASP2.5: Dynamic Programming on Tree Decompositions in Action" *Algorithms* 14, no. 3: 81.
https://doi.org/10.3390/a14030081