We present an algorithm that enumerates all ideals of an input poset with constant delay in Gray code order, i.e., such that consecutively visited ideals differ in at most three elements. This answers a long-standing open problem posed by Pruesse and Ruskey, and improves upon previous algorithms by Pruesse and Ruskey, Squire, Habib, Medina, Nourine and Steiner, as well as Abdo. Using the same techniques, we also obtain an algorithm that enumerates all antichains of an input poset with constant delay such that successively visited antichains differ in at most three elements. As a key technical ingredient, we introduce a new potential-based analysis framework for recursive algorithms, which we call the Pyramid method. We show that this method subsumes the Push-out method of Uno. Beyond the present application, the Pyramid method is a general framework to analyze recursive algorithms and may thus be of independent interest.
翻译:本文提出一种算法,能以恒定时延按格雷码顺序枚举输入偏序集的所有理想,即相邻枚举理想最多相差三个元素。该算法解决了Pruesse与Ruskey提出的长期未决公开问题,并改进了Pruesse与Ruskey、Squire、Habib、Medina、Nourine与Steiner以及Abdo等人的先前算法。利用相同技术,我们进一步获得一种算法,能以恒定时延枚举输入偏序集的所有反链,且相邻枚举反链最多相差三个元素。作为关键技术基础,我们引入了一种基于势能分析的递归算法分析框架,称为金字塔方法。研究表明,该方法包含Uno的推出方法。除当前应用外,金字塔方法作为分析递归算法的通用框架,可能具有独立的研究价值。