Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 1.04 KB

README.md

File metadata and controls

29 lines (21 loc) · 1.04 KB

MQLib Python interface

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.

Installation

pip install .

Quick-Start

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)