Repository navigation
Give functional_cover_search a deadline from the pipeline's time budget - #84
Merged
Merged
Conversation
Each solve gets the time left as HiGHS's time limit, and a solve stopped there or a deadline passed between covers ends the search with exact False and stopped set; the pipeline's functional stage passes 30% of the remaining budget and offers no generator from a stopped search. With a deadline the search is skipped above 20,000 product rectangles, since HiGHS checks its time limit only after a presolve whose cost grows faster than the column count.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
functional_cover_searchtakes adeadline(atime.monotonic()value). Each MILP solve gets the time left as HiGHS'stime_limit; a solve stopped there, or a deadline passed between covers, ends the search withexactFalse, the identity cover and a newstoppedfield set.lowerthen counts only the covers solved to optimality.stopped, and offers no generator from a stopped search. Without a time budget nothing changes.Why
In a spot-check on main,
generative_modeltook 750 s on a 300 s budget ons3-n2-t0022-d2, a truncated 2-state ternary build with 132,103 product rectangles: the functional stage started before its deadline, and the exact cover's first solve alone took 535 s.A time limit alone does not bound this. With a 5 s
time_limit, the first solve stopped at 5.1 s on 10,000 of its rectangles, 9.3 s on 20,000, 25.7 s on 40,000 and 343 s on all 132,103. HiGHS's presolve found no reductions and reported "Time limit reached" only when it finished; with presolve off the solve ignored the limit and ran to optimality in 190 s.Of the 825 processes in the generator archive, this is the only one with more than 20,000 product rectangles and fewer than
product_rectangles' limit of 200,000 (median 6, next largest 12,297). In the round-18 bracket reruns (300 s and 900 s), the functional cover gave the pipeline's upper bound on three processes, with 28 to 126 product rectangles.Results
generative_model_from_bidirectional(bidir, stages=("machines", "functional"), time_budget=60.0)ons3-n2-t0022-d2:The full search on main finds no functional generator below the ε-machine, so the skip loses nothing here. These runs call the lower-level entry to force the stage; its lower bounds are computed on the truncation (as its docstring says), so only times and upper bounds are compared.
Tests
test_functional_cover_search_stops_at_its_deadline,test_functional_cover_search_time_limit_is_not_exhaustion(milpmocked to return status 1),test_functional_cover_search_skips_many_rectangles_only_on_a_deadline, andtest_generative_model_gives_the_functional_stage_a_deadline(the pipeline end to end with the cap lowered).test_generative_model,test_generative_model_invariants,test_generative_search_helpers,test_minimal_generative_model,test_generative_objectivesandtest_generator_caps: 96 passed, 4 slow deselected.ruff check,ruff format --checkclean;ty checkshows the same 3 warnings as main.