For vacuum cleaner world: your agent is a vacuum cleaner robot, which is responsible for cleaning 4 rooms (A, B, C, and D). Each state is represented by the agent’s location and the dirt status at this location. The goal state is achieved when all rooms are clean. You are required to do the following tasks:

  1. Create the state space for all possible states.

    1. Comment on the state space type if it is cyclic or acyclic.
  2. Consider the initial state is the corresponding figure a state (C’). Build a search tree with at least depth of 3 levels.

    1. Comment on expected depth of complete tree.

Pasted image 20260406184304.png

Sol:

1. State Space

Based strictly on the rule ("Each state is represented by the agent’s location and the dirt status at this location"), the state space is defined by 8 distinct simplified states.

Let a letter represent a clean room and a prime (') represent a dirty room:

(Note: While these 8 codes represent the agent's immediate local state, the environment must implicitly track the dirt in all four rooms behind the scenes to know when the "all rooms are clean" goal is achieved. A fully observable global state space would contain 4×24=64 states, every combination of "Cleanness", for each of the 4 rooms).

State Space Type:

The state space is Cyclic. The agent can move back and forth between rooms indefinitely without performing a "Suck" action (e.g., moving CACA), creating infinite loops in a search tree if visited states are not tracked.


2. Search Tree (Depth of 3 Levels)

Environment Layout:

Initial State: C' (Agent in C, C is dirty. Uncleaned rooms: A, C, D)

Here is the search tree expanded to 3 levels. To make the tree accurate to the goal, I have tracked the hidden global dirt states to determine what code the agent encounters when moving.

Pasted image 20260406190737.png


Comment on the Expected Depth of the Complete Tree