You are on page 1of 7

Artificial Intelligence

Unit 2 imp : Problem-solving

1] Solving Problems by Searching, Problem-Solving Agents, Example


Problems ? (Read only)

Solving Problems by Searching:

Solving problems by searching is a fundamental concept in artificial intelligence that involves


finding a sequence of actions to reach a goal from an initial state.

Problem-solving agents are entities that interact with an environment to achieve specific goals.

These agents use problem-solving techniques, such as searching, to find solutions to the
problems they encounter.

Example Problems:

Problem-solving can be applied to various domains, such as route planning, puzzle solving,
scheduling, and more. For instance, finding the shortest path between two locations on a map is
a classic example problem.

2] Explain Search Algorithms in detail ?


Search algorithms are systematic methods for exploring and navigating a problem space.

These algorithms help problem-solving agents find solutions by traversing the space of possible
states and actions.

Types of Search Algorithms :

 Uninformed (Blind )Search


 Informed (Heuristic) Search

We will see this algorithms in detail in next question

1
3] explain in detail Uninformed (Blind )Search ?
Uninformed search strategies, also known as blind search strategies, explore the problem space
without using any specific information about the problem.
Examples include breadth-first search and depth-first search , Depth-limited Search, Iterative
deepening depth-first search, Bidirectional Search .

Breadth-first Search :
Breadth-first search is the most common search strategy for traversing a tree or graph. This
algorithm searches breadthwise in a tree or graph, so it is called breadth-first search.
Breadth-first search implemented using FIFO queue data structure

Advantages:
o BFS will provide a solution if any solution exists.
o If there are more than one solutions for a given problem, then BFS will provide
the minimal solution which requires the less number of steps.

Disadvantages:

o It requires lots of memory since each level of the tree must be saved into memory
to expand the next level.
o BFS needs lots of time if the solution is far away from the root node.

Depth-first Search

Depth-first search isa recursive algorithm for traversing a tree or graph data
structure.

DFS uses a stack data structure for its implementation.

Advantage:

o DFS requires very less memory


o It takes less time to reach to the goal node than BFS algorithm

Disadvantage:

o There is no guarantee of finding the solution.


o DFS algorithm goes for deep down searching and sometime it may go to the
infinite loop.

2
Depth-Limited Search Algorithm:

A depth-limited search algorithm is similar to depth-first search with a predetermined


limit.

Depth-limited search can solve the drawback of the infinite path in the Depth-first
search

Advantages:

o Depth-limited search is Memory efficient.

Disadvantages:

o Depth-limited search also has a disadvantage of incompleteness.


o It may not be optimal if the problem has more than one solution.

Iterative deepeningdepth-first Search:

The iterative deepening algorithm is a combination of DFS and BFS algorithms.

This Search algorithm combines the benefits of Breadth-first search's fast search and
depth-first search's memory efficiency.

Advantages:

o Itcombines the benefits of BFS and DFS search algorithm in terms of fast search
and memory efficiency.

Disadvantages:

o The main drawback of IDDFS is that it repeats all the work of the previous phase

3
Bidirectional Search Algorithm:

Bidirectional search algorithm runs two simultaneous searches, one form initial state
called as forward-search and other from goal node called as backward-search, to find
the goal node

Advantages:

o Bidirectional search is fast.


o Bidirectional search requires less memory

Disadvantages:

o Implementation of the bidirectional search tree is difficult.


o In bidirectional search, one should know the goal state in advance.

4] Explain in detail Informed (Heuristic) Search Strategies ?

Informed search algorithm uses the idea of heuristic, so it is also called Heuristic
search.

Heuristic functions provide a numerical estimate of the cost or distance from a given
state to the goal.

They guide the search algorithm by prioritizing states that are likely to lead to a solution.

Two main informed search algorithms:

o Best First Search Algorithm(Greedy search)


o A* Search Algorithm

Best First Search Algorithm(Greedy search)

Greedy best-first search algorithm always selects the path which appears best at that
moment.

It uses the heuristic function and search

4
Advantages:
o Best first search can switch between BFS and DFS by gaining the advantages of
both the algorithms.
o This algorithm is more efficient than BFS and DFS algorithms.

Disadvantages:
o It can get stuck in a loop as DFS.
o This algorithm is not optimal.

Example:

Navigating a maze using Greedy Best-First Search, where the algorithm always chooses
the path that brings it closest to the goal without considering the total distance traveled.

A* Search Algorithm:

The A* (pronounced "A-star") search algorithm is a popular and widely used algorithm
in artificial intelligence and computer science for finding the shortest path or optimal
solution in a graph.

A* combines elements of both uniform cost search and greedy best-first search,
making it efficient and effective.

Example : Consider a map with cities and roads, where the goal is to find the shortest
path from one city to another. A* would use the distance between cities as the actual
cost and a heuristic estimate of the remaining distance to the goal.

Advantages:
o A* search algorithm is the best algorithm than other search algorithms.
o This algorithm can solve very complex problems.

Disadvantages:
o A* search algorithm has some complexity issues.
o The main drawback of A* is memory requirement

5
5] what is Local Search and Optimization Problems ?

Local Search:
Local search focuses on exploring a small subset of the problem space.
Examples include hill climbing and simulated annealing.

Optimization Problems:
Optimization problems involve finding the best solution among a set of possible
solutions.
Search algorithms, especially those based on heuristics, play a key role in solving
optimization problems by guiding the exploration towards optimal solutions.

6]List steps involved in simple problem solving technique with suitable


example

Steps Involved:

1. Understanding the Problem:: Define the problem and identify its key components.
2. Defining the Goal: Specify what success looks like for the given problem.
3. Generating Possible Solutions: create a list of potential solutions.
4. Implementing the Solution: Develop a plan or action steps for implementing the
selected solution.
5. Monitoring and Adjusting: Execute the plan and monitor its progress.

Example : simple problem of time management for a student preparing for exams

1. Understanding the Problem:

The student is struggling to manage time efficiently for exam preparation.

2. Defining the Goal:

The goal is to create a study schedule that allows for effective preparation in all subjects..

3. Generating Possible Solutions:

creating a daily study timetable, using study apps, seeking help from a tutor, or forming
a study group.

6
4. Implementing the Solution:

Develop a detailed study schedule, allocating specific time slots for each subject

5. Monitoring and Adjusting:

Follow the study schedule and monitor progress.

7] Describe Hill climbing search with suitable example. List Advantages disadvantage
of hill climbing process ?

Hill climbing is a local search algorithm that iteratively moves toward the direction of
increasing action.

Example:

Consider a scenario where you are hiking on a mountain, and your goal is to reach the
highest peak. You start at a random location and decide to move in the direction of
each incline step. This represents the hill climbing algorithm

Advantages

 It is a very useful technique while solving problems like job searching.


 No backtracking occurred using such an algorithm.

Disadvantages

 The efficiency and effectiveness get compromised while using this technique.
If the value of the heuristic is uncertain then this technique is not recommended

 If the value of the heuristic is uncertain then this technique is not recommended

***

I AM BATMAN

You might also like