quast_decisiontree.algorithms.classical.brute_force
quast_decisiontree.algorithms.classical.brute_force
Brute-force fallback classical optimizer. A wrapper around scipy.optimize.brute.
BruteForce
Bases: ClassicalAlgorithm
Exhaustive binary optimizer for small QUBO matrices.
Source code in src/quast_decisiontree/algorithms/classical/brute_force.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
check_input
classmethod
check_input(opt_problem)
Check whether opt_problem is a valid QUBO input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
opt_problem
|
Any
|
The problem description to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if |
Source code in src/quast_decisiontree/algorithms/classical/brute_force.py
24 25 26 27 28 29 30 31 32 33 34 | |
execute
execute(opt_problem, classical_args=None)
Return a brute-force binary solution vector and its objective value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
opt_problem
|
Any
|
A QUBO matrix whose bilinear form is minimized. |
required |
classical_args
|
Any
|
Present for signature compatibility; unused. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[list[int], float]
|
A tuple |
Raises:
| Type | Description |
|---|---|
TypeError
|
If |
Source code in src/quast_decisiontree/algorithms/classical/brute_force.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |