Search Algorithms in Artificial Intelligence: A Comprehensive Guide, Cheat Sheet of Artificial Intelligence

topic covered - searching techniques, breath first search , depth first search, computational dependency, neural networks.

Typology: Cheat Sheet

2022/2023

Available from 09/12/2023

srishti-jalan
srishti-jalan 🇮🇳

6 documents

1 / 142

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Introduction to Computational
Intelligence
-Presented By:
Shawni Dutta,
Department of Computer Science,
The BES College
This Photo by Unknown author is licensed under CC BY.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Search Algorithms in Artificial Intelligence: A Comprehensive Guide and more Cheat Sheet Artificial Intelligence in PDF only on Docsity!

Introduction to Computational

Intelligence

-Presented By:

Shawni Dutta,

Department of Computer Science,

The BES College

This Photo by Unknown author is licensed under CC BY.

SEARCHING

  • Problem solving in artificial intelligence may be characterized as a systematic search

through a range of possible actions in order to reach some predefined goal or solution.

  • In AI problem solving by search algorithms is quite common technique. In the coming

age of AI it will have big impact on the technologies of the robotics and path finding. It is

also widely used in travel planning.

  • A search algorithm takes a problem as input and returns the solution in the form of an

action sequence.

  • Once the solution is found, the actions it recommends can be carried out. This phase is

called as the execution phase.

  • After formulating a goal and problem to solve the agent cells a search procedure to solve

it.

Search Technique

- Based on the search problems we can classify the search algorithms

into uninformed (Blind search) search and informed search (Heuristic search) algorithms.

Difference

between

Informed and

Uninformed

Search in AI

- Informed Search: Informed Search algorithms have information on the goal state which helps in more efficient searching. This information is obtained by a function that estimates how close a state is to the goal state. - Uninformed Search: Uninformed search algorithms 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 length of actions.

Types of Uninformed Search

- It can be divided into five main types: - Breadth-first search - Uniform cost search - Depth-first search - Iterative deepening depth-first search - Bidirectional Search

Breadth First

Search (BFS)

  • Breadth first search is a general technique of traversing a graph. Breadth first search may use more memory but will always find the shortest path first.
  • In this type of search the state space is represented in form of a tree. The solution is obtained by traversing through the tree.
  • The nodes of the tree represent the start value or starting state, various intermediate states and the final state. In this search a queue data structure is used and it is level by level traversal.
  • Breadth first search expands nodes in order of their distance from the root. It is a path finding algorithm that is capable of always finding the solution if one exists.
  • The solution which is found is always the optional solution. This task is completed in a very memory intensive manner. Each node in the search tree is expanded in a breadth wise at each level.

Water Jug Problem : Breadth First Search

UNINFORMED

SEARCH:

Depth First

Search (DFS)

  • DFS is also an important type of uniform search.

DFS visits all the vertices in the graph. This type of

algorithm always chooses to go deeper into the

graph.

  • After DFS visited all the reachable vertices from a

particular sources vertices it chooses one of the

remaining undiscovered vertices and continues the

search.

  • DFS reminds the space limitation of breath first

search by always generating next a child of the

deepest unexpanded nodded.

  • The data structure stack or last in first out (LIFO) is

used for DFS.

Water Jug Problem : Depth First Search

Does

systematic

Problem

always help?

  • For the water jug problem, most control strategies that cause motion and are systematic will lead to an answer.
  • The problem is simple. But this is not always the case; in order to solve some problems during our lifetime, we must also demand a control structure that is efficient.

Traveling

salesperson

problem:

  • A simple, motion causing and systematic control structure code, in principle, solve this problem it would simply explore all possible paths in the tree and return the one with the shortest length.
  • This approach will even work in practice for very short list of cities. But it breaks down quickly as the number of cities grows.
  • If there are N cities, then the number of different parts among them is 1, 2... (N – 1) or (N – 1) !.
  • The time to examine a single part is proportional to N so the total time required to perform this search is proportional to N factorial.
  • Assuming there are 10 cities, 10 factorial is 3, 628, 800. Which is very large number.
  • The salesman could easily have 25 cities to visit. To solve this problem would take more time then he would be willing to spend this phenomenon is known as combinatorial explosion.

Informed Search

  • Informed search algorithm contains an array of knowledge such as how far we are from the goal, path cost, how to reach to goal node, etc.
  • This knowledge help agents to explore less to the search space and find more efficiently the goal node.

Example: Heuristic

  • One example of a good general-purpose heuristic that is useful for a variety of combinatorial problems in the nearest neighbor heuristic, which works by selecting the locally superior alternative at each step. Applying it to the travelling salesman problem, we produce the following procedure- - 1.Arbitrarily select a starting city. - 2. To select the next city, look at all cities not yet visited, and select the one closest to the current city. Go to it next. - 3. Repeat step 2 until all cities have been visited.

Heuristic

function

  • The heuristic method, however, might not always

give the best solution, but it guaranteed to find a

good solution in reasonable time.

  • Heuristic function estimates how close a state is to

the goal.

  • It is represented by h(n), and it calculates the cost

of an optimal path between the pair of states.

  • The value of the heuristic function is always

positive.