Function hercules::local_search_utils::one_step_local_search

source ·
pub fn one_step_local_search(
    qubo: &Qubo,
    x_0: &Array1<usize>,
    subset: &Vec<usize>
) -> Array1<usize>
Expand description

Performs a single gain local search, which is to say that it will flip a single bit and return the best solution out of all of the possible bit flips. This takes O(n|Q|) + O(n) time, where |Q| is the number of non-zero elements in the QUBO matrix.

§Panics

Will panic is the subset of variables is zero.