A Gray Code for the Ideals of a Forest Poset

Y. Koda, F. Ruskey
1993 Journal of Algorithms  
We present two algorithms for listing all ideals of a forest poset. These algorithms generate ideals in a Gray Code manner; that is, consecutive ideals di er by exactly one element. Both algorithms use storage O(n), where n is the number of elements in the poset. On each iteration, the rst algorithm does a partial traversal of the current ideal being listed and runs in time O(nN), where N is the number of ideals of the poset. The second algorithm mimics the rst, but eliminates the traversal and
more » ... runs in time O(N). This algorithm has the property that the amount of computation between successive ideals is O(1); such algorithms are said to be loopless.
doi:10.1006/jagm.1993.1044 fatcat:xwunyyhq25erncl5aoc7mmfwke