{"id":21050665,"url":"https://github.com/adolbyb/ai-search-methods","last_synced_at":"2026-05-20T06:32:27.557Z","repository":{"id":156942220,"uuid":"581699562","full_name":"ADolbyB/ai-search-methods","owner":"ADolbyB","description":"AI Search methods from CAP 4630: Intro to AI","archived":false,"fork":false,"pushed_at":"2023-03-13T04:38:15.000Z","size":518,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T18:34:49.507Z","etag":null,"topics":["a-star-algorithm","agent","ai","ai-search","ai-search-algorithms","alpha-beta-pruning","bfs-algorithm","dfs-algorithm","gbfs-algorithm","hill-climbing","jupyter-notebook","local-search-algorithm","minimax-algorithm","reinforcement-learning","simulated-annealing-algorithm","ucs-algorithm"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/ADolbyB.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":"2022-12-24T01:56:54.000Z","updated_at":"2024-07-22T19:35:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"244684f6-2d74-4e6b-a951-8d9a797bc261","html_url":"https://github.com/ADolbyB/ai-search-methods","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ADolbyB%2Fai-search-methods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ADolbyB%2Fai-search-methods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ADolbyB%2Fai-search-methods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ADolbyB%2Fai-search-methods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ADolbyB","download_url":"https://codeload.github.com/ADolbyB/ai-search-methods/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243495495,"owners_count":20299923,"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":["a-star-algorithm","agent","ai","ai-search","ai-search-algorithms","alpha-beta-pruning","bfs-algorithm","dfs-algorithm","gbfs-algorithm","hill-climbing","jupyter-notebook","local-search-algorithm","minimax-algorithm","reinforcement-learning","simulated-annealing-algorithm","ucs-algorithm"],"created_at":"2024-11-19T15:46:50.685Z","updated_at":"2026-05-20T06:32:27.549Z","avatar_url":"https://github.com/ADolbyB.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=center\u003e\n\n# Artificial Intelligence Search Methods\n\n[![License](https://img.shields.io/github/license/ADolbyB/ai-search-methods?label=License\u0026style=for-the-badge)](https://github.com/ADolbyB/ai-search-methods/blob/main/LICENSE.md)\n[![Python](https://img.shields.io/badge/Python-3776AB?style=for-the-badge\u0026logo=python\u0026logoColor=white)](https://www.python.org/)\n[![Jupyter](https://img.shields.io/badge/Jupyter-F37626?style=for-the-badge\u0026logo=jupyter\u0026logoColor=white)](https://jupyter.org/)\n[![Repo Size](https://img.shields.io/github/repo-size/ADolbyB/ai-search-methods?label=Repo%20Size\u0026logo=Github\u0026style=for-the-badge)](https://github.com/ADolbyB/deep-learning-python)\n\n\u003c/div\u003e\n\nA collection of fundamental AI search algorithm implementations from an **Artificial Intelligence Applications** class. All implementations are written in Python using Jupyter Notebooks, covering the four major families of classical AI search: blind search, informed search, local search, and adversarial minimax search.\n\n## Repository Structure\n\n```\nai-search-methods/\n├── BlindSearch/        # BFS and DFS implementations\n├── InformedSearch/     # Uniform Cost Search, Greedy Best First, and A* implementations\n├── LocalSearch/        # Hill Climbing and Simulated Annealing implementations\n├── Minimax/            # Standard Minimax and Alpha-Beta Pruning implementations\n├── .gitignore\n└── README.md           # This file\n```\n\n## Search Methods Overview\n\n### 1. Blind Search\n\nLocated in [`BlindSearch/`](BlindSearch/)\n\nUninformed search strategies that explore the state space without any problem-specific knowledge about the goal.\n\n| Algorithm | Description |\n|-----------|-------------|\n| **BFS** — Breadth First Search | Explores all nodes at the current depth before moving deeper. Guarantees the shortest path in unweighted graphs. |\n| **DFS** — Depth First Search | Explores as far as possible along each branch before backtracking. Memory-efficient but does not guarantee shortest path. |\n\n### 2. Informed Search\n\nLocated in [`InformedSearch/`](InformedSearch/)\n\nHeuristic-guided search strategies that use problem-specific knowledge to find solutions more efficiently.\n\nCode adapted from [this GitHub Gist](https://gist.github.com/Nicholas-Swift/003e1932ef2804bebef2710527008f44).\n\n| Algorithm | Description |\n|-----------|-------------|\n| **UCS** — Uniform Cost Search | Expands the lowest-cost node first. `f(N) = g(N)` Optimal for weighted graphs with non-negative edge costs. |\n| **GBF** — Greedy Best First Search | Uses a heuristic `f(N) = h(N)` to always expand the node that appears closest to the goal. Fast but not guaranteed to be optimal. |\n| **A\\*** — A-Star Search | Combines path cost and heuristic estimate (`f(n) = g(n) + h(n)`). Optimal and complete when using an admissible heuristic. |\n\n### 3. Local Search\n\nLocated in [`LocalSearch/`](LocalSearch/)\n\nOptimization-based search strategies that operate on a single current state and move to neighboring states, without tracking full search paths.\n\nCode adapted from [this GitHub Repo](https://github.com/TranDatDT/n-queens-simulated-annealing/blob/master/main.py).\n\n| Algorithm | Description |\n|-----------|-------------|\n| **HC** — Hill Climbing | Iteratively moves to the best neighboring state. Efficient but can get stuck in local optima. |\n| **SA** — Simulated Annealing | Probabilistically accepts worse states early on (based on a \"temperature\" schedule) to escape local optima. Modeled after the metallurgical annealing process. |\n\n### 4. Minimax\n\nLocated in [`Minimax/`](Minimax/)\n\nAdversarial search strategies for two-player, zero-sum games. Assumes both players play optimally.\n\nCode adapted from [this web page](https://stackabuse.com/minimax-and-alpha-beta-pruning-in-python/).\n\n| Algorithm | Description |\n|-----------|-------------|\n| **Minimax** | Recursively evaluates all possible game states, maximizing the AI's score and minimizing the opponent's score. |\n| **Alpha-Beta Pruning** | An optimization of Minimax that prunes branches that cannot influence the final decision, significantly reducing the number of nodes evaluated. |\n\n## Algorithm Comparison\n\n| Algorithm | Complete? | Optimal? | Time Complexity | Space Complexity | Notes |\n|-----------|-----------|----------|-----------------|------------------|-------|\n| BFS | ✅ Yes | ✅ Yes (unweighted) | O(b^d) | O(b^d) | Best for shallow goals |\n| DFS | ✅ Yes* | ❌ No | O(b^m) | O(bm) | *In finite spaces only |\n| UCS | ✅ Yes | ✅ Yes | O(b^(1+⌊C*/ε⌋)) | O(b^(1+⌊C*/ε⌋)) | Optimal with non-neg costs |\n| GBF | ❌ No | ❌ No | O(b^m) | O(b^m) | Fast but not optimal |\n| A* | ✅ Yes | ✅ Yes | O(b^d) | O(b^d) | Best of both UCS \u0026 GBF |\n| Hill Climbing | ❌ No | ❌ No | O(∞) | O(1) | Prone to local optima |\n| Simulated Annealing | ✅ Yes* | ❌ No | O(∞) | O(1) | *With slow cooling schedule |\n| Minimax | ✅ Yes | ✅ Yes | O(b^m) | O(bm) | Full game tree |\n| Alpha-Beta | ✅ Yes | ✅ Yes | O(b^(m/2)) | O(bm) | ~Doubles search depth |\n\n*b = branching factor, d = depth of shallowest goal, m = maximum depth, C* = optimal cost, ε = minimum edge cost*\n\n## Key Concepts\n\n- **State Space**: The set of all possible states reachable from the initial state via actions.\n- **Heuristic Function h(n)**: An estimate of the cost from node `n` to the goal. Must be **admissible** (never overestimates) for A* to be optimal.\n- **Admissibility**: A heuristic is admissible if `h(n) ≤ h*(n)` for all `n`, where `h*(n)` is the true cost to the goal.\n- **Consistency (Monotonicity)**: A heuristic is consistent if `h(n) ≤ c(n, a, n') + h(n')` for every successor `n'`. Consistency implies admissibility.\n- **Zero-Sum Game**: A game in which one player's gain is exactly the other player's loss — the foundation of Minimax.\n\n## Requirements\n\n- Python 3.7 or higher\n- Jupyter Notebook or JupyterLab\n\n### Setup\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/ADolbyB/ai-search-methods.git\ncd ai-search-methods\n```\n\n2. Install dependencies:\n```bash\npip install notebook\n```\n\n3. Launch Jupyter Notebook:\n```bash\njupyter notebook\n```\n\n4. Navigate to the desired folder and open the `.ipynb` file.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](https://github.com/ADolbyB/ai-search-methods/blob/main/LICENSE.md) file for details.\n\n## Acknowledgments\n\n- [Nicholas Swift's A* GitHub Gist](https://gist.github.com/Nicholas-Swift/003e1932ef2804bebef2710527008f44) — Informed Search base code\n- [TranDatDT's N-Queens Simulated Annealing Repo](https://github.com/TranDatDT/n-queens-simulated-annealing/blob/master/main.py) — Local Search base code\n- [Stack Abuse: Minimax and Alpha-Beta Pruning in Python](https://stackabuse.com/minimax-and-alpha-beta-pruning-in-python/) — Minimax base code\n- *Artificial Intelligence: A Modern Approach* by Russell \u0026 Norvig — the canonical AI textbook these algorithms are drawn from\n\n---\n\n### Topics\n\n`ai` `python` `jupyter-notebook` `ai-search` `ai-search-algorithms` `bfs-algorithm` `dfs-algorithm` `ucs-algorithm` `gbfs-algorithm` `a-star-algorithm` `hill-climbing` `simulated-annealing-algorithm` `minimax-algorithm` `alpha-beta-pruning` `local-search-algorithm` `agent` `reinforcement-learning`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadolbyb%2Fai-search-methods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadolbyb%2Fai-search-methods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadolbyb%2Fai-search-methods/lists"}