EECE571F-project / B&B / main.py
main.py
Raw
import numpy as np
from branch_and_bound import BnB

c = np.array([-5.0, -4.0])
A = np.array(
    [[2.0, 3.0],
     [2.0, 1.0]]
)
b = np.array([12.0, 6.0])

bounds = [(0, None) for _ in range(c.shape[0])]
int_indices = [0, 1]
sol, time = BnB(c, A, b, bounds=bounds, int_indices=int_indices)
print(f"x* = {sol.x}")
print(f"Time to solve: {time} seconds")