Interval-Memoized Backtracking on ZDDs
- The paper introduces a novel interval memoization technique that efficiently bypasses redundant exploration in ZDD backtracking for cost-bounded problems.
- It leverages the structural sharing of ZDDs to compress and merge nodes, enabling scalable enumeration of complex combinatorial solution spaces.
- Empirical evaluations on Hamiltonian path and grid graph instances show significant speedup and reduced memory usage compared to conventional methods.
Interval-memoized backtracking on Zero-suppressed Decision Diagrams (ZDDs) is a fast and memory-efficient algorithm for exactly enumerating all feasible solutions to combinatorial problems that fall below a specified cost bound. The technique leverages the structural sharing properties of ZDDs and introduces a novel memoization approach based on cost intervals, enabling it to avoid redundant exploration of subproblems and scale efficiently with large numeric bounds whenever the underlying ZDD representations are compact (Minato et al., 2022).
1. Zero-suppressed Decision Diagrams (ZDDs): Structure and Semantics
Let denote a universe of items. A ZDD is a directed acyclic graph (DAG) constructed with two special terminal nodes, $0$ and $1$, and a set of non-terminal nodes. Each non-terminal node is represented as a triple:
- : the item index tested at
- : the 0-child of
- : the 1-child of
Each root-to-$1$ path in the ZDD encodes a subset such that if the high-edge of a node at level is traversed, then , and if the low-edge is taken, then . The "zero-suppressed" property ensures that any node whose high-child is $0$ is deleted, and any two nodes with identical triples are merged, leading to substantial compression for collections of sets with many shared prefixes. The partial evaluation function is defined by and (Minato et al., 2022).
2. Interval-Memoized Backtracking: Core Mechanism
The objective is to enumerate all feasible subsets represented by the ZDD such that the total cost does not exceed some upper bound . A naïve approach would recursively traverse the ZDD and revisit the same node multiple times for different residual budgets, incurring exponential overhead in scenarios with a large cost range. Interval-memoized backtracking introduces a mechanism to sidestep this inefficiency.
For each node , the algorithm maintains a set of disjoint cost intervals , each associated with a ZDD node that represents all subsolutions below with cost at most for any . The crucial definition is:
- A "safe" interval for node is one where, for any such that , the sets of subsolutions of cost and are identical.
This structure enables memoization of entire ranges of budgets, significantly reducing redundant computation relative to canonical memoization schemes indexed by exact budget values (Minato et al., 2022).
3. Recursive Algorithm and Memo-table Structure
The main recursion is specified as , where:
- is the ZDD for all root– paths of cost at most
- ("accept_worst") is the maximum budget for which remains valid
- ("reject_best") is the minimum budget above which would change
The memo-table is a sorted map keyed by disjoint intervals , maintaining pairings to nodes for quick retrieval. If a budget query falls within a stored interval, the algorithm immediately returns the associated subresult; otherwise, it descends recursively, updating for the high-child by subtracting the corresponding . The combined results from the 0-child and 1-child are merged via .
A summary of key operations:
| Operation | Description | Complexity |
|---|---|---|
| Lookup in Memo | Finds covering in | |
| Recursive call on children | 0-child (budget ), 1-child (budget ) | — |
| Interval update after recursion | Computes new safe , inserts into | |
| Output ZDD merge/creation | — |
The result is an output ZDD containing all solutions not exceeding the given cost bound. This approach builds, shares, and memoizes subproblems efficiently by exploiting the cost-interval invariance properties emergent in many combinatorial search spaces (Minato et al., 2022).
4. Complexity Analysis and Theoretical Guarantees
Let denote the number of nodes in the input ZDD , and the number of nodes in the output ZDD . Assuming each interval lookup and insertion in requires time (with current intervals per node), the total time complexity to compute the filtered ZDD is . Each new visit to a pair not covered by existing intervals incurs such a cost and leads to a unique node in the output ZDD and insertion in the memo table.
In contrast, traditional pseudo-polynomial dynamic programming would fill a table of size , where is the numeric cost bound, resulting in time and space. For large costs , classical DP becomes infeasible; the interval-memoized method's efficiency depends solely on the compressed sizes of the input/output ZDDs, making it practical for instances with large numeric domains but well-compressed decision diagrams (Minato et al., 2022).
5. Empirical Evaluation: Hamiltonian Path Instances
Practical efficiency is demonstrated on nontrivial instances, such as the Hamiltonian path problem for the 48-state US map (with vertices and edges), and on grid graphs with random edge costs. Notable empirical results include:
- On the US map, the frontier-based ZDD has . For increasing cost-bounds (up to 20% above minimum), the number of solutions expands to approximately . The interval-memoized approach constructs the filtered ZDD ( up to ) in about $0.09$ seconds with recursive calls.
- In comparison, conventional memoization (by exact budgets) entails calls and $0.66$ seconds; answer set programming solvers such as “clingo” require tens of seconds or may fail to complete.
- On grid graphs (144 edges), up to Hamiltonian paths are enumerated in 11 seconds, and in 255 seconds.
- For grids, as many as paths are enumerated in under one hour.
These findings corroborate the significant efficiency gains of interval-memoized backtracking over more conventional methods for extensive enumeration tasks (Minato et al., 2022).
6. Comparison with Classical Methods and Scope of Applicability
Traditional branch-and-bound approaches are efficient for finding a single optimum but require enumeration of many intermediate solutions if all those with cost are required, with minimal subproblem sharing. Pseudo-polynomial dynamic programming explodes in cost when faced with high numeric bounds, as its memory requirements scale linearly with . In contrast, the ZDD-based interval-memoized approach’s performance is tied to the sizes (feasibility) and (output), both of which can be orders of magnitude smaller than a brute-force decision tree in problems exhibiting prefix-sharing, such as in path enumeration, matroid optimization, and knapsack-like problems.
A plausible implication is that for combinatorial problems where the set of all feasible solutions admits compact ZDD representations (i.e., with high prefix-sharing or exploitably sparse solution spaces), interval-memoized backtracking not only enables the enumeration of billions to trillions of constrained solutions efficiently, but also provides a practical alternative where classical paradigms are computationally infeasible (Minato et al., 2022).