Papers
Topics
Authors
Recent
2000 character limit reached

Dynamic Programming with ZDD Framework

Updated 14 December 2025
  • Dynamic-Programming ZDD-Based Framework is a structured approach that encodes the entire feasible solution space using ZDDs to enable efficient Boolean synthesis and combinatorial optimization.
  • It leverages zero-suppression, node sharing, and dynamic programming recurrences to dramatically lower memory usage and computation time in solving CNF and graph-based problems.
  • The framework incorporates interval-memoized backtracking and a strategic planning–execution trade-off, ensuring robust performance for tasks like Boolean synthesis and graph coloring.

A dynamic-programming Zero-suppressed Decision Diagram (ZDD)-based framework encodes the entire feasible solution space of a combinatorial or Boolean synthesis problem as a compact decision diagram, and then applies dynamic programming algorithms directly on the ZDD nodes structure. The ZDD representation leverages zero-suppression and node sharing to exploit combinatorial sparsity, enabling efficient enumeration, optimization, and synthesis of solutions while controlling both memory and computational cost. This class of frameworks has demonstrated robust performance in tasks ranging from functional Boolean synthesis for circuit construction, to combinatorial optimization in graph coloring, and enumeration of cost-bounded solutions.

1. Fundamental Concepts: DP State Space and ZDD Representation

The dynamic-programming ZDD-based approach constructs a graded project-join tree T=(T,r,γ,π)T=(T, r, \gamma, \pi) of the input decision problem, typically represented as a conjunctive normal form (CNF) or Boolean constraint. Tree vertices are partitioned as leaves (each corresponding one-to-one to a clause) and internal nodes labeled with subsets of variables through the grading function π\pi. Internal nodes are graded into input (XX) and output (YY) categories to facilitate quantification ordering.

For each node nn, two ZDDs are constructed:

  • BV_pre(T,n)\mathrm{BV\_pre}(T, n): the subsumption-free union of post-valuations from child nodes, representing conjunction of subformulas under nn.
  • BV_post(T,n)\mathrm{BV\_post}(T, n): projection (existential quantification) of BV_pre(T,n)\mathrm{BV\_pre}(T, n) onto variables not quantified in the subtree, formalized as Σπ(n)(BV_pre(T,n))\Sigma_{\pi(n)}(\mathrm{BV\_pre}(T, n)).

The ZDDs serve both as state descriptors in the DP process and as compact encodings for solution sets, benefiting from node sharing—where a single node can represent identical sub-functions across DP states. Zero-suppression reduction is intrinsic, eliminating redundant nodes whenever a variable does not appear in any solution under consideration (Lin et al., 7 Dec 2025).

In other contexts, such as maximal independent set enumeration, the ZDD layers correspond to decision variables, and root-to-terminal paths encode feasible (and maximal) solution sets. Construction and recursion rules ensure both feasibility and maximality are strictly maintained, with branching directly encoding combinatorial constraints (Morrison et al., 2014).

2. Core Dynamic Programming Recurrences and Interval-Memoization

The DP recurrence at each tree node synthesizes local solution sets by combining child ZDDs (via sf\cup_{sf}, a subsumption-free union) and applying projection operations to reduce variable dependencies: BV_pre(T,n)=sf{BV_post(T,mi)1ik}, BV_post(T,n)=Σπ(n)(BV_pre(T,n))\begin{aligned} \mathrm{BV\_pre}(T,n) &= \bigcup_{sf}\{\mathrm{BV\_post}(T,m_i) \mid 1 \leq i \leq k\}, \ \mathrm{BV\_post}(T,n) &= \Sigma_{\pi(n)}\bigl(\mathrm{BV\_pre}(T,n)\bigr) \end{aligned} Here, projection Σy\Sigma_y applies the combination (φy+×cdφy)sfφy(\varphi_y^+\times_{cd}\varphi_y^-)\cup_{sf}\varphi_y', with positive/negative selection and don't-care partitions.

For cost-bounded enumeration, interval-memoized backtracking replaces standard DP tables with ordered maps on each ZDD node, associating cost intervals [aw,rb)[aw, rb) to output sub-ZDDs hh. A recursive call performs efficient lookups and merges intervals from child solutions: aw=max(aw0,aw1+c(x)),rb=min(rb0,rb1+c(x))aw = \max(aw_0, aw_1 + c(x)), \quad rb = \min(rb_0, rb_1 + c(x)) Memoization ensures that for any budget bb' in [aw,rb)[aw, rb), the corresponding sub-ZDD hh is reused, avoiding redundant computation and yielding strong output-sensitive performance (Minato et al., 2022).

3. Managing Planning and Execution: The "Magic Number" and Exploration–Exploitation Tradeoff

Finding the minimal treewidth decomposition for graded project-join trees is computationally intensive and strongly impacts the performance of the dynamic-programming phase. The "magic number" MM is introduced as a unified upper bound parameter for both planning time (searching for suitable tree decompositions) and target treewidth:

  • The tree-decomposition engine (such as FlowCutter) is run under constraints: time_limit ≤ M and width_limit ≤ M.
  • If an (X,Y)(X,Y)-graded tree of width M\leq M is found within time MM, it is selected; otherwise, the best decomposed tree so far is used (Lin et al., 7 Dec 2025).

This approach embodies the exploration–exploitation dilemma: longer planning (exploration) seeks smaller treewidth (reducing DP runtime), while shorter planning (exploitation) capitalizes on timely DP execution, with DP cost exponential in treewidth. Empirical results suggest a workload-tuned compromise, with M=200M=200 (seconds/treewidth) providing optimal trade-offs in the tested benchmark suite.

