A C library for solving Constraint Satisfaction Problems (CSP) developed as a university project, including advanced algorithms like forward checking.
A Constraint Satisfaction Problem (CSP) is a mathematical problem defined by:
- A set of variables
- A domain of possible values for each variable
- A set of constraints between these variables
This library provides tools to efficiently model and solve such problems.
- Creation and manipulation of variables with domains
- Definition of binary and n-ary constraints
- Solving algorithms:
- Simple backtracking
- Forward checking
- Arc consistency (AC-3)
- Variable and value selection heuristics
TODO: Verify information and complete it
git clone git@github.com:Groupe-X-L2-INFO-LRU/csp-lib.git
cd csp-lib
cmake ..
makemkdir build #if not already made
cmake ..` #create MakeFile from the `CMakeList.txt` on root directory
make
make test # to launch all tests
make <executable name> # to launch a specific exectuable- Before compiling, don't forget to go on the build directory to keep the main directory clean
- Create an test file for each function that you create
- Don't forget to do a cmake .. to refresh the MakeFile
- Respect the naming convention
- Comment your code
- Generate Doxygen documentation
- Before commit, enter the next commands :
clang-tidy src/* #check the syntax of your code
clang-format -i src/\* #reformat your code- C compiler supporting C23
- CMake 3.30+
To solve sudoku, enter this command :
./solve-sudoku <puzzle file>
The puzzle file must be resolvable and must respect the input format : each line correspond to a sudoku line and the hidden numbers are replace by a '.' For more informations, see puzzle.txt file
Please respect the directives writen on Contributing.md
- Quentin Sautiere
- Linares Julien TODO: Add your name or pseudonym and link of your profile
MIT - All right reserved For more informations, please check LiCENSE