This repository gives a reference implementation of the Confined Polygons from Order Polytopes (CPOP) algorithm introduced in the following paper:
- Clayton Shonkwiler and Kandin Theis. Direct sampling of confined polygons in linear time. SIAM Journal on Discrete Mathematics 40 (2026), no. 2, 505–535. arXiv:2501.04885 [math.GT].
CPOP is implemented as a compiled Mathematica function in CPOP.nb. If you do not have Mathematica installed, this can be opened (but not evaluated) with the free Wolfram Player.
This work was supported by the National Science Foundation (DMS–2107700).