4. Algorithmic Details and ZDD-Specific Optimizations

Typical algorithms in ZDD-DP frameworks are organized into two phases:

Phase (a): Realizability checking

  • Recursive computation of BV_pre\mathrm{BV\_pre} and BV_post\mathrm{BV\_post} at tree nodes, with early termination on unsatisfiability.
  • Aggregation and refinement of realizability sets.

Phase (b): Witness extraction

  • Top-down projection and substitution along graded tree decompositions for output variable witness functions (e.g., extracting Skolem functions or DNF/CNF forms).

Sample pseudocode for interval-memoized backtracking is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function BacktrackIntervalMemo(f: ZDDNode, b: integer)
  if f == ZERO:
    return (ZERO, -, +)
  if f == ONE:
    if b >= 0: return (ONE, 0, +)
    else: return (ZERO, -, 0)
  entry  f.interval_map.lower_bound(b)
  if entry exists and entry.interval contains b:
    return (entry.h, entry.aw, entry.rb)
  (h0, aw0, rb0) = BacktrackIntervalMemo(f0, b)
  (h1, aw1, rb1) = BacktrackIntervalMemo(f1, b - c(x))
  h = ZDD_MakeNode(x, h0, h1)
  aw = max(aw0, aw1 + c)
  rb = min(rb0, rb1 + c)
  if aw < rb:
    f.interval_map.insert([aw, rb)  (h, aw, rb))
  return (h, aw, rb)
Common ZDD-specific optimizations include zero-suppression reduction, global unique tables for node sharing, caching for union/product/projection operations, and subsumption elimination during unions (Lin et al., 7 Dec 2025, Minato et al., 2022).

5. Complexity Analysis

Let N=φN = |\varphi| and treewidth twMtw \leq M, with TT having O(N)O(N) nodes:

  • Each DP state ZDD can have up to O(2tw)O(2^{tw}) nodes.
  • Union and projection operations per ZDD of size SS take O(S)O(S) to O(S2)O(S^2) time; empirical runtimes are often near-linear due to cache efficiency.
  • The number of ZDD operations is O(N)O(N).
  • Total runtime O(Nf(M))\approx O(N \cdot f(M)) and memory O(Ng(M))\approx O(N \cdot g(M)), both exponential in MM.

Interval-memoized backtracking achieves runtime O(f+hlogh)O(|f| + |h|\log |h|) and space O(h)O(|h|), where f|f| and h|h| are input and output ZDD sizes. This avoids pseudo-polynomial blowup in the numeric magnitude of cost bounds, contrasting with classical DP (O(fB)O(|f|B) where B=maxCost(X)B = \max \mathrm{Cost}(X)) and branch-and-bound (O(f)O(|f|), but returning a single optimum) (Minato et al., 2022).

6. Tool Architectures and Practical Implementations

The DPZynth tool represents the latest instantiation of dynamic ZDD-DP for Boolean synthesis (Lin et al., 7 Dec 2025):

  • Built atop the CUDD library, leveraging canonical tables and computed caches for BDD/ZDD operations.
  • Input CNF problems are first encoded as clause-set ZDDs via Minato’s encoding.
  • Uses FlowCutter for low-width tree decomposition with MCS for variable order selection.
  • Supports conversion of witness ZDDs to Skolem functions or AIGs for downstream synthesis.

In branch-and-price graph coloring, the ZDD-based DP is integrated with column generation and integer branching, facilitating global enforcement of branching constraints, exact pricing call resolution, and efficient RestrictSet operations for solution exclusion (Morrison et al., 2014).

7. Benchmarking, Evaluation, and Industrial Impact

DPZynth was evaluated on 275 \forall\exists CNF instances from QBFEVAL’16–’22, including integer factorization, subtraction, and standard mutex/qshifter families. Metrics considered were:

  • End-to-end runtime (including CNF-to-ZDD encoding, tree decomposition, DP execution, witness extraction).
  • Peak memory usage (Lin et al., 7 Dec 2025).

Comparisons between ZSynth (monolithic ZDD projection), DPSynth (BDD-DP), and DPZynth (ZDD-DP) revealed:

  • DPZynth outperformed ZSynth on ≈ 75% of common instances by one or two orders of magnitude post-planning overhead.
  • DPZynth was superior to DPSynth in large instances due to ZDD compactness, especially on sparse clause sets.
  • On mutex families, DPZynth scaled exponentially better than both alternatives, while for qshifter instances, planning time dominated, with ZSynth retaining an edge.

In graph coloring via branch-and-price, the ZDD-based approach enabled exact convergence, improved pricing call efficiency—empirically solving 15 out of 47 benchmark instances within 10 hours, some for the first time, often with an order of magnitude speedup over previous approaches (Morrison et al., 2014). Empirical ZDD growth under RestrictSet constraints was modest, with practical instance sizes (n500n \leq 500) yielding sub-second pricing solves.

The synergistic integration of dynamic programming and zero-suppressed decision diagrams has thus established itself as a robust addition to formal Boolean synthesis tool portfolios and combinatorial enumeration frameworks. The explicit management of the exploration–exploitation tradeoff via the "magic number" parameter provides a principled means to balance planning and execution workload under practical industrial constraints.

Whiteboard

Follow Topic

Get notified by email when new papers are published related to Dynamic-Programming ZDD-Based Framework.