next up previous
Next: Results and Tournament Analysis Up: Implementation Previous: Cookie Groups and the

Packing Algorithm

Our placers rely heavily on our packing algorithm, which efficiently computes the farthest distance that a cookie can be moved in some direction before it will collide with other cookies or with the dough bounds. The algorithm works by iteratively dividing the remaining distance to the closest known ``bad location" by 2 and moving the cookie by that amount, until the amount moved goes below a fixed threshold. Here ``bad location" is either the bounds of the dough, or some location where the cookie intersected with another cookie during a previous iteration. We ignore the case when a cookie is inside another cookie, since all cookies are the same size and shape. The running time of this algorithm is $ O(\log d)$ where $ d$ is distance to the initial ``bad location."



2003-10-14