πŸŽ“ Computer Science & Engineering Portal

Master Engineering Disciplines with Structured Notes

Comprehensive academic lecture notes, exam-oriented unit summaries, laboratory manuals, and previous year question papers designed strictly for university students.

πŸ“‘

University Syllabi

AKTU & AICTE aligned semester guidelines.

πŸ“

Exam Question Papers

Previous 5 years solved university papers.

πŸ’‘

Lab Manuals & Viva

Practical codes with outputs & interview Qs.

Core Subjects & Units Hub

Click on any specific unit to immediately view its lecture notes below

Viewing All Lectures

Uninformed Search Techniques

Uninformed Search Techniques

1. Introduction

Uninformed search strategies, also known as blind search, are techniques that explore the search space without using any heuristic knowledge about the problem.

  • They only use the problem definition: initial state, operators, and goal test.

  • These algorithms may not be efficient, but they form the foundation of AI problem-solving.


2. Example Graph (Common for All Strategies)

We will use this search graph to explain each strategy:

        (S)
       /   \
     (A)   (B)
    /   \     \
  (C)   (D)   (G)
         |
        (E)
  • Start Node (S)

  • Goal Node (G)


3. Types of Uninformed Search

3.1 Breadth-First Search (BFS)

  • Approach: Explores all nodes at the current depth before going deeper.

  • Data Structure: Queue (FIFO).

  • Properties:

    • Complete: βœ… Yes

    • Optimal: βœ… Yes (if step costs are equal)

Process on Graph:

  1. Start at S β†’ Expand β†’ {A, B}

  2. Next level β†’ Expand A β†’ {C, D}

  3. Expand B β†’ {G} βœ… Goal found.

Solution Path: S β†’ B β†’ G
Characteristic: Finds the shortest path in steps.


3.2 Depth-First Search (DFS)

  • Approach: Explores as deep as possible before backtracking.

  • Data Structure: Stack (LIFO) or recursion.

  • Properties:

    • Complete: ❌ No (may get stuck in infinite path)

    • Optimal: ❌ No

Process on Graph:

  1. Start at S β†’ Go to A β†’ C (dead end).

  2. Backtrack β†’ A β†’ D β†’ E (dead end).

  3. Backtrack β†’ S β†’ B β†’ G βœ… Goal found.

Solution Path: S β†’ B β†’ G
Characteristic: May not give shortest path, but memory-efficient.


3.3 Depth-Limited Search (DLS)

  • Approach: DFS but limited to depth = L.

  • Properties:

    • Complete: βœ… Yes (if depth of goal ≀ L)

    • Optimal: ❌ No

Process on Graph:

  • If L = 2 β†’ S β†’ A β†’ C, D and S β†’ B β†’ stops (cannot reach G). ❌ Failure.

  • If L = 3 β†’ can expand deeper and reach G βœ….

Characteristic: Works only when approximate depth of solution is known.


3.4 Iterative Deepening DFS (IDDFS)

  • Approach: Runs DFS repeatedly with increasing depth limits.

  • Properties:

    • Complete: βœ… Yes

    • Optimal: βœ… Yes (for uniform step cost)

Process on Graph:

  • Depth 0 β†’ {S} (No goal).

  • Depth 1 β†’ {S, A, B} (No goal).

  • Depth 2 β†’ {S, A, B, C, D, G} βœ… Goal found.

Solution Path: S β†’ B β†’ G
Characteristic: Combines BFS optimality with DFS memory efficiency.


3.5 Uniform Cost Search (UCS)

  • Approach: Expands the node with lowest cumulative path cost.

  • Data Structure: Priority Queue.

  • Properties:

    • Complete: βœ… Yes (if step costs > 0)

    • Optimal: βœ… Yes

Assume Edge Costs:

  • S β†’ A = 2

  • S β†’ B = 5

  • A β†’ C = 4

  • A β†’ D = 6

  • B β†’ G = 2

Process on Graph:

  1. Start at S β†’ Insert {A(2), B(5)}.

  2. Expand A first β†’ {C(6), D(8)}.

  3. Next expand B(5) β†’ {G(7)} βœ… Goal found.

Solution Path: S β†’ B β†’ G (Cost = 7).
Characteristic: Finds least-cost solution, not just shortest path.


4. Comparison of Strategies

Strategy Data Structure Complete? Optimal? Example Path Found
BFS Queue (FIFO) Yes Yes (equal costs) S β†’ B β†’ G
DFS Stack (LIFO) No No S β†’ B β†’ G (after exploring deep)
DLS Stack + Limit Yes (if L β‰₯ depth) No Fails if L < goal depth
IDDFS Stack (iterative) Yes Yes S β†’ B β†’ G
UCS Priority Queue Yes Yes S β†’ B β†’ G (least cost)

5. Summary

  • BFS β†’ Level-order, finds shortest path.

  • DFS β†’ Deep search, not guaranteed shortest.

  • DLS β†’ DFS with cutoff depth.

  • IDDFS β†’ Hybrid of BFS + DFS.

  • UCS β†’ Expands least-cost path, always optimal.

Uninformed strategies are the foundation of AI problem-solving and prepare the ground for more advanced informed (heuristic) search methods.



Labels:

Searching for Solutions

Searching for Solutions

1. Introduction

In Artificial Intelligence (AI), most problems can be expressed as a search problem. Searching for solutions means systematically exploring possible states of a problem until we reach the goal state.

  • Example:

    • Solving a maze β†’ start point to exit point.

    • Playing chess β†’ finding the best sequence of moves.

    • Route planning in Google Maps β†’ finding the shortest/fastest path.

Thus, searching for solutions is the process of navigating through a problem space to discover the correct path to the goal.


