/purge-and-merge

Puzzle database and solver binaries for purge-and-merge

Purge-and-merge

A collection of puzzles and binaries used in the publication Strengthening probabilistic graphical models: the purge-and-merge algorithm

Puzzle databases

How to run purge-and-merge

The the purge-and-merge algorithm uses Stellenbosch University's emdw library, which is currently closed source. We are working on bringing the code into the open domain, but for now it is still tied to a licensing agreement. All algorithms used in this paper is therefore shared in binary form and is made available as bin.tar.gz in releases, tested on Ubuntu 20.04.3 LTS.

In order to run the binaries, first install the following dependencies:

sudo apt-get install build-essential liblapack-dev libblas-dev libexpat1-dev zlib1g-dev

Also, remember to add execution privileges to the entry point scripts:

chmod +x run_purge_and_merge
chmod +x run_puzzle_to_uai
chmod +x run_ace_on_uai

run_purge_and_merge

Usage: run_purge_and_merge <puzzle-type> <input-puzzle> [<input-puzzle>...]

⚠️Warning run_purge_and_merge works only with the -(legacy-format) filetype versions of Sumsudoku and Calcudoku⚠️

  • puzzle-type can be one of: sudoku, sumsudoku, calcudoku, kakuro or fillapix.
  • input-puzzle...: a list of puzzle filepaths to solve.

For example: ./run_purge_and_merge calcudoku "calcudoku-collection/calcudoku-menneske.no-10.txt"

run_puzzle_to_uai

Usage: run_puzzle_to_uai <puzzle-type> <input-puzzle> <output-file>

⚠️Warning run_puzzle_to_uai works only on default filetype versions and not -(legacy-format) versions⚠️

  • puzzle-type can be one of: sudoku, sumsudoku, calcudoku, kakuro or fillapix.
  • input-puzzle...: Filepath to a puzzle.
  • output-file: Filepath to output file

For example ./run_puzzle_to_uai calcudoku "calcudoku-collection-(legacy-format)/calcudoku-menneske.no-10.txt output.uai"

This will convert any puzzle in this database to a .uai file that can be consumed by ACE.

run_ace_on_uai

Usage: run_ace_on_uai <input.uai>

For example ./run_ace_on_uai output.uai

This is a small wrapper over ACE to load a .uai file created from one of the puzzles, compile the puzzle into a circuit, and query all the unknown variables in that circuit.