PROJECTENGRAM

STATE-BASED MODELS

State-Based Models

Tags: #◇Computer Science #◇CSINTSY #◇Search Algorithms #◇Problem Solving #◇M2


◇Overview

This document explores State-Based Models in Artificial Intelligence, focusing on how to formulate and solve complex problems by modeling them as a set of states connected by actions. It details the process of search problem formulation (defining states, actions, and costs) and evaluates various Tree Search Algorithms—such as Backtracking, Depth-First Search (DFS), Breadth-First Search (BFS), and Depth-First Search with Iterative Deepening (DFS-ID)—based on their completeness, optimality, and time/space complexity.

◇Important Formulas & Key Definitions

Mathematical/Programming Formulation

A search problem can be formally defined by the following five components: sstarts_{start}: The initial or start state. Actions(s)Actions(s): The set of valid actions that can be executed from state ss. Cost(s,a)Cost(s, a): The penalty or cost associated with performing action aa from state ss. Succ(s,a)Succ(s, a): The resulting next state after performing action aa from state ss. IsEnd(s)IsEnd(s): A boolean function returning true if ss is a goal state, and false otherwise.

Evaluation Metrics for Search Algorithms Completeness: Does the algorithm always find a solution if one exists? Optimality: Does it always return the solution with the least total cost? Time Complexity: The maximum number of states explored before returning a solution (worst-case). Space Complexity: The maximum number of states stored in memory at any given time (worst-case).

◇Theoretical Framework: Tree Search Algorithms

The table below summarizes the theoretical characteristics of various tree search algorithms, where bb is the branching factor, DD is the maximum depth of the state space, and dd is the depth of the optimal solution.

AlgorithmOptimal when action costs are...Time ComplexitySpace ComplexityCompleteness
Backtracking SearchAnyO(bD)O(b^D)O(D)O(D)Yes (if finite)
Depth-First Search (DFS)All 00 (irrelevant)O(bD)O(b^D)O(D)O(D)Yes (if finite)
Breadth-First Search (BFS)Constant ≥0\ge 0O(bd)O(b^d)O(bd)O(b^d)Yes (even if infinite)
DFS-Iterative Deepening (DFS-ID)Constant ≥0\ge 0O(bd)O(b^d)O(d)O(d)Yes (even if infinite)

◇Worked Examples: Search Problem Formulation

1. Water Pouring Puzzle

Scenario: You have 3 glasses: A (8 ml, filled), B (5 ml, empty), C (3 ml, empty). Goal: Two glasses with exactly 4 ml. State: The amount of liquid in Glass A, Glass B, and Glass C. Actions: Pour one glass into another (valid if source is not empty and target is not full). Cost: All 0 (the objective is just to find a valid sequence of steps, not necessarily the cheapest).

2. Wolf, Goat, and Cabbage Puzzle

Scenario: A farmer needs to transport a wolf, goat, and cabbage across a river. Conditions: Raft holds farmer + 1 item. Wolf eats goat if left alone; goat eats cabbage if left alone. State: The current position (left or right bank) of the farmer, wolf, goat, and cabbage. Actions: Farmer crosses the river alone, OR farmer crosses taking exactly one item with him. Cost: All 0.

3. Transport Puzzle

Scenario: Travel from street 1 to street nn. Walking from ss to s+1s+1 takes 1 minute. A magic tram goes from ss to 2s2s in 2 minutes. Goal: minimize travel time. State: The current street number you are in (integer from 1 to nn). Actions: Walk OR take the tram. Cost: 11 for walking, 22 for taking the tram.

◇References & Navigation

CONFIRMATION // 理解度の確認

ACTIVE RECALL VERIFICATION

Select an answer to verify conceptual comprehension and reveal the technical rationale.

Q1

Which of the following correctly defines the IsEnd(s) function in search problem formulation?

Q2

In the context of evaluating search algorithms, what does "Completeness" refer to?

Q3

Under what condition is Depth-First Search (DFS) considered optimal according to the theoretical framework?

Q4

Which algorithm combines the completeness of Breadth-First Search (BFS) with the space efficiency of Depth-First Search (DFS)?

Q5

In the "Wolf, Goat, and Cabbage" puzzle formulation, what represents a "State"?