Skip to content
/ pymqlib Public

Python interface for MQLib library including various heuristics for combinatorial optimization

License

Notifications You must be signed in to change notification settings

aboev/pymqlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Python interface for MQLib library including various heuristics for combinatorial optimization

Topics

Resources

License

Stars

Watchers

Forks