AI_Unit_2
Block world (1)
The Block World problem in Artificial Intelligence (AI) is a classic example used to illustrate
various AI techniques, especially planning, problem-solving, and search algorithms.
In the block world, a robot manipulates blocks in a simple environment, and the goal is to move
these blocks from an initial configuration to a desired goal configuration.
• Components of the Block World Problem:
1. Blocks: Typically, you have a finite set of blocks, often labeled (e.g., A, B, C).
2. Table: A surface where blocks are placed.
3. Robot Arm: A virtual agent capable of picking up one block at a time and moving it.
4. Stacking Rules: Blocks can be stacked on each other or placed on the table, but only one
block can be moved at a time, and only the top block of a stack can be picked up.
Problem Setup
• Initial State: This is the starting arrangement of blocks.
• Goal State: This is the desired final arrangement of the blocks.
• Actions: The robot can perform specific actions like:
- Pick-up(block): Pick up a block from the table or another block.
- Put-down(block): Place the block on the table.
- Stack(block1, block2): Place block1 on top of block2.
- Unstack(block1, block2): Remove block1 from on top of block2.
Block world (2)
A heuristic function, denoted as h(n), provides an estimate of the cost from a node n to the goal
node.
1. Negative Heuristics for Initial Position:
, a. A negative heuristic value (e.g., -1, -2, -3) is often used to represent distance
from the goal when we are starting from the initial state. As you get closer to the
goal state, the heuristic value increases.
b. It shows how "bad" the initial position is compared to the goal state. A lower
(more negative) value means you're farther from the goal.
2. Positive Heuristics for Final Position:
a. A positive heuristic value (e.g., 1, 2, 3) often represents progress toward the goal.
As you move closer to the goal, the heuristic value becomes less positive or
reaches 0.
b. At the goal state, the heuristic is typically 0 or a positive value indicating that the
solution has been found, or that no more cost is needed to reach the goal.
• AI techniques like search algorithms and planning can be used to solve the Block World
problem.
• Search Algorithms: BFS, DFS, or A* (find the optimal path from the initial state to the
goal state).
• Planning Algorithms: Used to automatically determine the sequence of actions needed
to reach the goal.
• One such algorithm is STRIPS (Stanford Research Institute Problem Solver), which
models actions, states, and goals in terms of logical predicates and operators.
STRIPS (Stanford Research Institute Problem Solver)
, Implementation using Goal Stack
• Goal stack: Technique used to decompose a complex problem into smaller sub-goals,
which can be solved step by step to reach the main goal. The goal stack stores the