3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-19 05:25:48 +00:00
z3/src/math/lp/lp_params_helper.pyg
Lev Nachmanson ef554ad480 lp: lazily skip move_non_basic_columns_to_bounds unless a cut will run
The standalone int_solver call to move_non_basic_columns_to_bounds runs an
O(#nonbasic) scan and, when columns drift, a full find_feasible_solution
re-solve on every check iteration. It is only a precondition for the HNF and
Gomory cut generators; int_branch and int_cube snap for themselves and the
Diophantine handler does not depend on it.

Gate the call behind (should_hnf_cut() || should_gomory_cut()) so a pure-branch
iteration no longer pays the cut precondition cost. The optimization is
controlled by the new boolean parameter lp.int_lazy_move_nb (default true);
setting it false reproduces the previous (master) behavior of always snapping.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-19 15:39:55 -07:00

16 lines
1.7 KiB
Text

def_module_params(module_name='lp',
class_name='lp_params_helper',
description='linear programming parameters',
export=True,
params=(('dio', BOOL, True, 'use Diophantine equalities'),
('dio_branching_period', UINT, 100, 'Period of calling branching on undef in Diophantine handler'),
('dio_cuts_enable_gomory', BOOL, False, 'enable Gomory cuts together with Diophantine cuts, only relevant when dioph_eq is true'),
('dio_cuts_enable_hnf', BOOL, True, 'enable hnf cuts together with Diophantine cuts, only relevant when dioph_eq is true'),
('dio_ignore_big_nums', BOOL, True, 'Ignore the terms with big numbers in the Diophantine handler, only relevant when dioph_eq is true'),
('dio_calls_period', UINT, 1, 'Period of calling the Diophantine handler in the final_check()'),
('dio_run_gcd', BOOL, False, 'Run the GCD heuristic if dio is on, if dio is disabled the option is not used'),
('lcube', BOOL, True, 'use the largest cube test for integer feasibility'),
('lcube_flips', UINT, 16, 'maximal number of coordinate flips when repairing the rounded largest cube center, only relevant when lcube is true'),
('int_lazy_move_nb', BOOL, True, 'skip the standalone move_non_basic_columns_to_bounds call (and its find_feasible_solution re-solve) unless an HNF or Gomory cut will be attempted in this iteration; off reproduces the master behavior of always snapping'),
))