Searching techniques

Prof.Dharmishtha R. Chaudhari
Prof.Dharmishtha R. ChaudhariAssistant professor at FETR, Bardoli em Faculty of Enginerring Technology & Research, Bardoli

ai

SEARCHING IN AI
Searching is the universal technique of problem solving in AI. There are some single-
player games such as tile games, Sudoku, crossword, etc. The search algorithms
help you to search for a particular position in such games.
Single Agent Pathfinding Problems
The games such as 3X3 eight-tile, 4X4 fifteen-tile, and 5X5 twenty four tile puzzles
are single-agent-path-finding challenges. They consist of a matrix of tiles with a blank
tile. The player is required to arrange the tiles by sliding a tile either vertically or
horizontally into a blank space with the aim of accomplishing some objective.
The other examples of single agent pathfinding problems are Travelling Salesman
Problem, Rubik’s Cube, and Theorem Proving.
Search Terminology
 Problem Space − It is the environment in which the search takes place. (A set of states
and set of operators to change those states)
 Problem Instance − It is Initial state + Goal state.
 Problem Space Graph − It represents problem state. States are shown by nodes and
operators are shown by edges.
 Depth of a problem − Length of a shortest path or shortest sequence of operators from
Initial State to goal state.
 Space Complexity − The maximum number of nodes that are stored in memory.
 Time Complexity − The maximum number of nodes that are created.
 Admissibility − A property of an algorithm to always find an optimal solution.
 Branching Factor − The average number of child nodes in the problem space graph.
 Depth − Length of the shortest path from initial state to goal state.
Brute-Force Search Strategies
They are most simple, as they do not need any domain-specific knowledge. They
work fine with small number of possible states.
Requirements −
 State description
 A set of valid operators
 Initial state
 Goal state description
Breadth-First Search
It starts from the root node, explores the neighboring nodes first and moves towards
the next level neighbors. It generates one tree at a time until the solution is found. It
can be implemented using FIFO queue data structure. This method provides shortest
path to the solution.
If branching factor (average number of child nodes for a given node) = b and depth
= d, then number of nodes at level d = bd
.
The total no of nodes created in worst case is b + b2
+ b3
+ … + bd
.
Disadvantage − Since each level of nodes is saved for creating next one, it
consumes a lot of memory space. Space requirement to store nodes is exponential.
Its complexity depends on the number of nodes. It can check duplicate nodes.
Depth-First Search
It is implemented in recursion with LIFO stack data structure. It creates the same set
of nodes as Breadth-First method, only in the different order.
As the nodes on the single path are stored in each iteration from root to leaf node,
the space requirement to store nodes is linear. With branching factor b and depth
as m, the storage space is bm.
Disadvantage − This algorithm may not terminate and go on infinitely on one path.
The solution to this issue is to choose a cut-off depth. If the ideal cut-off is d, and if
chosen cut-off is lesser than d, then this algorithm may fail. If chosen cut-off is more
than d, then execution time increases.Its complexity depends on the number of paths.
It cannot check duplicate nodes.
Bidirectional Search
It searches forward from initial state and backward from goal state till both meet to
identify a common state.
The path from initial state is concatenated with the inverse path from the goal state.
Each search is done only up to half of the total path.
Uniform Cost Search
Sorting is done in increasing cost of the path to a node. It always expands the least
cost node. It is identical to Breadth First search if each transition has the same cost.
It explores paths in the increasing order of cost.
Disadvantage − There can be multiple long paths with the cost ≤ C*. Uniform Cost
search must explore them all.
Iterative Deepening Depth-First Search
It performs depth-first search to level 1, starts over, executes a complete depth-first
search to level 2, and continues in such way till the solution is found.
It never creates a node until all lower nodes are generated. It only saves a stack of
nodes. The algorithm ends when it finds a solution at depth d. The number of nodes
created at depth d is bd
and at depth d-1 is bd-1.
Comparison of Various Algorithms Complexities
Let us see the performance of algorithms based on various criteria −
Criterion
Breadth
First
Depth First
Bidirectional
Uniform
Cost
Interactive Deepening
Time bd
bm
bd/2
bd
bd
Space bd
bm
bd/2
bd
bd
Optimality Yes No Yes Yes Yes
Completeness Yes No Yes Yes Yes
Informed (Heuristic) Search Strategies
To solve large problems with large number of possible states, problem-specific
knowledge needs to be added to increase the efficiency of search algorithms.
Heuristic Evaluation Functions
They calculate the cost of optimal path between two states. A heuristic function for
sliding-tiles games is computed by counting number of moves that each tile makes
from its goal state and adding these number of moves for all tiles.
Pure Heuristic Search
It expands nodes in the order of their heuristic values. It creates two lists, a closed
list for the already expanded nodes and an open list for the created but unexpanded
nodes.
In each iteration, a node with a minimum heuristic value is expanded, all its child
nodes are created and placed in the closed list. Then, the heuristic function is applied
to the child nodes and they are placed in the open list according to their heuristic
value. The shorter paths are saved and the longer ones are disposed.
A * Search
It is best-known form of Best First search. It avoids expanding paths that are already
expensive, but expands most promising paths first.
f(n) = g(n) + h(n), where
 g(n) the cost (so far) to reach the node
 h(n) estimated cost to get from the node to the goal
 f(n) estimated total cost of path through n to goal. It is implemented using priority queue
