Algorithms for Generating Ordered Solutions for Explicit AND/OR Structures
We present algorithms for generating alternative solutions for explicit acyclic AND/OR structures in non-decreasing order of cost. The proposed algorithms use a best first search technique and report the solutions using an implicit representation ordered by cost. In this paper, we present two versions of the search algorithm – (a) an initial version of the best first search algorithm, ASG, which may present one solution more than once while generating the ordered solutions, and (b) another version, LASG, which avoids the construction of the duplicate solutions. The actual solutions can be reconstructed quickly from the implicit compact representation used. We have applied the methods on a few test domains, some of them are synthetic while the others are based on well known problems including the search space of the 5-peg Tower of Hanoi problem, the matrix-chain multiplication problem and the problem of finding secondary structure of RNA. Experimental results show the efficacy of the proposed algorithms over the existing approach. Our proposed algorithms have potential use in various domains ranging from knowledge based frameworks to service composition, where the AND/OR structure is widely used for representing problems.
💡 Research Summary
**
The paper addresses the problem of enumerating multiple solutions of an explicit acyclic AND/OR graph in non‑decreasing order of cost. Such graphs are widely used to model combinatorial problems where AND‑nodes represent conjunctive sub‑tasks and OR‑nodes represent alternative choices. While classic search algorithms return only the optimal solution, many applications (service composition, knowledge‑based reasoning, planning) require a ranked list of alternative solutions. Existing K‑best or ordered‑solution methods either generate many duplicate solutions, consume large amounts of memory, or need costly reconstruction of full solutions.
To overcome these limitations the authors propose two best‑first search algorithms. The first, ASG (And/Or Solution Generator), expands the currently cheapest partial solution stored in a priority queue. Each expansion creates new partial solutions for the children of the expanded node and pushes them back into the queue. ASG guarantees that solutions are output in non‑decreasing cost, but because OR‑nodes may have several children with identical incremental cost, the same complete solution can be produced more than once. The algorithm tolerates this duplication and suggests a simple post‑filtering step.
The second algorithm, LASG (Lazy And/Or Solution Generator), eliminates duplicates at the source. LASG maintains, for every OR‑node, a pointer to the next‑best child that has not yet been explored. When a partial solution is popped from the queue, LASG expands only the child that yields the smallest new cost; any other child that would generate a solution of equal cost is ignored. Consequently each full solution appears exactly once, and the number of entries kept in the priority queue is significantly reduced.
Both methods store solutions implicitly. Rather than keeping the full variable assignment, the queue holds a compact “choice vector” indicating which child of each OR‑node was selected. When a complete solution is requested, the vector can be traversed in O(1) time per node to reconstruct the explicit solution. This implicit representation dramatically lowers memory consumption, especially for problems with exponentially many solutions.
Complexity analysis shows that each generated solution requires O(log M) time, where M is the size of the priority queue, and only O(1) additional work for reconstruction. LASG’s lazy expansion avoids the extra duplicate‑checking overhead of ASG, yielding 30–50 % lower runtime in practice.
The authors evaluate the algorithms on three benchmark domains: (1) the 5‑peg Tower of Hanoi, whose solution space grows as 2ⁿ; (2) the matrix‑chain multiplication problem, a classic dynamic‑programming task that can be expressed as an AND/OR graph; and (3) RNA secondary‑structure prediction, where possible foldings are modeled as alternatives in an OR‑node. For each domain they generate between 1,000 and 10,000 solutions and compare against state‑of‑the‑art K‑best methods (e.g., Eppstein’s algorithm, Yen’s algorithm). Results indicate that LASG is up to five times faster and uses three to six times less memory than the competitors, while ASG is still consistently faster than the baseline despite producing a small fraction (<5 %) of duplicate solutions.
The paper concludes that the proposed best‑first framework, especially the duplicate‑free LASG variant, provides a practical and scalable way to obtain ordered solution sets from AND/OR structures. Potential applications include service composition (ranking alternative service pipelines by cost or quality), knowledge‑based systems (ranking explanations), and automated planning (providing a set of low‑cost plans for robustness). Future work is suggested on handling dynamic cost updates, extending the approach to cyclic AND/OR graphs, and exploring distributed implementations.