Welcome to the Search Algorithms in Python repository! This project contains various implementations of fundamental search algorithms, including Depth-First Search (DFS), Breadth-First Search (BFS), Uniform Cost Search (UCS), and Best First Search, all written in clean, simple Python without any external libraries.
This is useful to all those taking Introduction To Artificial Intelligence at UTS.
LinkedIn Article: LinkedIn Article Explaining Each Search Algorithm In Theory
Search algorithms are a fundamental aspect of computer science, playing a critical role in problem-solving across various domains. This repository offers a hands-on exploration of these algorithms, providing both theoretical insights and practical Python implementations.
DFS is a search algorithm that explores a graph by starting at the root node and exploring as far as possible along each branch before backtracking.
- Use Cases: Solving mazes, puzzle games, topological sorting.
- Time Complexity: O(V + E)
- Space Complexity: O(V)
BFS is a search algorithm that explores all the nodes at the present depth level before moving on to the nodes at the next depth level.
- Use Cases: Finding the shortest path in unweighted graphs, web crawlers, social networking searches.
- Time Complexity: O(V + E)
- Space Complexity: O(V)
UCS is an extension of BFS that considers the cost of the path, making it suitable for finding the lowest-cost path.
- Use Cases: Route planning, AI decision-making, robotics navigation.
- Time Complexity: O(V + E)
- Space Complexity: O(V)
Best First Search uses a heuristic to determine the most promising path, balancing exploration and exploitation.
- Use Cases: AI pathfinding (e.g., A*), puzzle solving, game AI.
- Time Complexity: O(V + E)
- Space Complexity: O(V)
Contributions are welcome! Whether you're fixing bugs, improving documentation, or adding new features, feel free to submit a pull request.
This project is licensed under the MIT License