by increasing f(n).
Greedy Best First Search
It expands the node that is estimated to be closest to goal. It expands nodes based
on f(n) = h(n). It is implemented using priority queue.
Disadvantage − It can get stuck in loops. It is not optimal.
Local Search Algorithms
They start from a prospective solution and then move to a neighboring solution. They
can return a valid solution even if it is interrupted at any time before they end.
Hill-Climbing Search
It is an iterative algorithm that starts with an arbitrary solution to a problem and
attempts to find a better solution by changing a single element of the solution
incrementally. If the change produces a better solution, an incremental change is
taken as a new solution. This process is repeated until there are no further
improvements.
function Hill-Climbing (problem), returns a state that is a local maximum.
inputs: problem, a problem
local variables: current, a node
neighbor, a node
current <-Make_Node(Initial-State[problem])
loop
do neighbor <- a highest_valued successor of current
if Value[neighbor] ≤ Value[current] then
return State[current]
current <- neighbor
end
Disadvantage − This algorithm is neither complete, nor optimal.
Local Beam Search
In this algorithm, it holds k number of states at any given time. At the start, these
states are generated randomly. The successors of these k states are computed with
the help of objective function. If any of these successors is the maximum value of the
objective function, then the algorithm stops.
Otherwise the (initial k states and k number of successors of the states = 2k) states
are placed in a pool. The pool is then sorted numerically. The highest k states are
selected as new initial states. This process continues until a maximum value is
reached.
function BeamSearch( problem, k), returns a solution state.
start with k randomly generated states
loop
generate all successors of all k states
if any of the states = solution, then return the state
else select the k best successors
end
Simulated Annealing
Annealing is the process of heating and cooling a metal to change its internal
structure for modifying its physical properties. When the metal cools, its new structure
is seized, and the metal retains its newly obtained properties. In simulated annealing
process, the temperature is kept variable.
We initially set the temperature high and then allow it to ‘cool' slowly as the algorithm
proceeds. When the temperature is high, the algorithm is allowed to accept worse
solutions with high frequency.
Start
 Initialize k = 0; L = integer number of variables;
 From i → j, search the performance difference Δ.
 If Δ <= 0 then accept else if exp(-Δ/T(k)) > random(0,1) then accept;
 Repeat steps 1 and 2 for L(k) steps.
 k = k + 1;
