{"id":21761963,"url":"https://github.com/hjyup/sudoku-solver","last_synced_at":"2025-03-21T04:41:21.714Z","repository":{"id":264690865,"uuid":"882009164","full_name":"HJyup/sudoku-solver","owner":"HJyup","description":"Haskell-based application that solves Sudoku puzzles using the DPLL","archived":false,"fork":false,"pushed_at":"2024-11-25T19:03:22.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T01:19:47.007Z","etag":null,"topics":["cabal","dpll-algorithm","haskell-application","sudoku-solver"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HJyup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-11-01T17:27:56.000Z","updated_at":"2024-11-25T19:03:25.000Z","dependencies_parsed_at":"2024-11-25T20:19:06.123Z","dependency_job_id":null,"html_url":"https://github.com/HJyup/sudoku-solver","commit_stats":null,"previous_names":["hjyup/sudoku-solver"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HJyup%2Fsudoku-solver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HJyup%2Fsudoku-solver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HJyup%2Fsudoku-solver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HJyup%2Fsudoku-solver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HJyup","download_url":"https://codeload.github.com/HJyup/sudoku-solver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244739947,"owners_count":20501990,"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":["cabal","dpll-algorithm","haskell-application","sudoku-solver"],"created_at":"2024-11-26T12:10:27.830Z","updated_at":"2025-03-21T04:41:21.694Z","avatar_url":"https://github.com/HJyup.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Sudoku solver\nThis is a Haskell-based application that solves Sudoku puzzles using the **DPLL (Davis-Putnam-Logemann-Loveland) algorithm**, a popular method for solving SAT (Boolean satisfiability) problems. The DPLL algorithm is adapted here to handle Sudoku, treating each puzzle as a logic problem.\n## Algorithm\n\nThe basic backtracking algorithm runs by choosing a literal, assigning a truth value to it, simplifying the formula and then recursively checking if the simplified formula is satisfiable; if this is the case, the original formula is satisfiable; otherwise, the same recursive check is done assuming the opposite truth value\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/d/dc/Dpll11.png\" alt=\"DPLL\"/\u003e\n\u003c/p\u003e\n\nIn practice, DPLL is often very efficient. But it’s very slow in some cases, taking time that is exponential in the size of its input, which is the same as checking satisfiability using truth tables. No algorithm for satisfiability is known that doesn’t share this property\n## Example of Predefined Puzzle\n\nA sample puzzle is predefined in the code:\n\n```bash\nsudokuProblem :: Form (Int, Int, Int)\nsudokuProblem = And [ Or [P (1,8,8)], Or [P (1,9,2)], Or [P (2,1,6)]\n                    , Or [P (2,4,4)], Or [P (4,1,4)], Or [P (4,5,7)]\n                    , Or [P (4,6,2)], Or [P (5,1,5)], Or [P (5,7,4)]\n                    , Or [P (5,8,3)], Or [P (6,5,1)], Or [P (7,4,8)]\n                    , Or [P (7,7,6)], Or [P (8,2,8)], Or [P (8,3,1)]\n                    , Or [P (9,2,2)], Or [P (9,9,7)]]\n```\n##     Requirements\n\n* GHC (Glasgow Haskell Compiler): Ensure you have GHC installed. \n* Cabal: For managing Haskell dependencies and building the project.\n\n## Run Locally\n\nClone the repository and navigate to the project directory:\n\n```bash\n\ngit clone https://github.com/HJyup/sudoku-solver.git\ncd sudoku-solver\n\n```\n\nBuild the project with Cabal:\n\n```bash\n\ncabal build\n\n```\n\nRun the application with Cabal:\n\n```bash\n\ncabal run sudoku-solver\n\n```\n\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhjyup%2Fsudoku-solver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhjyup%2Fsudoku-solver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhjyup%2Fsudoku-solver/lists"}