0% found this document useful (0 votes)
20 views10 pages

8-Puzzle Problem

The document discusses various search algorithms for solving the 8-puzzle problem, including Depth-First Search (DFS), Breadth-First Search (BFS), and the A* algorithm. It highlights the inefficiencies of DFS and BFS, and introduces the Branch and Bound (B&B) approach which prioritizes nodes based on a cost function combining actual moves and heuristic estimates. The A* algorithm is emphasized as an effective informed search method that uses both g-values and h-values to find optimal solutions efficiently.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views10 pages

8-Puzzle Problem

The document discusses various search algorithms for solving the 8-puzzle problem, including Depth-First Search (DFS), Breadth-First Search (BFS), and the A* algorithm. It highlights the inefficiencies of DFS and BFS, and introduces the Branch and Bound (B&B) approach which prioritizes nodes based on a cost function combining actual moves and heuristic estimates. The A* algorithm is emphasized as an effective informed search method that uses both g-values and h-values to find optimal solutions efficiently.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

8-Puzzle Problem

DFS (Explore the leftmost child node recursively until you reach a leaf node or a goal state)
• Depth-first search on state-space tree.

• Successive moves may take us away from the goal.

• Inefficient as it explores all paths equally.

BFS (Explore all neighboring nodes at the present depth.)

• Breadth-first search on the state-space tree.

• Always finds the nearest goal state.

• Same sequence of moves irrespective of initial state.


Using Branch and Bound
• DFS: Can get stuck exploring deep paths that do not lead to
the goal, potentially leading to excessive memory usage and
slow performance.
• BFS: Explores all nodes at the present depth before moving to
the next depth level, which can be inefficient as it does not
prioritize more promising paths.
• B&B: Instead of exploring nodes blindly (DFS) or equally (BFS),
B&B uses a cost function to prioritize nodes that are closer to
the goal, reducing unnecessary computations.
Cost Function
• The cost function balances the actual cost to reach the node and the
heuristic estimate to reach the goal. It combines two components:
• g(X): The number of moves taken to reach the current state from
the initial state.

• h(X): The number of misplaced tiles (tiles that are not in their goal
position).

• Cost Function Formula: C(X)=g(X)+h(X)


• Approach:

1.Use a priority queue to store live nodes.

2.Initialize the cost function for the root node.

3.Expand the node with the least cost.

4.If a goal state is reached, return the solution.

5.Continue expanding nodes until a goal state is found or the priority


queue is empty.
A* Algorithm:
• A* is an informed search algorithm that combines the cost to reach a
state (g-value) with a heuristic estimate of the cost to reach the goal
(h-value).
• It is widely used for solving problems like the 8-puzzle, as it finds
optimal solutions efficiently.
• A* relies on an admissible heuristic to guide the search.
The A* Algorithm:
• The A* algorithm is a widely used informed search algorithm that
combines g-values (the actual cost to reach a state) and h-values
(heuristic estimates of the cost to reach the goal) to find an optimal
solution. Here's how it works:
• Components of A:
• g-value: The g-value represents the actual cost to reach a particular state
from the initial state. It accumulates the costs of the path taken to that state.
• h-value: The h-value is the heuristic estimate of the cost to reach the goal
state from the current state. It provides an informed guess about the
remaining cost.
• Combining g and h in A:A evaluates states using the sum of their g
and h values, referred to as the f-value. The algorithm prioritizes
states with lower f-values because they are more likely to lead to an
optimal solution.

You might also like