Repository contains Python interface for MQLib library. MQLib is a collection of well-known heuristics for solving combinatorial problems based on paper What Works Best When? A Systematic Evaluation of Heuristics for Max-Cut and QUBO. Original source was obtained from Pythonhosted and refactored in accordance with MQLib.
Main difference is instrumentation of custom callback functions (see example below) and small fixes.
pip install .
from MQLib import Instance, runHeuristic
import numpy as np
Q = np.random.randn(10,10)
Q = (Q + Q.T)/2
i = Instance('Q', Q)
def cb_fun(spins):
print("New solution = %s" % spins)
return 1
runHeuristic("BURER2002", i, 10, cb_fun, 100)