{"id":19463747,"url":"https://github.com/rand-asswad/taquin","last_synced_at":"2026-02-28T22:31:29.725Z","repository":{"id":131358188,"uuid":"217357372","full_name":"rand-asswad/taquin","owner":"rand-asswad","description":null,"archived":false,"fork":false,"pushed_at":"2019-12-03T23:44:54.000Z","size":12770,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-25T13:29:35.931Z","etag":null,"topics":["15-puzzle","a-star","graph-search-algorithms","iterative-deepening-search","prolog","swi-prolog"],"latest_commit_sha":null,"homepage":"https://rand-asswad.github.io/taquin/","language":"Prolog","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/rand-asswad.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":"2019-10-24T17:38:06.000Z","updated_at":"2019-12-03T23:44:56.000Z","dependencies_parsed_at":"2023-07-31T18:15:10.866Z","dependency_job_id":null,"html_url":"https://github.com/rand-asswad/taquin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rand-asswad/taquin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rand-asswad%2Ftaquin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rand-asswad%2Ftaquin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rand-asswad%2Ftaquin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rand-asswad%2Ftaquin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rand-asswad","download_url":"https://codeload.github.com/rand-asswad/taquin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rand-asswad%2Ftaquin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29953281,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T18:42:55.706Z","status":"ssl_error","status_checked_at":"2026-02-28T18:42:48.811Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["15-puzzle","a-star","graph-search-algorithms","iterative-deepening-search","prolog","swi-prolog"],"created_at":"2024-11-10T18:12:01.982Z","updated_at":"2026-02-28T22:31:29.688Z","avatar_url":"https://github.com/rand-asswad.png","language":"Prolog","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Taquin (8-puzzle)\n\nThe famous sliding tiles game implemented in **Prolog**\nusing A* graph search algorithm for N×M size puzzles.\n\n![](docs/img/cover_img.png)\n\n## Usage\n\nThe code is implemented for [SWI Prolog](https://www.swi-prolog.org/) environment.\n\nRun the following command in your shell (provided you have SWI Prolog installed):\n```sh\nswipl test_3x3.pl\n```\nYou can also try `test_3x4.pl` or `test_4x4.pl`.\n\nThen run in your prolog console the following query\n```prolog\npuzzle(Puzzle, Difficulty), testPuzzle(Puzzle, ?Algorithm, ?Heuristic).\n```\n- The `Heuristic` value can be ommitted, the program would call the most adapted\nheuristic for the chosen algorithm (recommended).\n- The `Algorithm` can be ommitted, the default value is `astar`.\n\n## Project Structure\n\n```\ntaquin\n├── util\n│   ├── core.pl....................core predicates\n│   ├── hamming.pl.................hamming heuristic definition\n│   ├── heuristic.pl...............heuristics wrapper predicates\n│   ├── manhattan.pl...............manhattan heuristic definition\n│   ├── moves.pl...................states adjacency\n│   └── test.pl....................testing tools\n├── taquin_astar.pl................A* algorithm\n├── taquin_dfs.pl..................DFS-style algorithms\n├── taquin.pl......................taquin solver wrapper\n├── test_3x3.pl....................3×3 example puzzles\n├── test_3x4.pl....................3×4 example puzzles\n├── test_4x4.pl....................4×4 example puzzles\n└── README.md......................quick usage guide\n```\n\n## Search Algorithms\n\n- **Depth-First Search (DFS):** a simple implementation of DFS using prolog's search trees,\n  there is no optimality guaranty, probable overflow because of the lack of depth control.\n- **Iterative Deepening DFS (ID-DFS):** analog to DFS with a given Depth, starts with an\n  underestimate of the optimal depth (an admissible heuristic)\n  and increments the depth successively until a solution is found.\n  Optimality is guarantied, solutions are almost always fast for 3×3 puzzles.\n  Nevertheless, for complex puzzles bigger than 3×3 the ID-DFS is as hopeless as DFS.\n- **Greedy Search:** a simple greedy algorithms that chooses each step by minimizing a\n  heuristic (admissible or not), there is no optimality guaranty but the algorithm\n  is fast and finds a solution for all 3x3 puzzles with the `m3h` heuristic,\n  possible overflow for complex puzzles because of th lack of depth control.\n- **A\\* Search:** a rigourous A* implementation using a priority queue that is guarantied\n  to find an optimal solution with an admissible heuristic *manhattan* or *hamming*.\n  Is relatively slow, but is significantly faster and more performant in the case\n  of complex puzzles.\n\nThe code is well-documented and readable,\nfor more details the report is in [docs/book.pdf](https://rand-asswad.github.io/taquin/book.pdf)\nwritten in French (as the project is part of Masters program at INSA Rouen).\n\n## To-Do List\n\n- Implement IDA\\*\n- Implement random puzzle generator\n- Implement comparison (time and solution optimality-wise)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frand-asswad%2Ftaquin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frand-asswad%2Ftaquin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frand-asswad%2Ftaquin/lists"}