Repeat steps 1 through 4 till the criteria is met.
End
Travelling Salesman Problem
In this algorithm, the objective is to find a low-cost tour that starts from a city, visits all
cities en-route exactly once and ends at the same starting city.
Start
Find out all (n -1)! Possible solutions, where n is the total
number of cities.
Determine the minimum cost by finding out the cost of each of
these (n -1)! solutions.
Finally, keep the one with the minimum cost.
end

Recomendados

Artificial Intelligence -- Search Algorithms por
Artificial Intelligence-- Search Algorithms Artificial Intelligence-- Search Algorithms
Artificial Intelligence -- Search Algorithms Syed Ahmed
4.3K visualizações110 slides
Search problems in Artificial Intelligence por
Search problems in Artificial IntelligenceSearch problems in Artificial Intelligence
Search problems in Artificial Intelligenceananth
4.1K visualizações36 slides
Solving problems by searching por
Solving problems by searchingSolving problems by searching
Solving problems by searchingLuigi Ceccaroni
12.8K visualizações48 slides
Lecture 2 por
Lecture 2Lecture 2
Lecture 2chandsek666
3.7K visualizações56 slides
Popular search algorithms por
Popular search algorithmsPopular search algorithms
Popular search algorithmsMinakshi Atre
1.2K visualizações109 slides
Search 1 por
Search 1Search 1
Search 1Tribhuvan University
22 visualizações18 slides

Mais conteúdo relacionado

Mais procurados

AI Lesson 04 por
AI Lesson 04AI Lesson 04
AI Lesson 04Assistant Professor
3.3K visualizações28 slides
L1803016468 por
L1803016468L1803016468
L1803016468IOSR Journals
217 visualizações4 slides
Algorithms por
AlgorithmsAlgorithms
AlgorithmsAnkit Agarwal
653 visualizações11 slides
Sienna 13 limitations por
Sienna 13 limitationsSienna 13 limitations
Sienna 13 limitationschidabdu
1.2K visualizações10 slides
Chapter3 Search por
Chapter3 SearchChapter3 Search
Chapter3 SearchKhiem Ho
1.9K visualizações56 slides
Uniformed tree searching por
Uniformed tree searching Uniformed tree searching
Uniformed tree searching Ayaelshiwi
7K visualizações20 slides

Mais procurados(20)

L1803016468 por IOSR Journals
L1803016468L1803016468
L1803016468
IOSR Journals217 visualizações
Algorithms por Ankit Agarwal
AlgorithmsAlgorithms
Algorithms
Ankit Agarwal653 visualizações
Sienna 13 limitations por chidabdu
Sienna 13 limitationsSienna 13 limitations
Sienna 13 limitations
chidabdu1.2K visualizações
Chapter3 Search por Khiem Ho
Chapter3 SearchChapter3 Search
Chapter3 Search
Khiem Ho1.9K visualizações
Uniformed tree searching por Ayaelshiwi
Uniformed tree searching Uniformed tree searching
Uniformed tree searching
Ayaelshiwi7K visualizações
Element distinctness lower bounds por Rajendran
Element distinctness lower boundsElement distinctness lower bounds
Element distinctness lower bounds
Rajendran 925 visualizações
Control Strategies in AI por Amey Kerkar
Control Strategies in AIControl Strategies in AI
Control Strategies in AI
Amey Kerkar28.9K visualizações
Knowledge engg using & in fol por chandsek666
Knowledge engg using & in folKnowledge engg using & in fol
Knowledge engg using & in fol
chandsek6661.3K visualizações
CPSC 125 Ch 4 Sec 5 por David Wood
CPSC 125 Ch 4 Sec 5CPSC 125 Ch 4 Sec 5
CPSC 125 Ch 4 Sec 5
David Wood385 visualizações
State Space Search por Jasmine Chen
State Space SearchState Space Search
State Space Search
Jasmine Chen901 visualizações
3.4 density and grid methods por Krish_ver2
3.4 density and grid methods3.4 density and grid methods
3.4 density and grid methods
Krish_ver212.9K visualizações
Skiena algorithm 2007 lecture18 application of dynamic programming por zukun
Skiena algorithm 2007 lecture18 application of dynamic programmingSkiena algorithm 2007 lecture18 application of dynamic programming
Skiena algorithm 2007 lecture18 application of dynamic programming
zukun1.2K visualizações
L05 language model_part2 por ananth
L05 language model_part2L05 language model_part2
L05 language model_part2
ananth1.2K visualizações
Heuristic search-in-artificial-intelligence por grinu
Heuristic search-in-artificial-intelligenceHeuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligence
grinu3.7K visualizações
Chapter 17 por ashish bansal
Chapter 17Chapter 17
Chapter 17
ashish bansal580 visualizações
Design and Analysis of algorithms por Dr. Rupa Ch
Design and Analysis of algorithmsDesign and Analysis of algorithms
Design and Analysis of algorithms
Dr. Rupa Ch2.1K visualizações
Backtracking & branch and bound por Vipul Chauhan
Backtracking & branch and boundBacktracking & branch and bound
Backtracking & branch and bound
Vipul Chauhan1.2K visualizações
Deep Learning: Recurrent Neural Network (Chapter 10) por Larry Guo
Deep Learning: Recurrent Neural Network (Chapter 10) Deep Learning: Recurrent Neural Network (Chapter 10)
Deep Learning: Recurrent Neural Network (Chapter 10)
Larry Guo3.8K visualizações

