{"id":13749333,"url":"https://github.com/erohkohl/n-queens-sat","last_synced_at":"2025-05-09T12:32:37.745Z","repository":{"id":216843068,"uuid":"95315587","full_name":"erohkohl/n-queens-sat","owner":"erohkohl","description":"Modelling n-queens problem as conjunctive normal form and solving it with DPLL algorithm. This project should made me familiar with Rust and the test driven approach.","archived":false,"fork":false,"pushed_at":"2017-07-20T19:00:58.000Z","size":17115,"stargazers_count":7,"open_issues_count":5,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-05-22T22:33:07.863Z","etag":null,"topics":["constraint-programming","constraint-satisfaction-problem","dpll-algorithm","n-queens","rust","rust-lang","sat-solver","tdd"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erohkohl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-24T18:30:37.000Z","updated_at":"2024-08-03T07:03:15.609Z","dependencies_parsed_at":null,"dependency_job_id":"b954e2db-f97b-4c51-9d8e-00d7ebfc9b0a","html_url":"https://github.com/erohkohl/n-queens-sat","commit_stats":null,"previous_names":["erohkohl/n-queens-sat"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erohkohl%2Fn-queens-sat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erohkohl%2Fn-queens-sat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erohkohl%2Fn-queens-sat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erohkohl%2Fn-queens-sat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erohkohl","download_url":"https://codeload.github.com/erohkohl/n-queens-sat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253251646,"owners_count":21878539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["constraint-programming","constraint-satisfaction-problem","dpll-algorithm","n-queens","rust","rust-lang","sat-solver","tdd"],"created_at":"2024-08-03T07:00:59.564Z","updated_at":"2025-05-09T12:32:37.469Z","avatar_url":"https://github.com/erohkohl.png","language":"Rust","funding_links":[],"categories":["Unclassified"],"sub_categories":["Libraries"],"readme":"Modelling n-queens problem as propositional formula and solve it with DPLL \n------------\n[![Build Status](https://travis-ci.org/erohkohl/n-queens-sat.svg?branch=master)](https://travis-ci.org/erohkohl/n-queens-sat) [![codecov](https://codecov.io/gh/erohkohl/n-queens-sat/branch/master/graph/badge.svg)](https://codecov.io/gh/erohkohl/n-queens-sat)\n\nThis project provides a simple implementation of the *Davis, Putnam, Logemann* and *Loveland* algorithm \n(see [DPLL](https://en.wikipedia.org/wiki/DPLL_algorithm)) in the modern systems programming language \n[Rust](https://www.rust-lang.org/en-US/). The DPLL algorithm decides whether a propositional \nformula in *conjunctive normal form* (CNF) is satisfiable and returns a satisfiable assignment. Therefore it extends the \ndepth first search with *unit propagation* (UP), if a literal must be true in the current partial assignment. You\ncan find my implementation of the DPLL algorithm in the Rust-file \n[src/logic/sat.rs](https://github.com/erohkohl/n-queens-sat/blob/master/src/logic/sat.rs). Furthermore the file \n[src/model/n_queens.rs](https://github.com/erohkohl/n-queens-sat/blob/master/src/model/n_queens.rs) \ncontains the modelling of the n-queens problem as propositional formula. The following listing shows one possible\nsolution of the four-queens problem.\n\n```bash\n. Q . . \n. . . Q \nQ . . . \n. . Q . \n```\n\nThis implementation is not able to solve six-queens problem in acceptable time, because it's\ndata structures and UP is not fast enough.\n\n#### Future work\n\n- Improve performance of UP and data structures to solve eight-queens problem in appropriate time\n- Add *Conflict-Driven Clause Learning* (see [CDCL](https://en.wikipedia.org/wiki/Conflict-Driven_Clause_Learning)) \nto DPLL algorithm\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferohkohl%2Fn-queens-sat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferohkohl%2Fn-queens-sat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferohkohl%2Fn-queens-sat/lists"}