Skip to content

irregular: check the time limit while building the periodic blocks - #891

Merged
fontanf merged 1 commit into
masterfrom
irregular-periodic-packings-time-limit
Nov 25, 2026
Merged

fontanf merged 1 commit into
masterfrom
irregular-periodic-packings-time-limit

Conversation

@fontanf

@fontanf fontanf commented Nov 25, 2026

Copy link
Copy Markdown
Owner

The blocks of the periodic packing tree search (TSPP) were built without checking the timer. On instances with many copies and continuous rotations, building them could take much longer than the time limit. For example, on Cheng from Costa, Gomes & Oliveira (2009), it took 76.5 s, so a run with a 30 s limit ended after about 90 s.

Changes:

  • compute_periodic_blocks and compute_periodic_blocks_for_item_type take an optional timer. The timer is checked between packings and at each top in the clipped-lattice block generation. When it needs to end, the blocks already built are returned.
  • BranchingSchemePeriodicPacking::Parameters has a timer. tree_search_periodic_packing sets it, with the end boolean of the algorithm formatter, and returns right away if the timer ended while the blocks were being built.
  • The maximal spaces tree search passes its timer as well.

With a 30 s limit, Cheng now stops at 30.1 s.

The blocks of the periodic packing tree search were built without checking
the timer. On instances with many copies and continuous rotations (e.g. Cheng
from Costa et al. 2009), building them could take far longer than the time
limit. The timer is now checked while building them, and the blocks already
built are returned when it needs to end.
@fontanf
fontanf merged commit babd435 into master Nov 25, 2026
8 checks passed
@fontanf
fontanf deleted the irregular-periodic-packings-time-limit branch November 25, 2026 22:39
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