2. Problem Formulation for Searching

To search for a solution, a problem must be formally defined with the following components:

  1. Initial State β†’ The starting point of the problem.

  2. State Space β†’ All possible states reachable from the initial state.

  3. Actions/Operators β†’ Possible moves from one state to another.

  4. Transition Model β†’ Defines how actions change the current state.

  5. Goal Test β†’ A check to determine whether the goal state has been reached.

  6. Path Cost β†’ A numeric value (cost, distance, time) associated with a solution path.


3. Searching Process

The general process of searching for solutions involves:

  1. Represent the Problem β†’ Convert into a state space representation.

  2. Expand Nodes β†’ Generate successors of the current state.

  3. Choose Search Strategy β†’ Decide which node to explore next.

  4. Apply Goal Test β†’ Stop when the goal state is found.

  5. Construct Solution Path β†’ Trace back from the goal to initial state.


4. Types of Search Strategies

A) Uninformed (Blind) Search

  • Does not use additional knowledge beyond the problem definition.

  • Examples:

    • Breadth-First Search (BFS): Explores level by level, guarantees shortest path.

    • Depth-First Search (DFS): Explores deeply before backtracking.

    • Uniform Cost Search (UCS): Expands least-cost node first.

B) Informed (Heuristic) Search

  • Uses heuristics (extra knowledge) to guide the search more efficiently.

  • Examples:

    • Greedy Best-First Search: Chooses node with lowest heuristic value.

    • A* Search: Combines path cost + heuristic (optimal and efficient).


5. Example: Searching in a Maze

  • Initial State: Start point of maze.

  • Goal State: Exit point.

  • Operators: Move up, down, left, right.

  • Solution: Sequence of moves to reach exit.

  • Search Method:

    • BFS β†’ Finds shortest path.

    • DFS β†’ May get stuck in dead ends.

    • A* β†’ Fastest + optimal solution using distance heuristic.


6. Evaluation of Search Strategies

When searching for solutions, algorithms are compared based on:

  • Completeness: Will it always find a solution if one exists?

  • Optimality: Will it find the best solution?

  • Time Complexity: How fast is the search?

  • Space Complexity: How much memory is needed?


7. Summary

  • Searching for solutions is the core of AI problem solving.

  • It involves state space exploration using systematic search strategies.

  • Two major categories: Uninformed search (blind) and Informed search (heuristic-based).

  • The choice of search strategy affects efficiency, optimality, and memory usage.



Labels:

Searching Introduction & Problem Solving by Searching

Searching Techniques: Introduction & Problem Solving by Searching

1. Introduction to Searching Techniques

In Artificial Intelligence (AI), searching is one of the most fundamental techniques used for problem solving. A problem in AI is often represented as a state space (a collection of possible states) and the task is to find a path from the initial state to the goal state.

Since computers do not have human-like intuition, they rely on systematic search strategies to explore possible solutions. Searching can be thought of as the process of navigating through a search tree or graph until the solution (goal) is found.

  • State space β†’ The set of all possible states where the problem can exist.

  • Initial state β†’ The starting point of the problem.

  • Goal state β†’ The desired solution or target state.

  • Operators β†’ Actions that move from one state to another.

  • Search strategy β†’ The method for choosing which state to explore next.


2. Problem Solving by Searching

The process of solving problems by searching generally follows these steps:

Step 1: Problem Formulation

  • Identify the initial state, possible actions (operators), transition model (how states change), and the goal state.

  • Example: In the 8-puzzle problem, the board configuration is the state, moving tiles is the action, and the goal is arranging tiles in order.

Step 2: Search Space Representation

  • Represent all possible states and their transitions in a state space tree/graph.

  • Nodes = States

  • Edges = Actions

Step 3: Search Algorithm Selection

  • Apply a search strategy to explore nodes in the state space.

  • Search strategies are broadly divided into:

    1. Uninformed (Blind) Search – No extra knowledge beyond problem definition. Examples: Breadth-First Search (BFS), Depth-First Search (DFS), Uniform Cost Search.

    2. Informed (Heuristic) Search – Uses heuristics (problem-specific knowledge) to guide search. Examples: Best-First Search, A* Search, Greedy Search.

Step 4: Exploration and Expansion

  • Expand nodes (apply operators) and generate new states.

  • Keep track of explored states to avoid repetition (closed list).

Step 5: Goal Test

  • At each step, check if the current node satisfies the goal condition.

  • If yes β†’ return the solution path.

Step 6: Solution Representation

  • The solution is represented as the sequence of actions from initial state to goal state.

  • Example: Path in a maze, sequence of moves in chess, or route in GPS navigation.


3. Example of Problem Solving by Searching

Example: Pathfinding in a Maze

  • Initial state: Entry point of the maze.

  • Goal state: Exit point.

  • Operators: Move up, down, left, right.

  • Search Algorithm:

    • BFS β†’ Finds shortest path (level-wise exploration).

    • DFS β†’ Explores deeply but may not find shortest path.

    • A Search* β†’ Uses heuristic (distance to goal) to find optimal path efficiently.


4. Key Characteristics of Search Strategies

When comparing search techniques, consider:

  • Completeness β†’ Will it always find a solution if one exists?

  • Optimality β†’ Will it find the best (shortest/least-cost) solution?

  • Time Complexity β†’ How much time does it take? (depends on branching factor b and depth d).

  • Space Complexity β†’ How much memory is needed?


βœ… Summary:
Searching is the backbone of AI problem solving. It involves representing problems as state spaces, systematically exploring states using search strategies, and applying goal tests to find solutions. Different algorithms (uninformed vs informed) provide trade-offs between time, space, and optimality.



Labels: