SearchinAI Lec3 4
SearchinAI Lec3 4
Problem formulation in AI
Problem formulation in AI refers to the process of defining a real-world problem in
such a way that it can be solved by an AI system using algorithms and techniques like
search, reasoning, or optimization. It involves identifying key components of the
problem, such as the initial state, goal state, possible actions, and constraints.
Effective problem formulation is crucial because it transforms an abstract or vague
issue into a structured form that AI techniques can handle.
Components of Problem Formulation in AI:
Initial State:
1. The state from which the agent starts or the starting point of the problem.
2. It represents the situation or configuration at the beginning.
3. Example: In a pathfinding problem, the initial state is the starting location.
Goal State:
1. The desired state or outcome the agent is trying to reach.
2. The goal state represents the solution to the problem.
3. Example: In a puzzle-solving problem, the goal is to reach the solved configuration.
State Space:
1. A collection of all possible states that the problem can be in, from the initial state to
the goal state.
2. It defines the scope of the problem and can be finite or infinite depending on the
complexity.
3. Example: In chess, the state space is all possible board configurations that can occur
during a game.
Actions:
1. The possible moves or transitions that the agent can take to go from one state to
another.
2. Actions depend on the current state and define the steps the agent can perform to
progress toward the goal.
3. Example: In a robot navigation problem, actions could be moving forward, turning
left, or turning right.
Transition Model:
1. A description of how the agent's actions cause changes in the state.
2. The transition model defines the relationship between the current state, the action
taken, and the resulting state.
3. Example: In a game, moving a piece changes the game state based on predefined
rules.
Path Cost:
1. A numeric value that represents the cost of moving from one state to another.
2. Path cost is used to evaluate the efficiency of a solution, with lower-cost paths being
more desirable.
3. Example: In a GPS routing system, the cost could be the distance traveled, time
taken, or fuel consumed.
Solution:
1. A solution to a problem is a sequence of actions (or a path) that leads from the
initial state to the goal state.
2. It should meet the criteria defined by the problem and be optimal or satisfactory
based on the problem's constraints.
Constraints:
1. Rules or limitations that restrict the available actions or the form of the solution.
2. Constraints can include things like time limits, resource availability, or specific rules
that must be followed.
3. Example: In a scheduling problem, a constraint might be that a particular task
cannot start until another task is finished.
Example of Problem Formulation:
Consider a simple pathfinding problem where an AI agent (like a robot or
navigation system) must find the shortest path from point A to point B on a grid.
1. Initial State: The agent starts at point A (e.g., a specific grid location).
2. Goal State: The agent needs to reach point B (another grid location).
3. State Space: All possible positions on the grid that the agent could occupy.
4. Actions: Move up, down, left, or right on the grid.
5. Transition Model: Moving in one direction takes the agent from one grid cell to another.
6. Path Cost: Each movement could have an associated cost (e.g., moving to a cell might cost 1,
or certain cells might have a higher cost due to obstacles).
7. Constraints: The agent cannot move through obstacles, and it might need to find the
shortest or least costly path.
Importance of Problem Formulation:
1. Efficient Solutions: A well-defined problem allows AI systems to apply search algorithms and
optimization techniques effectively, leading to efficient solutions.
2. Correctness: A clear problem formulation ensures that the AI agent correctly understands
the objective and solves the problem in the right way.
3. Scalability: Proper problem formulation helps AI systems scale to handle larger or more
complex versions of the problem.
4. Search Space Reduction: By precisely defining the problem, unnecessary or irrelevant states
and actions can be excluded, reducing the complexity of the search space.
Common Types of Problems in AI:
Search Problems:
1. Problems where the agent needs to find a sequence of actions that lead from the
initial state to the goal state.
2. Example: Pathfinding, game playing.
Constraint Satisfaction Problems (CSPs):
1. Problems where the solution must satisfy a set of constraints or rules.
2. Example: Sudoku puzzles, scheduling tasks.
Optimization Problems:
1. Problems where the goal is to find the best solution, often in terms of minimizing or
maximizing some criteria.
2. Example: Traveling Salesman Problem (TSP), where the goal is to minimize the
distance traveled.
Planning Problems:
1. Problems where the agent must create a plan or strategy to achieve its goal, taking
into account future states and consequences.
2. Example: Task scheduling, robot motion planning.
Summary:
Problem formulation is a critical step in AI that involves defining the components of a
problem — including initial state, goal state, actions, state space, and constraints — in
a way that allows AI techniques to solve it effectively. A good problem formulation
leads to efficient, scalable, and accurate solutions by focusing the AI agent's search
and reasoning processes on the relevant parts of the problem.