Wumpus World Problem in Artificial Intelligence (AI)

Table of Contents

What is Wumpus World in Artificial Intelligence

The Wumpus world problem in Artificial Intelligence (AI) is a cave consisting of rooms connected by passageways. The wumpus can be shot by an agent, but the agent has only one arrow. Some rooms contain bottomless pits that will trap anyone who wanders into these rooms (except for the wumpus, which is too big to fall in).

Here, we’ll dive deeper into key areas such as the PEAS framework, agent behaviors, and strategies that can enhance a conceptual understanding of this problem – useful for both students and professionals.

PEAS Framework, Agent Behavior and Strategies

A Deep Dive into the PEAS Framework of Wumpus World

The PEAS framework (Performance, Environment, Actuators, Sensors) is critical to understanding how an agent navigates the Wumpus World.

Let’s break down each component in more detail:

1. Performance Measure: +1000 for climbing out of the cave with the gold, -1000 for falling into a pit or being eaten by the wumpus, -1 for each action taken, and -10 for using up the arrow. The game ends either when the agent dies or when the agent climbs out of the cave.

2. Environment: A 4 x 4 grid of rooms, with walls surrounding the grid. The agent always starts in the square labeled [1,1], facing to the east. The locations of the gold and the wumpus are chosen randomly, with a uniform distribution, from the squares other than the start square.

3. Actuators: The agent can move Forward, Turn Left by 90°, or Turn Right by 90°. The agent dies if it enters a square containing a pit or a live wumpus. If an agent tries to move forward and hits the wall, then the agent does not move.

4. Sensors: The agent has five sensors, each of which gives a single bit of information:

  • In the squares directly (not diagonally) adjacent to the wumpus, the agent will perceive a Stench.
  • In the squares directly adjacent to a pit, the agent will perceive a Breeze.
  • In the square where the gold is, the agent will perceive a Glitter.
  • When an agent walks into a wall, it will perceive a Bump.
  • When the wumpus is killed, it emits a woeful Scream that can be perceived anywhere in the cave.

Using Logic and Reasoning for Improved Navigation

One advanced area is exploring how an agent makes decisions through logical rules. The agent uses percepts (such as breeze or smell) to make logical deductions and map the environment. Here’s an example scenario for added clarity:

Example: When the agent detects a “breeze” in a particular square, it deduces that a pit could be adjacent. Using additional percepts and logic, it narrows down potential moves that are safe, gradually mapping the environment for optimal navigation.

Note: The Concepts are thoroughly demonstrated below check section Exploring the Wumpus World.

Scenario-Based Examples for a Practical Perspective

The demonstration and the logics used to figure out how the agent will reach the “gold“. 

Concepts Explained on how to achieve the same:

  • Encountering the Wumpus: The possible actions and consequences if the agent decides to shoot, based on proximity and perception.
  • Handling Pits: Demonstrating how an agent recognizes and avoids pits through perceptual input from adjacent squares.

Description of Wumpus World

Here are the primary elements of the Wumpus World:

  1. Agent: The player or explorer moving through the grid.
  2. Wumpus: A deadly beast that resides in one of the rooms. If the agent enters the room with the Wumpus, the game ends.
  3. Pits: Bottomless pits that also occupy some rooms. Entering a room with a pit results in the agent’s death.
  4. Gold: The objective of the game. It is hidden in one of the rooms and must be retrieved and brought back to the starting point.
  5. Breezes: Felt in rooms adjacent to pits. These serve as a warning to the agent that a pit is nearby.
  6. Stench: Perceived in rooms adjacent to the Wumpus, warning the agent of its proximity.
Wumpus World Problem in Artificial Intelligence

Exploring Wumpus World problem in Artificial Intelligence

We will now investigate the Wumpus world problem in artificial intelligence (AI) and use logic to figure out how the agent will arrive at its objective.

Here the agent will start from the bottom left corner square which is marked as [1,1] and later explore the 4×4 matrix which is explained below with the four stages with diagrams for better understanding.

Agent First step:

Since we already know that the agent is safe in the first room, or on the square [1,1], we will add the symbol OK to the diagram (a) below to indicate that the agent is in a safe room. Agent is represented by symbol A, breeze by symbol B, glitter or gold by symbol G, visited room by symbol V, pits by symbol P, and wumpus by symbol W.

Agent in Room [1,1] does not sense any breeze or slope, indicating that the nearby squares are also in good condition.

The first step taken by the agent in the Wumpus world.

Agent Second step:

Agent must now proceed; thus, it will either go to [1, 2] or [2,1]. Assume the agent enters the room [2, 1]. The agent notices a breeze in this room, indicating that Pit is nearby. To indicate that this is a Pit room, we will add the symbol P? since the pit can be in either [3, 1] or [2, 2].

The agent will now pause, reflect, and stay away from harmful activity. The agent is returning to the room [1, 1]. The agent visits the rooms [1,1] and [2,1], so we will use symbol V to indicate the squares that are visited.

Agent Third step:

The agent will now proceed to the room [1,2] in the third step, which is acceptable. Agent notices an unpleasant smell in the room [1,2], indicating that a Wumpus must be nearby. However, according to the game’s rules, Wumpus is not allowed to be in either [1,1] or [2,2] (the agent there reported not smelling anything). 
 
Agent concludes that Wumpus is in the room as a result [1,3], and since there isn’t any breeze right now [2,2], neither Pit nor Wumpus are present. Thus, the agent continues inside [2,2], and we will mark it as safe.
Two later stages in the progress of the agent.

Agent Fourth step:

Since there is no smell and no breeze in room [2,2], let’s assume that the agent chooses to relocate to [2,3]. When the agent notices glitter in rooms [2, 3], it should seize the gold and exit the cave.

Note that in each case for which the agent draws a conclusion from the available information, that conclusion is guaranteed to be correct if the available information is correct. This is a fundamental property of logical reasoning.

AI Concepts Demonstrated

The Wumpus World is particularly useful for teaching and testing several AI concepts:

  • Knowledge Representation: The agent must keep track of information about the environment and its hazards based on indirect clues.
  • Logical Reasoning: The agent uses logical deductions to infer the possible locations of hazards. For example, if a breeze is felt in a particular room, the agent can deduce that one of the adjacent rooms contains a pit.
  • Decision Making: Decisions must be made based on partial information and logical inferences, such as whether to risk entering a potentially dangerous room.
  • Planning: The agent needs to plan a safe route to the gold and back to the starting point.

Related Articles

Frequently Asked Questions (FAQ's)

The Wumpus world serves as a straightforward case study to highlight the value of a knowledge-based agent and to show knowledge representation.

The agent will be trapped in a bottomless pit in the Wumpus world indefinitely if he falls into one. The agent’s mission is to locate the arrow and dispatch the Wumpus without getting killed by it or falling into a pit.
Check the first image above 👆.

A well-known AI problem that illustrates a number of concepts, including planning, decision-making, and search algorithms, is The Wumpus World.

The Wumpus world is a 16-room (4 x 4) cave. Walkways connect each room to the others; no room is connected diagonally. Starting in Room[1, 1], the knowledge-based agent operates.