</>
ShikshaCSLearn. Code. Grow.
🔍
☕ Support Us
ShikshaCSâ€ēNotesâ€ēArtificial Intelligence
Artificial Intelligence
🕒 8 min read

Search Algorithms in AI

How AI agents explore possibilities to find a solution.

Why Search Matters in AI

Many AI problems — like solving a puzzle, finding a path, or playing a game — can be framed as searching through a space of possible states to reach a goal state.

Uninformed Search

Breadth-First Search (BFS) explores all neighbors before going deeper — guarantees the shortest path in unweighted graphs. Depth-First Search (DFS) explores as far as possible along one branch before backtracking — uses less memory but doesn't guarantee the shortest path.

Informed Search

Algorithms like A* use a heuristic (an estimate of distance to the goal) to search more efficiently than uninformed methods, balancing the actual cost so far with the estimated cost remaining.

🌍 Real-World Use

Google Maps uses an A*-like search algorithm to find the fastest route, using a heuristic (straight-line distance to destination) combined with real road distances/traffic to avoid exploring every possible road.

💡 Pro Tip

When explaining A* in an interview, emphasize that it's 'informed' because of the heuristic — this single word (heuristic) is usually what distinguishes a strong answer from a basic one.

đŸ§Ē Quick Self-Test

Check what you just learned — no pressure, just practice.

1. Which search guarantees the shortest path in an unweighted graph?

2. What does A* search use to guide its search efficiently?

← Back to all Notes