SwiftCSP - A Constraint Satisfaction Problem Solver in Pure Swift

  •        15

SwiftCSP is a constraint satisfaction problem solver written in pure Swift (no Cocoa). It utilizes a simple backtracking algorithm with plans for future optimizations. At this stage of development, it's fairly slow but it includes examples of solving actual problems. It should run on all Swift platforms (iOS, OS X, Linux, tvOS, etc.). A constraint satisfaction problem is a problem composed of variables that have possible values (domains) and constraints on what those values can be. A solver finds a potential solution to that problem by selecting values from the domains of each variable that fit the constraints. For more information you should checkout Chapter 6 of Artificial Intelligence: A Modern Approach (Third Edition) by Norvig and Russell.




Related Projects

CSP in F#


A small and simple CSP (Constraint Satisfaction Problem) solver library in F#.

OptaPlanner - Optimizes business resource scheduling and planning.

  •    Java

OptaPlanner is a constraint satisfaction solver. It optimizes business resource planning. OptaPlanner optimizes such planning problems to do more business with less resources. Use cases include Vehicle Routing, Employee Rostering, Job Scheduling, Bin Packing and many more.

gophersat - gophersat, a SAT solver in Go

  •    Go

This is Gophersat, a SAT and pseudo-boolean solver written purely in Go. Gophersat was developed by the CRIL (Centre de Recherche en Informatique de Lens) at the Artois University & CNRS. It is released under the MIT license. Gophersat is rather efficient, i.e on typical SAT benchmarks it runs about 2 to 5 times slower than top-level solvers (namely, glucose or minisat) from which it is strongly inspired. It can also solve MAXSAT problems, and pseudo-boolean decision and optimization problems. Gophersat's last stable version is version 1.1. It includes a new, more efficient core solver for pure SAT problems and a package for dealing with MAXSAT problems. It also includes a new API for optimization and model counting, where new models are written to channels as soon as they are found.


  •    Java

YACS (Yet Another Constraint Solver) is a Java library and an object-oriented framework for constraint solvers. It supports propagating and solving of constraint satisfaction problems with finite and infinite domains (discrete values and real intervals).

DragonBreath Engine

  •    Java

The DragonBreath Engine is a constraint solver based on local search. It features real-time computation, handling of dynamics, structural constraint satisfaction, and an easy way to include domain-specific knowledge.


  •    Java

choco: a java library for constraint satisfaction problems (CSP), constraint programming (CP).

FRODO: An Open-Source Framework for DCOP

  •    Java

FRODO is a Java platform to solve Distributed Constraint Satisfaction Problems (DisCSPs) and Optimization Problems (DCOPs). It provides implementations for a variety of algorithms, including DPOP (and its variants), ADOPT, SynchBB, DSA...


  •    Java

Constrainer is a Constraint Satisfaction Environment written in Java. It is currently being actively developed and supported as part of another project OpenL Tablets here on Sourceforge: http://sourceforge.net/projects/openl-tablets/?source=navbar

Arc Consistency Crossword Compiler

  •    C

Arc Consistency Crossword Compiler (arccc) uses constraint satisfaction algorithms to fill crossword grids given a wordlist. The current implementation can fill simple grids in less than a minute. A word list gleaned from a variety of sources is includ


  •    C++

Minion is a lean, efficient solver for constraint satisfaction problems.


  •    Python

In this exercise you will explore Constraint Satisfaction Problems in a Jupyter notebook and use a CSP solver to solve a variety of problems. Please DO NOT publish your work on this exercise.

Satisfaction Emoticons Starter Kit


Il progetto ha lo scopo di dare un framework e un punto di partenza per lo sviluppo dell’applicazione di customer satisfaction tramite emoticons. È composto da una solution per Microsoft Visual Studio 2008 e include le emoticons e gli sfondi.

k sudoku

  •    C++

ksudoku is a fully-featured Sudoku puzzle generator and solver for KDE. With it you can generate and play 3D and 2D puzzles of different sizes and levels. The main algorithm is fast and extendable to any general graph coloring problem.

Chess Queens

  •    Java

Calculate the number of solutions to place n queens on an n*n chess board, without any queen attacking each other. Options allow using rooks instead of queens, disabling knight attacks and setting the minimum distance between queens.


  •    Java

A schema validator for the CLiXML (Constraint Language in XML) schema constraint language. The constraint language allows to do semantic tests on an XML document. The validator is written in java and uses jdom.

VISL Constraint Grammar Compiler

  •    C++

The VISL Constraint Grammar Compiler is a natural language parser generator. It is an implementation of Pasi Tapanainen's CG-2 constraint grammar formalism.


  •    Javascript

AutoLayout.js implements Apple's Auto Layout and Visual Format Language in Javascript. Auto layout is a system which lets you perform lay out using mathematical relationships (constraints). It uses the awesome Cassowary.js library to do the actual constraint resolving and implements Apple's constraint system and Visual Format Language (vfl) on top of that. It supports the Extended VFL syntax, including view-stacks and z-indexing. AutoLayout.js is an abstract library for integrating Auto Layout and VFL into other javascript technologies. It provides a simple API and programming model that you can use to build your own auto layout and VFL solution. A simple example of this is, is using position: absolute; to lay out DOM elements. A more elobarate example of this is the Visual Format Editor, which is built using famo.us and famous-flex. AutoLayout.js is written in ES6 and contains transpiled distribution files.

constraint-layout - Constraint Layout Codelab

  •    Java

Constraint Layout Codelab

EIGHT: Easy Image Gallery

  •    Perl

EIGHT: Easy Image Gallery is a perl CGI script to help automate the maintenence of a web based collection of images.