{"id":25088899,"url":"https://github.com/mohamed-souiyeh/daedalus","last_synced_at":"2025-09-19T20:32:41.252Z","repository":{"id":241892883,"uuid":"718298377","full_name":"mohamed-souiyeh/Daedalus","owner":"mohamed-souiyeh","description":"This project is my humble attempt to display how beautiful and elegant algorithms can be.","archived":false,"fork":false,"pushed_at":"2024-05-30T14:23:55.000Z","size":98914,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T10:53:34.903Z","etag":null,"topics":["algorithms-and-data-structures","maze-generator","maze-solver","mazes"],"latest_commit_sha":null,"homepage":"https://medsouiyeh.live/Daedalus/","language":"TypeScript","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/mohamed-souiyeh.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":"2023-11-13T19:50:38.000Z","updated_at":"2025-02-05T16:47:47.000Z","dependencies_parsed_at":"2024-05-30T15:42:20.394Z","dependency_job_id":null,"html_url":"https://github.com/mohamed-souiyeh/Daedalus","commit_stats":null,"previous_names":["mohamed-souiyeh/daedalus"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamed-souiyeh%2FDaedalus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamed-souiyeh%2FDaedalus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamed-souiyeh%2FDaedalus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamed-souiyeh%2FDaedalus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohamed-souiyeh","download_url":"https://codeload.github.com/mohamed-souiyeh/Daedalus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246673214,"owners_count":20815524,"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":["algorithms-and-data-structures","maze-generator","maze-solver","mazes"],"created_at":"2025-02-07T10:53:17.744Z","updated_at":"2025-09-19T20:32:36.173Z","avatar_url":"https://github.com/mohamed-souiyeh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eDaedalus 🧭: brings mazes to life! ✨\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003eWatch as intricate mazes are generated and solved step-by-step 👣. It's like magic, but it's algorithms! 🧠\n\u003c/div\u003e\n\n## 📖 Introduction\n\nI've always been fascinated by the elegance and beauty of algorithms, especially those used to create and solve mazes. Daedalus is my way of bringing those algorithms to life – a simple, yet visually captivating way to explore their beauty.\n\nI hope you have as much fun playing with this project as I had creating it! 😊\n\n[![Gif showing Daedalus in action](media/overview.gif)](https://medsouiyeh.tech/Daedalus/)  ☝️ **Click to see Daedalus in action!**\n\n\n## 🚀 Technologies \u0026 Tools\n- TypeScript.\n- 2D canvas API.\n- Nextjs and NextUI componments.\n\n## ✨ Features\n* **Watch mazes come to life:** Witness the step-by-step creation and navigation of intricate mazes, all in real-time 📽️.\n\n* **Adapts on the fly:** Effortlessly adjust the grid or move the start/finish points, and watch the path recalculate instantly ⚡.\n\n* **Depth filter:** Mazes are colored using filter, showing the distance from a starting point in vibrant hues 🎨.\n\n* **Simple controles:** Seamlessly adjust animation speed, pause to analyze the process, or reset with ease – all without a single refresh 🕹️.\n\n\n\n## 🤓 The Algorithms\n\nBefore we dive into the algorithms, let's understand a few key concepts:\n\n### 1. Graphs \u0026 Mazes 🗺️\n* **Graph:** Think of a graph like a connect-the-dots puzzle. Each dot is a \"node,\" and the lines between them are \"edges.\" Nodes can represent anything – cities, websites, or even locations in a maze. The edges show the possible paths between nodes.\n* **Manhattan Grid:** Daedalus uses a special type of graph called a \"Manhattan grid\" to represent mazes. It's like a city block where you can only move horizontally or vertically along the streets (the edges).\n\n### 2. Weight, Cost, \u0026 Distance ⚖️\nThink of a maze as a simple graph:\n* **Nodes:** These are the points or intersections in the maze.\n* **Edges:** These are the paths (corridors) between the nodes.\n\n* **Weight:** Each edge (path) can have a weight. Imagine it like a difficulty level for that path. \n    * For example:\n        * A narrow, twisting path might have a weight of 5.\n        * A wide, straight path might have a weight of 1.\n* **Cost:** The total weight of all the paths you've taken so far to reach a certain point (node). Think of it like the total energy or effort you've spent.\n* **Distance:** How far apart two nodes are, regardless of the path taken. It's the shortest possible straight line, even if you can't walk that way in the maze.\n\n**Why it Matters:**\n\nDifferent algorithms care about different things:\n\n* **Some algorithms want the shortest distance:** They might ignore weights and just find the path with the fewest turns.\n* **Some algorithms want the lowest cost:** They'll consider weights and try to find the easiest, most efficient route, even if it's a bit longer. \n\n**In Daedalus:** You can play around with weighted and unweighted paths to see how these ideas affect the way your maze is solved!\n\n### 3. Heuristics in Algorithms 🧠\n\n**Imagine you're trying to find the quickest route to a friend's house across town.** You could wander around randomly, but that would take forever. Instead, you use a heuristic – a rule of thumb – to guide you.\n\n**Heuristic:** It's like a shortcut or a best guess to help you make decisions faster. It might not always be perfect, but it's usually helpful.\n\n**In our example, your heuristic might be:** \"Always move towards my friend's neighborhood.\"\n\nThis doesn't guarantee the fastest route, but it's a lot better than going in random directions. You might take a slightly longer route, but you'll get there much faster overall.\n\n**In Pathfinding Algorithms:**\n\nHeuristics work similarly, It's like the algorithm's \"instinct\" for finding its way through the maze. Imagine the algorithm is navigating a maze to find the exit. A common heuristic is the \"Manhattan distance\" – the straight-line distance to the goal.\n\n**The algorithm thinks:** \"I don't know the exact path yet, but I'll prioritize exploring paths that seem to be getting closer to the exit based on this straight-line distance.\"\n\n**Why Heuristics Matter:**\n\n* **They make algorithms faster:** By focusing on promising directions, algorithms avoid exploring useless paths.\n* **They don't always guarantee the best solution:** Sometimes, the heuristic might lead the algorithm astray, but in most cases, it significantly speeds things up.\n\n**now with that out of the way let's check the algorithms used in Daedalus.**\n\n### 🤖 Maze Generation Algorithms\n* **Simplified Prim:** This algorithm is a modified version of the original Prim graph MST (minimum spanning tree) algorithm.\n    - It randomly selects a cell from a set of cells that are intended to be visited, adds a random unvisited neighbour of that cell to the set, and links it to the current cell. This process is repeated until all grid cells are visited.\n\n* **Recursive Backtracker:** This algorithm is a tweaked implementation of the graphs algorithm DFS (depth-first search).\n    - It explores the grid as deep as it can in random directions before backtracking to the last place where it can continue exploring until the grid is fully explored.\n\n* **Recursive Divider:** This algorithm creates mazes by placing walls on an empty grid, \n    It differs from conventional methods of carving out the maze features.\n    - It divides the available space into two at a random point and repeats this process recursively until further divisions are not possible.\n\n* **Randomized Kruskal:** This algorithm is a modified version of the original Kruskal graph MST (minimum spanning tree) algorithm.\n    - It utilizes sets to maintain the connected parts of the maze and deconstructs walls between every pair of unlinked sets until all sets are connected.\n\n\n### 🕵️ Path-Finding Algorithms\n* **Dijkstra:** This algorithm ensures the shortest path and supports weighted graphs.\n    - It works by expanding outward from the starting node,\n    visiting nodes closer to the start first while taking into account the additional cost imposed by the weighted cells.\n    - It uses the Priority Queue Data Structure.\n* **A\\* (A-star):** This graph search algorithm ensures the shortest path and supports weighted graphs.\n    - It combines aspects of Dijkstra's algorithm and heuristics to find the shortest path between two nodes in a graph.\n    - It prioritizes the nodes that are estimated to be closer to the goal based on a heuristic  function (Manhattan distance). \\\n    By intelligently guiding the search towards the goal, It can often find the optimal path more quickly than Dijkstra's algorithm, especially in large graphs.\n    - It uses the Priority Queue Data Structure.\n* **Breadth first search (BFS):** This algorithm ensures the shortest path but does not support weighted graphs.\n    - It searches by expanding outward from the starting node,\n    visiting nodes closer to the start first.\n    - It uses the Queue Data Structure (first in, first out).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohamed-souiyeh%2Fdaedalus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohamed-souiyeh%2Fdaedalus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohamed-souiyeh%2Fdaedalus/lists"}