Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simulated Annealing sampler

This code implements a Simulated Annealing sampler for QUBO problems. Refer to Optimization by Simulated Annealing for an overview of this method.

How to run

You will need a C++ compiler installed. Compile with make. Two executables will be under the build/bin directory. An input matrix can be solved as follows:

build/bin/simAnnSingle.out /path/to/file.txt

The solution can be written to file by specifying one more argument:

build/bin/simAnnSingle.out /path/to/input/file.txt /path/to/output/file.txt 

An example of a valid input matrix is the following one:

-1 8 8 8 0 0 0 0
0 -1 0 8 0 0 0 0
0 0 -1 8 8 0 8 0
0 0 0 -1 0 8 0 8
0 0 0 0 -1 0 8 0
0 0 0 0 0 -1 0 8
0 0 0 0 0 0 -1 8
0 0 0 0 0 0 0 -1

Expected output

If an output file is specified, the output will be in the following form:

1,0,0,0,1,1,0,0
-3

The first line contains the value of each binary variable and the second line is the energy of the best solution.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages