Skip to main content

A simple wrapper for Z3 solver

Project description

Argyle_Sudoku

This project was partly based on the code from z3-sudoku

This project uses python z3-solver to benchmark encoding techniques to solving the same problem. It then compares the efficiency of each method and between different encoding techniques.

A demo of how to use the library is provided by solving sudoku in ./src/Sudokus

In Sudoku.py both traditional implementation of adding conditional constraints using if-else statements and our approach of adding conditional constraints using our custom solver is presented. An example of two different ways of querying if an index can be set to a number is presented.

Directory Structure

  • /analysis: Includes scripts and notebooks for analyzing solver performance and generating images for reports or presentations.

  • /problem_instances:

    • /particular_hard_instances_records: Particular hard instances identified during the generation process, in txt and SMT format
    • /whole_problem_records: Whole sudoku problems in txt and SMT format
    • Details of recording format explained here
  • /solvers: Houses executables and related files for various SMT solvers used in the project.

  • /src: Contains source code for core functionalities.

    • /Sudokus/Sudoku.py: Contains all functionalities of building sudoku with various constraints, logging sudoku instances to files in string format and smt format, /sudoku_database: Stores string descriptions of generated Sudoku puzzles, both full (solved) and holes (incomplete).
    • /Sudokus/run_sudoku_experiment.py: This file contains the main function. It takes in a sudoku file and solves it using the methods in sudoku.py. It then prints/ the solution and the time taken to solve it.
  • sudoku_database: Stores the already generated full and holes sudokus

    • currline.txt: stores the which line of the full sudokus file should the solver generating sudoku holes start loading from and solving when calling run_experiment
  • /tests: scripts for development testing

  • /time_records: Direct directory for storing time records from solver runs, highlighting the performance of different solvers.

The workflow is depicted in the following picture:

workflow

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jz3-0.1.2.tar.gz (135.4 kB view details)

Uploaded Source

Built Distribution

jz3-0.1.2-py3-none-any.whl (306.7 kB view details)

Uploaded Python 3

File details

Details for the file jz3-0.1.2.tar.gz.

File metadata

  • Download URL: jz3-0.1.2.tar.gz
  • Upload date:
  • Size: 135.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.4

File hashes

Hashes for jz3-0.1.2.tar.gz
Algorithm Hash digest
SHA256 089b2583c73e901702b355ea8fad59ec21b10c92a3aa79c2ee4b5eec1ca2b1f5
MD5 9540c7aa56084f17d26bf9d4c5dd5cb0
BLAKE2b-256 fbdbb03e45e8e94143b6c75ec59db1aea8658d1f6c95d483db09a2b8e98db6be

See more details on using hashes here.

File details

Details for the file jz3-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: jz3-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 306.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.4

File hashes

Hashes for jz3-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 74263b17200781fa6e738ee52fbd811a019ac4a9b1bf3549d21441bfb52e6c0b
MD5 f449d25c13c81f7d140cc50a00a6a0c4
BLAKE2b-256 d0e2550b6ab479145f3056e517eb68a3476e13483e09cb037cdbe51721649313

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page