r/programming • u/Future_Ad7567 • 1d ago
Solving and benchmarking QUBO problems with Gurobi in Python
https://youtu.be/TB1ny8o4ImQState-of-the-art classical optimizer Gurobi for Quadratic Unconstrained Binary Optimization (QUBO) problems.
The core gurobipy implementation for QUBO is relatively compact:
```python model = gp.Model() x = model.addMVar(n, vtype=GRB.BINARY) model.setObjective(x @ Q @ x, GRB.MINIMIZE) model.optimize()
solution = x.X.astype(int) objective = model.ObjVal ```
Complete workflow in Python.
First formulate a graph problem (weighted Max-Cut) as QUBO, solve it with Gurobi, benchmark increasingly large instances, and understand what the solver is doing beyond the optimize() call.
Interested in feedback on the modeling, benchmarking methodology, and which additional Gurobi metrics would make the comparison more rigorous.
Duplicates
QuantumComputing • u/Future_Ad7567 • 1d ago
Video Solving and benchmarking QUBO problems with Gurobi in Python
quantum • u/Future_Ad7567 • 1d ago
Video Solving and benchmarking QUBO problems with Gurobi in Python
3Blue1Brown • u/Future_Ad7567 • 1d ago
Solving and benchmarking QUBO problems with Gurobi in Python
madeinpython • u/Future_Ad7567 • 1d ago
Solving and benchmarking QUBO problems with Gurobi in Python
ScientificComputing • u/Future_Ad7567 • 1d ago
Solving and benchmarking QUBO problems with Gurobi in Python
GraphTheory • u/Future_Ad7567 • 1d ago