0% found this document useful (0 votes)
10 views35 pages

AI Unit 2

The document discusses problem-solving in artificial intelligence, emphasizing methods like state space search, which models problems as configurations and transitions. It outlines various search strategies, including uninformed and heuristic searches, and highlights the importance of algorithms like A* for efficient pathfinding. Additionally, it covers the complexities and steps involved in AI problem-solving, such as defining problems, data preparation, and model evaluation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views35 pages

AI Unit 2

The document discusses problem-solving in artificial intelligence, emphasizing methods like state space search, which models problems as configurations and transitions. It outlines various search strategies, including uninformed and heuristic searches, and highlights the importance of algorithms like A* for efficient pathfinding. Additionally, it covers the complexities and steps involved in AI problem-solving, such as defining problems, data preparation, and model evaluation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 35

Problem Solving in Artificial Intelligence

The process of problem-solving is frequently used to achieve


objectives or resolve particular situations.
In computer science, the term "problem-solving" refers to artificial
intelligence methods, which may include formulating ensuring
appropriate, using algorithms, and conducting root-cause analyses
that identify reasonable solutions.
A same issue has a number of solutions, that are all accomplished
using an unique algorithm.
Additionally, certain issues have original remedies. Everything
depends on how the particular situation is framed.
Problem solving is the act of defining a problem; determining the cause of the
problem; identifying, prioritizing, and selecting alternatives for a solution; and
implementing a solution.
State Space Search in AI

An essential method in artificial intelligence is state space search,


which looks for potential states and their transitions to solve issues.
According to this method, the problem is modeled as a state
space, with each state representing a possible configuration and
transitions denoting actions or operations that change the state of
the problem.
Finding a route that meets predetermined requirements from an
initial state to a goal state is the aim.
Understanding State Space Search

This approach can be used to solve a variety of AI issues, including path finding,
solving puzzles, playing games, and more.
The fundamental concept is to visualize the issue as a graph with nodes standing
in for states and edges for transitions.

Important ideas consist of:


State: A specific configuration of the problem.
Initial State: The starting point of the search.
Goal State: The desired end configuration.
Transition: An action that changes one state to another.
Path: A sequence of states connected by transitions.
Search Strategy: The method used to explore the state space.
Steps in State Space Search
State Space Representation
State space Representation involves defining an INITIAL STATE and a GOAL
STATE and then determining a sequence of actions, called states, to follow.
State:
A state can be an Initial State, a Goal State, or any other possible state that can be
generated by applying rules between them.
Space:
In an AI problem, space refers to the exhaustive collection of all conceivable states.
Search:
This technique moves from the beginning state to the desired state by applying
good rules while traversing the space of all possible states.
Search Tree:
To visualize the search issue, a search tree is used, which is a tree-like structure that
represents the problem. The initial state is represented by the root node of the
search tree, which is the starting point of the tree.
Transition Model:
This describes what each action does, while Path Cost assigns a cost value to each
path, an activity sequence that connects the beginning node to the end node.
The optimal option has the lowest cost among all alternatives.
Example of State Space Search

The 8-puzzle problem is a commonly used example of a state space search. It is a


sliding puzzle game consisting of 8 numbered tiles arranged in a 3x3 grid and one
blank space.
The game aims to rearrange the tiles from their initial state to a final goal state
by sliding them into the blank space.
To represent the state space in this problem, we use the nine tiles in the puzzle
and their respective positions in the grid.
Each state in the state space is represented by a 3x3 array with values ranging
from 1 to 8, and the blank space is represented as an empty tile.
Applications of State Space Search

State space search algorithms are used in various fields, such as robotics, game playing,
computer networks, operations research, bioinformatics, cryptography, and supply chain
management. In artificial intelligence, state space search algorithms can solve problems
like path finding, planning, and scheduling.
They are also useful in planning robot motion and finding the best sequence of actions to
achieve a goal. In games, state space search algorithms can help determine the best move for
a player given a particular game state.
State space search algorithms can optimize routing and resource allocation in computer
networks and operations research.
In Bioinformatics, state space search algorithms can help find patterns in biological data
and predict protein structures.
In Cryptography, state space search algorithms are used to break codes and find
cryptographic keys.
Control Strategies

1. Breadth-First Search (BFS).


