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 onestepat a time and revisited. For a given component (all others held fixed)sfunis monotone in that component’s state, so the feasibility predicatestatus <= sys_lower_stflips 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, usingO(log m)sfuncalls per component (m= number of states) instead ofO(m). Acrossncomponents the total cost isO(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 keyspermutation,removed_on_upper,hit_min_state,attempts,final_state,final_sys_state.
- Return type:
Tuple
(final_state, info)