rsr.rsr.minimise_lower_states_random

rsr.rsr.minimise_lower_states_random(comps_st, sfun, sys_lower_st, max_state, *, fval=None, step=1, seed=None, exclude_keys=('sys',))[source]

Random greedy reduction of component states (binary-search variant).

Like minimise_lower_states_random_old(), but each component is resolved in a single visit instead of being raised one step at a time and revisited. For a given component (all others held fixed) sfun is monotone in that component’s state, so the feasibility predicate status <= sys_lower_st flips at most once as the state is raised. This lets us find the highest feasible state with an exponential (galloping) bracketing pass followed by a binary search, using O(log m) sfun calls per component (m = number of states) instead of O(m). Across n components the total cost is O(n * log m).

Component selection/ordering (random permutation, deque) is unchanged; only the per-component state-raising is now a binary search, after which the component is removed from the candidate pool (no interleaved revisits).

Returns:

  • final_state: dict of the minimised states.

  • info: dict with keys permutation, removed_on_upper, hit_min_state, attempts, final_state, final_sys_state.

Return type:

Tuple (final_state, info)