2. Depth-First Search (DFS)
3. Uniform Cost Search
4. Greedy Best-First Search
5. A* Search
The General Problem Solver (GPS) was an AI program
proposed by Herbert Simon, J.C. Shaw, and Allen Newell.
It was the first useful computer program that came into
existence in the AI world.
The goal was to make it work as a universal problem-
solving machine. Of course there were many software
programs that existed before, but these programs
performed specific tasks.
GPS was the first program that was intended to solve
any general problem. GPS was supposed to solve all the
problems using the same base algorithm for every
problem.
To program the GPS, the authors created a new
language called Information Processing Language (IPL).
A computer program they called the general problem solver.
This program was designed to solve any problem that could
be presented in the form of mathematical formulas.
One of the key parts of the general problem solver was what
Newell and Simon called the physical symbol system
hypothesis (PSSH).
They argued that symbols were the key to general
intelligence. If you could get a program to connect enough of
these symbols, you would have a machine that behaved in a
way similar to human intelligence
They thought a key part of human reasoning was just
connecting symbols—that our language, ideas, and concepts
were just broad groupings of interconnected symbols
To support his argument against the claim
that computers think or at least have the
potential of someday being able to think, he
created an experiment called the Chinese room
argument
Complexity
AI problems are typically more complex than standard computational tasks. This complexity arises
from the vast data sets AI systems must process and the intricate algorithms they employ.
Uncertainty
Unlike traditional algorithms, AI often deals with uncertain and incomplete information. This
uncertainty requires AI systems to make predictions and decisions based on probabilistic
reasoning.
Adaptability
AI systems must adapt to new data and evolving environments. This dynamic nature challenges
programmers to create flexible algorithms that can learn and adjust over time.
Goal-oriented Design
AI algorithms are designed to achieve specific goals. These goals can range from simple tasks like
sorting data to more complex objectives like facial recognition or language translation.
Problem Characteristics Steps
Navigating the complexity of AI problems requires a systematic approach. Here's a step-by-step
guide to understanding and solving these challenges:
Defining the Problem
The first step is to clearly define the problem. What exactly are you trying to solve? This
might involve processing large datasets, recognizing patterns, or making predictions. A well-
defined problem is easier to tackle.
Data Collection & Preparation
AI thrives on data. Collect relevant data and prepare it for analysis. This involves cleaning the
data, handling missing values, and possibly transforming the data into a format suitable for AI
algorithms.
Choosing the Right Algorithm
Different problems require different AI approaches. For example, neural networks might be
great for image recognition, while decision trees could be better for classification tasks.
Selecting the appropriate algorithm is crucial.
Training the Model
This involves feeding the algorithm data and allowing it to learn from it. The training process
is iterative and requires constant adjustment and fine-tuning.
Evaluation & Optimization
After training, evaluate the model's performance. Use metrics like accuracy, precision, and
recall to gauge how well your AI is performing. Based on these evaluations, optimize the
model for better performance.
Deployment & Monitoring
Once optimized, the AI solution is deployed into a real-world environment. Continuous
monitoring is essential to ensure it adapts to new data and conditions.
Search Strategies
Artificial Intelligence is the study of building agents that act rationally. Most of
the time, these agents perform some kind of search algorithm in the background in
order to achieve their tasks.
A search problem consists of:
A State Space. Set of all possible states where you can be.
A Start State. The state from where the search begins.
A Goal State. A function that looks at the current state returns whether or not
it is the goal state.
The Solution to a search problem is a sequence of actions, called the plan that
transforms the start state to the goal state.
This plan is achieved through search algorithms.
Uninformed Search Algorithms

The search algorithms in this section have no additional information on the goal
node other than the one provided in the problem definition.
The plans to reach the goal state from the start state differ only by the order
and/or length of actions.
Uninformed search is also called Blind search.
These algorithms can only generate the successors and differentiate between the
goal state and non goal state.

The following uninformed search algorithms are discussed in this section.


1. Breadth-first Search
2. Depth-first Search
3. Depth-limited Search
4. Iterative deepening depth-first search
5. Uniform cost search
6. Bidirectional Search
Depth First Search
Breadth-first search is the most common search strategy for traversing a tree or graph. This
algorithm searches breadth wise in a tree or graph, so it is called breadth-first search.
BFS algorithm starts searching from the root node of the tree and expands all successor
node at the current level before moving to nodes of next level.
The breadth-first search algorithm is an example of a general-graph search algorithm.
Breadth-first search implemented using FIFO queue data structure.

Advantages:
BFS will provide a solution if any solution exists.
If there are more than one solutions for a given problem, then BFS will provide the
minimal solution which requires the least number of steps.
It also helps in finding the shortest path in goal state, since it needs all nodes at the same
hierarchical level before making a move to nodes at lower levels.
It is also very easy to comprehend with the help of this we can assign the higher rank
among path types.
Example
2. Depth-first Search
Depth-first search is a recursive algorithm for traversing a tree or graph data structure.
It is called the depth-first search because it starts from the root node and follows each
path to its greatest depth node before moving to the next path.
DFS uses a stack data structure for its implementation.
The process of the DFS algorithm is similar to the BFS algorithm.

Advantage:
DFS requires very less memory as it only needs to store a stack of the nodes on the
path from root node to the current node.
It takes less time to reach to the goal node than BFS algorithm (if it traverses in the
right path).
With the help of this we can stores the route which is being tracked in memory to
save time as it only needs to keep one at a particular time.
T(n)= 1+ n2+ n3 +.........+ nm=O(nm)
Where, m= maximum depth of any node and this can be much larger than d (Shallowest solution depth)
Space Complexity: DFS algorithm needs to store only single path from the root node, hence space complexity of
DFS is equivalent to the size of the fringe set, which is O(bm).
Heuristic Search Techniques in AI

In the 1970s and 1980s, psychologists Daniel Kahneman and Amos Tversky pioneered
the study of heuristics in human decision-making
primary study focus was problem-solving, was the first to introduce this concept.
We require heuristics to get an answer that is sufficient for the problem in a reasonable
amount of time.
Heuristics can assist firms in making quick decisions in complex situations with
limited resources and time by using shortcuts and estimated calculations
A heuristic search strategy is a type of artificial intelligence (AI) search that aims to
identify a good, but necessarily perfect, the solution from a set of choices.
This method produces decisions by ranking all of the options accessible at each branch
of a search and then selecting the best option from the list.
Heuristic Search Methodologies

1. Direct Heuristic Search(Informed Search)

a. A*Search
b. Greedy Best First Search

2. Weak Heuristic Search (Uninformed Search)

a. Breadth-First Search
b. Uniform Cost Search
c. Depth First Search
d. Iterative Deepening Depth First Search
e. Bidirectional Search
A* Search Algorithm

A* Search algorithm is one of the best and popular technique used in path-finding
and graph traversals
 it is really a smart algorithm which separates it from the other conventional
algorithms
This makes A* algorithm in AI an informed search algorithm for best-first search.

f(x)=g(x)+h(x)
f(X) = total estimated cost of path through node n
g(X) = cost so far to reach node n
h(X) = estimated cost from n to goal

You might also like