Similar a Searching techniques

Ai popular search algorithms por
Ai   popular search algorithmsAi   popular search algorithms
Ai popular search algorithmsLearnbay Datascience
54 visualizações12 slides
Artificial Intelligence por
Artificial IntelligenceArtificial Intelligence
Artificial IntelligenceJay Nagar
1K visualizações19 slides
CptS 440 / 540 Artificial Intelligence por
CptS 440 / 540 Artificial IntelligenceCptS 440 / 540 Artificial Intelligence
CptS 440 / 540 Artificial Intelligencebutest
1.1K visualizações182 slides
AI: AI & Problem Solving por
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem SolvingDataminingTools Inc
36.4K visualizações17 slides
AI: AI & problem solving por
AI: AI & problem solvingAI: AI & problem solving
AI: AI & problem solvingDatamining Tools
1.4K visualizações17 slides
l2.pptx por
l2.pptxl2.pptx
l2.pptxMajwegaJacksonSuubiA
7 visualizações182 slides

Similar a Searching techniques(20)

Ai popular search algorithms por Learnbay Datascience
Ai   popular search algorithmsAi   popular search algorithms
Ai popular search algorithms
Learnbay Datascience54 visualizações
Artificial Intelligence por Jay Nagar
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
Jay Nagar1K visualizações
CptS 440 / 540 Artificial Intelligence por butest
CptS 440 / 540 Artificial IntelligenceCptS 440 / 540 Artificial Intelligence
CptS 440 / 540 Artificial Intelligence
butest1.1K visualizações
AI: AI & Problem Solving por DataminingTools Inc
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
DataminingTools Inc36.4K visualizações
AI: AI & problem solving por Datamining Tools
AI: AI & problem solvingAI: AI & problem solving
AI: AI & problem solving
Datamining Tools1.4K visualizações
Heuristic or informed search por HamzaJaved64
Heuristic or informed searchHeuristic or informed search
Heuristic or informed search
HamzaJaved64104 visualizações
l2.pptx por AnujaBeatriceB
l2.pptxl2.pptx
l2.pptx
AnujaBeatriceB2 visualizações
Lecture 3 Problem Solving.pptx por AndrewKuziwakwasheMu
Lecture 3 Problem Solving.pptxLecture 3 Problem Solving.pptx
Lecture 3 Problem Solving.pptx
AndrewKuziwakwasheMu27 visualizações
Amit ppt por amitp26
Amit pptAmit ppt
Amit ppt
amitp268K visualizações
Artificial intelligent Lec 3-ai chapter3-search por Taymoor Nazmy
Artificial intelligent Lec 3-ai chapter3-searchArtificial intelligent Lec 3-ai chapter3-search
Artificial intelligent Lec 3-ai chapter3-search
Taymoor Nazmy56 visualizações
(Radhika) presentation on chapter 2 ai por Radhika Srinivasan
(Radhika) presentation on chapter 2 ai(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 ai
Radhika Srinivasan9.3K visualizações
Backtracking por Vikas Sharma
Backtracking  Backtracking
Backtracking
Vikas Sharma5.6K visualizações
Algorithm in computer science por Riazul Islam
Algorithm in computer scienceAlgorithm in computer science
Algorithm in computer science
Riazul Islam169 visualizações
Chap11 slides por BaliThorat1
Chap11 slidesChap11 slides
Chap11 slides
BaliThorat1514 visualizações
Lec#2 por Ali Shah
Lec#2Lec#2
Lec#2
Ali Shah1.1K visualizações
Artificial Intelligence_Searching.pptx por Ratnakar Mikkili
Artificial Intelligence_Searching.pptxArtificial Intelligence_Searching.pptx
Artificial Intelligence_Searching.pptx
Ratnakar Mikkili9 visualizações
Travelling Salesman Problem por Shikha Gupta
Travelling Salesman ProblemTravelling Salesman Problem
Travelling Salesman Problem
Shikha Gupta3.4K visualizações

Mais de Prof.Dharmishtha R. Chaudhari

Php tutorial por
Php tutorialPhp tutorial
Php tutorialProf.Dharmishtha R. Chaudhari
18 visualizações40 slides
Cdma por
CdmaCdma
CdmaProf.Dharmishtha R. Chaudhari
38 visualizações8 slides
Searching por
SearchingSearching
SearchingProf.Dharmishtha R. Chaudhari
131 visualizações37 slides
Srs por
SrsSrs
SrsProf.Dharmishtha R. Chaudhari
60 visualizações39 slides
Requirementengg por
RequirementenggRequirementengg
RequirementenggProf.Dharmishtha R. Chaudhari
81 visualizações34 slides
Requirement analysis por
Requirement analysisRequirement analysis
Requirement analysisProf.Dharmishtha R. Chaudhari
91 visualizações29 slides

Último

Plant Design Report-Oil Refinery.pdf por
Plant Design Report-Oil Refinery.pdfPlant Design Report-Oil Refinery.pdf
Plant Design Report-Oil Refinery.pdfSafeen Yaseen Ja'far
9 visualizações10 slides
Pitchbook Repowerlab.pdf por
Pitchbook Repowerlab.pdfPitchbook Repowerlab.pdf
Pitchbook Repowerlab.pdfVictoriaGaleano
8 visualizações12 slides
Unlocking Research Visibility.pdf por
Unlocking Research Visibility.pdfUnlocking Research Visibility.pdf
Unlocking Research Visibility.pdfKhatirNaima
11 visualizações19 slides
Global airborne satcom market report por
Global airborne satcom market reportGlobal airborne satcom market report
Global airborne satcom market reportdefencereport78
7 visualizações13 slides
2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx por
2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx
2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptxlwang78
188 visualizações19 slides
Ansari: Practical experiences with an LLM-based Islamic Assistant por
Ansari: Practical experiences with an LLM-based Islamic AssistantAnsari: Practical experiences with an LLM-based Islamic Assistant
Ansari: Practical experiences with an LLM-based Islamic AssistantM Waleed Kadous
11 visualizações29 slides

Último(20)

Plant Design Report-Oil Refinery.pdf por Safeen Yaseen Ja'far
Plant Design Report-Oil Refinery.pdfPlant Design Report-Oil Refinery.pdf
Plant Design Report-Oil Refinery.pdf
Safeen Yaseen Ja'far9 visualizações
Pitchbook Repowerlab.pdf por VictoriaGaleano
Pitchbook Repowerlab.pdfPitchbook Repowerlab.pdf
Pitchbook Repowerlab.pdf
VictoriaGaleano8 visualizações
Unlocking Research Visibility.pdf por KhatirNaima
Unlocking Research Visibility.pdfUnlocking Research Visibility.pdf
Unlocking Research Visibility.pdf
KhatirNaima11 visualizações
Global airborne satcom market report por defencereport78
Global airborne satcom market reportGlobal airborne satcom market report
Global airborne satcom market report
defencereport787 visualizações
2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx por lwang78
2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx
2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx
lwang78188 visualizações
Ansari: Practical experiences with an LLM-based Islamic Assistant por M Waleed Kadous
Ansari: Practical experiences with an LLM-based Islamic AssistantAnsari: Practical experiences with an LLM-based Islamic Assistant
Ansari: Practical experiences with an LLM-based Islamic Assistant
M Waleed Kadous11 visualizações
dummy.pptx por JamesLamp
dummy.pptxdummy.pptx
dummy.pptx
JamesLamp7 visualizações
Design_Discover_Develop_Campaign.pptx por ShivanshSeth6
Design_Discover_Develop_Campaign.pptxDesign_Discover_Develop_Campaign.pptx
Design_Discover_Develop_Campaign.pptx
ShivanshSeth655 visualizações
AWS A5.18 A5.18M-2021.pdf por ThinhNguyen455948
AWS A5.18 A5.18M-2021.pdfAWS A5.18 A5.18M-2021.pdf
AWS A5.18 A5.18M-2021.pdf
ThinhNguyen4559488 visualizações
Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc... por csegroupvn
Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...
Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...
csegroupvn13 visualizações
BCIC - Manufacturing Conclave - Technology-Driven Manufacturing for Growth por Innomantra
BCIC - Manufacturing Conclave -  Technology-Driven Manufacturing for GrowthBCIC - Manufacturing Conclave -  Technology-Driven Manufacturing for Growth
BCIC - Manufacturing Conclave - Technology-Driven Manufacturing for Growth
Innomantra 20 visualizações
ASSIGNMENTS ON FUZZY LOGIC IN TRAFFIC FLOW.pdf por AlhamduKure
ASSIGNMENTS ON FUZZY LOGIC IN TRAFFIC FLOW.pdfASSIGNMENTS ON FUZZY LOGIC IN TRAFFIC FLOW.pdf
ASSIGNMENTS ON FUZZY LOGIC IN TRAFFIC FLOW.pdf
AlhamduKure10 visualizações
unit 1.pptx por rrbornarecm
unit 1.pptxunit 1.pptx
unit 1.pptx
rrbornarecm5 visualizações
Créativité dans le design mécanique à l’aide de l’optimisation topologique por LIEGE CREATIVE
Créativité dans le design mécanique à l’aide de l’optimisation topologiqueCréativité dans le design mécanique à l’aide de l’optimisation topologique
Créativité dans le design mécanique à l’aide de l’optimisation topologique
LIEGE CREATIVE8 visualizações
CPM Schedule Float.pptx por Mathew Joseph
CPM Schedule Float.pptxCPM Schedule Float.pptx
CPM Schedule Float.pptx
Mathew Joseph6 visualizações
GPS Survery Presentation/ Slides por OmarFarukEmon1
GPS Survery Presentation/ SlidesGPS Survery Presentation/ Slides
GPS Survery Presentation/ Slides
OmarFarukEmon17 visualizações
Design of machine elements-UNIT 3.pptx por gopinathcreddy
Design of machine elements-UNIT 3.pptxDesign of machine elements-UNIT 3.pptx
Design of machine elements-UNIT 3.pptx
gopinathcreddy38 visualizações
GDSC Mikroskil Members Onboarding 2023.pdf por gdscmikroskil
GDSC Mikroskil Members Onboarding 2023.pdfGDSC Mikroskil Members Onboarding 2023.pdf
GDSC Mikroskil Members Onboarding 2023.pdf
gdscmikroskil68 visualizações

Searching techniques

  • 1. SEARCHING IN AI Searching is the universal technique of problem solving in AI. There are some single- player games such as tile games, Sudoku, crossword, etc. The search algorithms help you to search for a particular position in such games. Single Agent Pathfinding Problems The games such as 3X3 eight-tile, 4X4 fifteen-tile, and 5X5 twenty four tile puzzles are single-agent-path-finding challenges. They consist of a matrix of tiles with a blank tile. The player is required to arrange the tiles by sliding a tile either vertically or horizontally into a blank space with the aim of accomplishing some objective. The other examples of single agent pathfinding problems are Travelling Salesman Problem, Rubik’s Cube, and Theorem Proving. Search Terminology  Problem Space − It is the environment in which the search takes place. (A set of states and set of operators to change those states)  Problem Instance − It is Initial state + Goal state.  Problem Space Graph − It represents problem state. States are shown by nodes and operators are shown by edges.  Depth of a problem − Length of a shortest path or shortest sequence of operators from Initial State to goal state.  Space Complexity − The maximum number of nodes that are stored in memory.  Time Complexity − The maximum number of nodes that are created.  Admissibility − A property of an algorithm to always find an optimal solution.  Branching Factor − The average number of child nodes in the problem space graph.  Depth − Length of the shortest path from initial state to goal state. Brute-Force Search Strategies They are most simple, as they do not need any domain-specific knowledge. They work fine with small number of possible states. Requirements −  State description  A set of valid operators  Initial state  Goal state description
  • 2. Breadth-First Search It starts from the root node, explores the neighboring nodes first and moves towards the next level neighbors. It generates one tree at a time until the solution is found. It can be implemented using FIFO queue data structure. This method provides shortest path to the solution. If branching factor (average number of child nodes for a given node) = b and depth = d, then number of nodes at level d = bd . The total no of nodes created in worst case is b + b2 + b3 + … + bd . Disadvantage − Since each level of nodes is saved for creating next one, it consumes a lot of memory space. Space requirement to store nodes is exponential. Its complexity depends on the number of nodes. It can check duplicate nodes. Depth-First Search It is implemented in recursion with LIFO stack data structure. It creates the same set of nodes as Breadth-First method, only in the different order. As the nodes on the single path are stored in each iteration from root to leaf node, the space requirement to store nodes is linear. With branching factor b and depth as m, the storage space is bm. Disadvantage − This algorithm may not terminate and go on infinitely on one path. The solution to this issue is to choose a cut-off depth. If the ideal cut-off is d, and if chosen cut-off is lesser than d, then this algorithm may fail. If chosen cut-off is more than d, then execution time increases.Its complexity depends on the number of paths. It cannot check duplicate nodes.
  • 3. Bidirectional Search It searches forward from initial state and backward from goal state till both meet to identify a common state. The path from initial state is concatenated with the inverse path from the goal state. Each search is done only up to half of the total path. Uniform Cost Search Sorting is done in increasing cost of the path to a node. It always expands the least cost node. It is identical to Breadth First search if each transition has the same cost. It explores paths in the increasing order of cost. Disadvantage − There can be multiple long paths with the cost ≤ C*. Uniform Cost search must explore them all. Iterative Deepening Depth-First Search It performs depth-first search to level 1, starts over, executes a complete depth-first search to level 2, and continues in such way till the solution is found. It never creates a node until all lower nodes are generated. It only saves a stack of nodes. The algorithm ends when it finds a solution at depth d. The number of nodes created at depth d is bd and at depth d-1 is bd-1.
  • 4. Comparison of Various Algorithms Complexities Let us see the performance of algorithms based on various criteria − Criterion Breadth First Depth First Bidirectional Uniform Cost Interactive Deepening Time bd bm bd/2 bd bd Space bd bm bd/2 bd bd Optimality Yes No Yes Yes Yes Completeness Yes No Yes Yes Yes Informed (Heuristic) Search Strategies To solve large problems with large number of possible states, problem-specific knowledge needs to be added to increase the efficiency of search algorithms. Heuristic Evaluation Functions They calculate the cost of optimal path between two states. A heuristic function for sliding-tiles games is computed by counting number of moves that each tile makes from its goal state and adding these number of moves for all tiles. Pure Heuristic Search It expands nodes in the order of their heuristic values. It creates two lists, a closed list for the already expanded nodes and an open list for the created but unexpanded nodes. In each iteration, a node with a minimum heuristic value is expanded, all its child nodes are created and placed in the closed list. Then, the heuristic function is applied to the child nodes and they are placed in the open list according to their heuristic value. The shorter paths are saved and the longer ones are disposed. A * Search It is best-known form of Best First search. It avoids expanding paths that are already expensive, but expands most promising paths first. f(n) = g(n) + h(n), where  g(n) the cost (so far) to reach the node
  • 5.  h(n) estimated cost to get from the node to the goal  f(n) estimated total cost of path through n to goal. It is implemented using priority queue by increasing f(n). Greedy Best First Search It expands the node that is estimated to be closest to goal. It expands nodes based on f(n) = h(n). It is implemented using priority queue. Disadvantage − It can get stuck in loops. It is not optimal. Local Search Algorithms They start from a prospective solution and then move to a neighboring solution. They can return a valid solution even if it is interrupted at any time before they end. Hill-Climbing Search It is an iterative algorithm that starts with an arbitrary solution to a problem and attempts to find a better solution by changing a single element of the solution incrementally. If the change produces a better solution, an incremental change is taken as a new solution. This process is repeated until there are no further improvements. function Hill-Climbing (problem), returns a state that is a local maximum. inputs: problem, a problem local variables: current, a node neighbor, a node current <-Make_Node(Initial-State[problem]) loop do neighbor <- a highest_valued successor of current if Value[neighbor] ≤ Value[current] then return State[current] current <- neighbor end Disadvantage − This algorithm is neither complete, nor optimal. Local Beam Search In this algorithm, it holds k number of states at any given time. At the start, these states are generated randomly. The successors of these k states are computed with the help of objective function. If any of these successors is the maximum value of the objective function, then the algorithm stops. Otherwise the (initial k states and k number of successors of the states = 2k) states are placed in a pool. The pool is then sorted numerically. The highest k states are selected as new initial states. This process continues until a maximum value is reached. function BeamSearch( problem, k), returns a solution state.
  • 6. start with k randomly generated states loop generate all successors of all k states if any of the states = solution, then return the state else select the k best successors end Simulated Annealing Annealing is the process of heating and cooling a metal to change its internal structure for modifying its physical properties. When the metal cools, its new structure is seized, and the metal retains its newly obtained properties. In simulated annealing process, the temperature is kept variable. We initially set the temperature high and then allow it to ‘cool' slowly as the algorithm proceeds. When the temperature is high, the algorithm is allowed to accept worse solutions with high frequency. Start  Initialize k = 0; L = integer number of variables;  From i → j, search the performance difference Δ.  If Δ <= 0 then accept else if exp(-Δ/T(k)) > random(0,1) then accept;  Repeat steps 1 and 2 for L(k) steps.  k = k + 1; Repeat steps 1 through 4 till the criteria is met. End Travelling Salesman Problem In this algorithm, the objective is to find a low-cost tour that starts from a city, visits all cities en-route exactly once and ends at the same starting city. Start Find out all (n -1)! Possible solutions, where n is the total number of cities. Determine the minimum cost by finding out the cost of each of these (n -1)! solutions. Finally, keep the one with the minimum cost. end