Function hercules::python_interopt::solve_branch_bound
source · pub fn solve_branch_bound(
problem: (Vec<usize>, Vec<usize>, Vec<f64>, Vec<f64>, usize),
timeout: f64,
warm_start: Option<Vec<usize>>,
seed: Option<usize>,
branch_strategy: Option<String>,
sub_problem_solver: Option<String>,
threads: Option<usize>,
verbose: Option<usize>
) -> PyResult<(Vec<usize>, f64, f64, usize, usize)>
Expand description
Solves the QUBO using branch and bound, returns the best solution found.
Example
import hercules
# read in the QUBO from a file
problem = hercules.read_qubo("file.qubo")
# calculate a warm start
x_0, _ = hercules.pso(problem, 0, 10, 100)
# solve the QUBO using branch and bound
x, obj, time, nodes_visited, nodes_processed = hercules.solve_branch_bound(problem, timeout = 10.0, warm_start = x_0, seed = 12345, branch_strategy = "MostViolated", sub_problem_solver="Clarabel", threads=32, verbose=1)
§Errors
This shouldn’t error, but if it does, it will abort.