Skip to content

irregular: remove the dominated periodic blocks with staircases - #892

Open
fontanf wants to merge 1 commit into
masterfrom
irregular-periodic-blocks-dominance
Open

fontanf wants to merge 1 commit into
masterfrom
irregular-periodic-blocks-dominance

Conversation

@fontanf

@fontanf fontanf commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Depends on #891 (based on its branch).

Each new periodic block was checked against every block kept so far, so the cost grows quadratically with the number of blocks. On Cheng from Costa, Gomes & Oliveira (2009) there are 67,759 blocks, and this check took most of the 76.5 s spent building them.

A block of a single item type with n copies is dominated iff some block of the same item type with at least n copies is no larger in either dimension. The new NonDominatedBlocks class keeps, for each item type and each copy count n, the Pareto front of the dimensions of the blocks with at least n copies. This front is a staircase, stored in a std::map from bx to by.

  • A dominance check is a single lookup in staircase n.
  • Adding a block with n copies inserts it into staircases n down to 1 and erases the points it dominates. It stops early once an existing point dominates it.
  • Blocks with several item types keep the linear check, as do the framed blocks.

The blocks kept are the same as before: 67,759 on Cheng, and the solutions found are unchanged.

Cheng Before After
Block generation 76.5 s 5.1 s
First solution (464) 92.7 s 10.6 s
468 137 s 97 s

Base automatically changed from irregular-periodic-packings-time-limit to master November 25, 2026 22:39
Each new periodic block was checked against all the blocks kept so far, which
is quadratic in the number of blocks. For the blocks of a single item type,
a block with n copies is dominated iff a block with at least n copies is not
larger in both dimensions. For each item type and each number of copies n,
the blocks with at least n copies are now stored as the Pareto front of their
dimensions (a staircase), so a dominance check is a single lookup. The blocks
kept are the same as before.
@fontanf
fontanf force-pushed the irregular-periodic-blocks-dominance branch from 619536b to 169931d Compare November 25, 2026 22:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant