Skip to content

Lab 4: State representation

Objective

  1. To represent the state of a vacuum world.

  2. To solve the vacuum world problem using breadth-first search.

Problem

The following image represents one of the possible states of a two-square vacuum world.

The aim of this section is to create a code to search for solution for the vacuum world given an initial state. Consider the actions left, right, suck, and every action contributes the same cost.

  1. How could we represent the state?

  2. Do we need to define the whole state space statically?

  3. How do we define the transition model? The transition model should be a function that takes the state and action as inputs and returns the result state.

Create the code to solve a vacuum world problem using the breadth-first search. Execute it and investigate if it's working correctly.