Professional Documents
Culture Documents
net/publication/364921310
CITATION READS
1 1,469
3 authors, including:
All content following this page was uploaded by Ayesha Shafique on 30 October 2022.
Abstract:
Solving a problem entail seeking the best solution among those available. In computer science and artificial
intelligence, finding a solution to a problem is prevalently thought of as a process of searching through space for
possible solutions. In Engineering and Mathematics, on the other hand, it is thought of as an optimization process,
determining the most effective or optimal solution to a problem. These narrow the search space and increase its
efficiency. It chooses which has the least futility at each step of the search. In this paper, we classify the various
AI search and optimization techniques based on their pros and cons. To make it easier to select a technique for a
specific problem.
1. INTRODUCTION
Artificial intelligence is the intelligence of machines
and the branch of computer sciences that aims to create
it. Many authors have different perceptions of AI like.
i. It is the science and engineering of making
intelligent machines, especially intelligent computer
programs. It is related to the similar task of using
computers to understand human intelligence, but AI
does not have to confine itself to methods that are
biologically observable [1].
Figure 1 Artificial Intelligence Trends
ii. The study and design of intelligence agents [2].
Where an intelligent agent is a system that perceives 1.1 Search and Artificial Intelligence:
its environment and takes action that maximizes its
chances of success [3]. The last 50 years of research witnessed the
iii. As a system that thinks like humans: - This is the development of a large number of AI tools for solving
exciting new effort to make computers think --- the most difficult problems in computer science and
machines with minds, in the full and literal sense. The engineering. These tools are; Search and optimization,
automation of activities that we associate with human Logic, Probabilistic methods for uncertain reasoning,
thinking, activities such as decision-making, problem- Classifiers and statistical learning methods, Neural
solving, and learning --- [4]. networks, Control theory, and, Languages.
iv. As a system that acts like a human: - This is the act Search algorithms are being used for a multitude of AI
of creating machines that perform functions that tasks, one of which is pathfinding. The field of search
require intelligence when performed by people. Also, in AI is closely connected to real-world problem-
it is the study of how to make computers do things at solving. AI has researched search methods for solving
which at the moment, people are better [5]. path-planning problems in large domains. After
v. As a system that thinks rationally: - this is the study formulating problems, we must solve them, which is
of mental faculties, through the use of computational accomplished by searching through the state space
models [6]. during this process.
1|Page
2.2 AI-Powered Search:
2|Page
which is most promising at that moment, it will not The uninformed and informed search strategies which
consider the optimum path to reach the goal. are considered in this research paper has evaluated
based on the following four criteria: completeness,
2.2.2 Heuristic or Informed Search Method:
optimality, time complexity, and space complexity.
Informed search is the Heuristic search that uses a
heuristic function (To estimate how close a given state Completeness: This property intends to check
is from the goal state) to solve a problem. The whether the algorithm guarantees to find the solution
informed search uses to generate and test the approach. to the problem if any exists.
It includes hill climbing, A*, AO*, Best First Search, Optimality: This property investigates whether or not
and Greedy Best First Search algorithms. An informed the strategy provides the optimal solution.
search is more efficient than an uninformed search. In
informed search heuristic function is used as a model Time complexity: This property evaluates the time
that will lead us to the goal state. The informed search required to find the solution to the problem.
will not traverse the search tree blindly. It will
consider the next node to traverse based on some Space complexity: This property evaluates the
evaluation function (Heuristic Function) to reach the memory, and space required to run the search
goal state from the current state. algorithm.
3|Page
3.1.1 Implementation 3.1.5 Evaluation of Algorithm
The breadth-first search has the following properties:
3.1.2 Advantages
The breadth-first search always finds a solution to the
problem if any exists. If the problem has more than one
solution, then the algorithm finds the solutions in
ascending order of their costs which means that the
cheapest solution will be found first. Since this search
strategy is traversal, a situation where the algorithm Figure 3.1.2 Evaluation of Breath First Search
will explore a branch that is indefinitely deep can
never occur. 3.2 Depth First Search
3.1.3 Disadvantages Depth-first search removes the space limitation of
breadth-first and uniform-cost search by always
The main drawback of breadth-first search is its
generating next a child of the deepest unexpanded
memory requirement. Since each level of the tree must
be stored to generate the next level, and the amount of node. BFS and DFS - Both algorithms can be
memory is proportional to the number of nodes stored, implemented using a list of unexpanded nodes, with
the space complexity of the breadth-first search is also the difference that breadth-first search manages the list
O(bd). As a result, breadth-first search is severely as a first-in-first-out queue, whereas depth-first search
space-bound in practice and will exhaust the memory treats the list as a last-in-first-out stack. More
available on typical computers in a matter of minutes. commonly, depth-first search is implemented
recursively, with the recursion stack taking the place
3.1.4 Applications & Limitations
of an explicit node stack.
Breadth First Search is used for:
3.2.1 Implementation:
For unweighted graph minimum spanning
tree and shortest path.
Shared network.
Social Networking Websites.
Global Positioning System Navigation
systems.
For testing whether the graph is bipartite or
not.
4|Page
3.2.2 Advantages:
The advantage of depth-first search is that its space
requirement is only linear in the maximum search
depth, as opposed to exponential for breadth-first
search. The reason is that the algorithm only needs to
store a stack of nodes on the path from the root to the
current node. The time complexity of a depth-first
search to depth d is O(bd) since it generates the same
set of nodes as a breadth-first search, but simply in a
different order. Thus, as a practical matter, depth-first
search is time-limited rather than space-limited.
3.2.3 Disadvantage:
The primary disadvantage of the depth-first search is
that it may not terminate on an infinite tree, but simply
go down the left-most path forever. For example, even
though there are a finite number of states in the eight-
game puzzle, the tree fragment shown in Figure 2.1
can be infinitely extended down any path, generating
an infinite number of duplicate nodes representing the Figure 3.2.2 Evaluation of Depth First Search
same states. The usual solution to this problem is to
impose a cutoff depth on the search. Although the
3.3 Depth Limited Search
ideal cutoff is the solution depth d, this value is rarely Depth-first search removes the space limitation of
known in advance of actually solving the problem. If breadth-first and uniform-cost search by always
the chosen cutoff depth is less than d, the algorithm generating next a child of the deepest unexpanded
will fail to find a solution, whereas if the cutoff depth node. Both algorithms can be implemented using a list
is greater than d, a large price is paid in execution time, of unexpanded nodes, with the difference that breadth-
and the first solution found may not be an optimal one. first search manages the list as a first-in-first-out
queue, whereas depth-first search treats the list as a
3.2.4 Applications & Limitations last-in-first-out stack. More commonly, depth-first
search is implemented recursively, with the recursion
Depth First Search is used for: stack taking the place of an explicit node stack.
Identifying loops in a graph. 3.3.1 Implementation
Identifying components that are strongly
connected in a graph.
Finding the solution to the puzzle in which
only one solution exists.
Memory is limited.
The order of the neighbors of a node added to
the stack can be tuned so that solutions are
found on the first attempt.
It is a poor technique when it is conceivable
to get captured in endless ways, this happens
when the graph is endless or at the point when
there are cycles in the graph.
5|Page
3.3.2 Advantages 3.2 Iterative Deepening Search
Depth-limited search is more efficient than Depth First This search method is also known as iterative
search, using less time and memory. If a solution deepening depth-first search. The method is a
exists, the Depth First search guarantees that it will be combination of two search techniques: the breadth-
found in a finite amount of time. To address the first search and the depth-first search. The limit of the
drawbacks of the Depth First search, we set a depth depth is changed iteratively to best fit the problem
limit and run our search technique repeatedly through definition and the goal sought.
the search tree.
3.4.1 Implementation:
3.3.3 Disadvantages
For this method to work, it must have a depth limit. If
the target node does not exist inside the chosen depth
limit, the user will be forced to iterate again, increasing
execution time. If the goal node does not exist within
the specified limit, it will not be discovered.
3.4.2 Advantages
When the solutions are found at the lower depths say
n, then the algorithm proves to be efficient and in time.
The great advantage of iterative deepening depth-first
search is found in-game tree searching where the
iterative deepening depth-first search operation tries to
improve the depth definition, heuristics, and scores of
searching nodes so as to enable efficiency in the search
algorithm. Another major advantage of the iterative
deepening depth-first search is its quick
responsiveness.
3.4.3 Disadvantages
Figure 3.3.2 Evaluation of Depth Limited Search The time taken is exponential to reach the goal node.
The main problem with iterative deepening depth-first
6|Page
search is the time and wasted calculations that take from the root, uniform-cost search expands nodes in
place at each depth. The situation is not as bad as we order of their cost from the root. At each step, the next
may think of especially when the branching factor is node n to be expanded is one whose cost g(n) is lowest,
found to be high. When we are to find multiple where g(n) is the sum of the edge costs from the root
answers from the iterative deepening depth-first to node n. The nodes are stored in a priority queue.
search, it gives back the success nodes and its path This algorithm is similar to Dijkstra’s single-source
once even if it needs to be found again after multiple shortest-path algorithm.
iterations. To stop the depth bound is not increased
further. 3.5.1 Difference in UCS & Dijkstra
3.4.4 Applications & Limitation The main difference is that uniform-cost search runs
until a goal node is chosen for expansion, while
Iterative Deepening Search is used for:
Dijkstra’s algorithm runs until every node in a finite
Artificial Intelligence and Data Science- graph is chosen for expansion. Whenever a node is
analyzing network chosen for expansion by uniform-cost search, the
Puzzle-solving with a unique solution lowest-cost path to that node has been found. The
(example: sudoku) worst-case time complexity of the uniform-cost search
Detecting cycle in a graph. is O(bc/e), where c is the cost of an optimal solution,
Sorting Directed Acyclic Graph (DAG) and e is the minimum edge cost. Unfortunately, it also
N- Queens problem suffers the same memory limitation as breadth-first
search.
Iterative deepening search is applicable when:
3.5.2 Implementation:
BFS is valid
7|Page
node to the end node. Due to the least path being 3.6 Bidirectional Search
followed at each state, It is considered an optimal
solution.
3.5.4 Disadvantages
You are required to keep the empty list sorted as
priorities in the priority queue need to be protected.
The storage requirement is hilariously large. You are
to stop it from going on an infinite loop as it considers
every possible path going from the start node to the
end node. Figure 3.6 Semantic View of Bidirectional
Search
3.5.5 Applications & Limitations
Uniform Cost Search is used for: In this method, the search has a running technique in
two directions. Indeed, two searches run
Solving Maze problem. simultaneously. One of them is done in a forward
Pathfinding. direction from the initial state, and another one is done
backward from the goal state. The aim is that these
Uniform Cost Search is applicable when: two searches should join midway. The motivation for
implementing such a search method is the following:
Space requirement is less. if a search algorithm requires a complexity of “bd” to
Intelligence is not required or when reach the goal, splitting it into two sub-algorithms will
evaluation function (Heuristic function) is require “bd/2 + bd/2” of complexity which is
not required. significantly less than “bd”, especially when the values
3.5.6 Evaluation of Algorithm of b and d increase. The goal is used as the starting
state of the backward search. Therefore, the goal test
Uniform Cost Search Algorithm has the following is replaced by a flag with the rule to check whether two
properties: searches have expanded up to their intersection point.
Although the bidirectional search seems to be good in
terms of complexity, difficulties occur in
implementing the backward search.
3.6.1 Implementation
3.6.2 Advantages
For instance, for the branching factor b = 8 and depth
d = 4, the breadth-first search needs time which is
proportional to 84 = 4096 whereas the bidirectional
search is more effective because of time which is
Figure 3.5.2 Evaluation of Uniform Cost Search proportional to 2*82 = 128 to reach the goal.
8|Page
3.6.3 Disadvantages to be chosen should have lowest value of the heuristic
function f (n) .
It is also to note that a bidirectional search is not
practical for use if the value of d is large. 4.1.1 Implementation
3.6.4 Evaluation of Algorithm
Bidirectional search has the following properties:
9|Page
It can behave as an unguided depth-first
search in the worst-case scenario.
This algorithm is not optimal.
10 | P a g e
4.2.5 Evaluation of Algorithm 4.3.2 Advantages
It potentially reduces the computation and hence, the
time of search. The memory consumption of beam
search is far less than other search algorithms.
4.3.3 Disadvantages
The search may not result in an optimal goal and may
not result in a goal at all. It’s biggest disadvantage is
that it has potential to be incomplete.
4.3.1 Implementation
11 | P a g e
the weights of the edges to find the path that minimizes 4.4.5 Evaluation of Algorithm
the total distance (weight) between the source node
and all other nodes. It expands outwards from the
starting point until it reaches the goal.
4.4.1 Implementation
The main advantage of Dijkstra's algorithm is its 4.5 Hill Climbing Algorithm
considerably low complexity, which is almost linear.
It has an order of n2 so it is efficient enough to use for Hill climbing is a mathematical optimization
relatively large problems. technique in computer science that belongs to the local
search family. The Hill climbing algorithm is a local
4.4.3 Disadvantages search algorithm that moves in the direction of
It does a blind search there by consuming a lot of time increasing elevation/value to find the mountain's peak
waste of necessary resources. Another disadvantage is or the best solution to the problem. It ends when it
that it cannot handle negative edges. This leads to reaches a maximum value for which no neighbor has
acyclic graphs and most often cannot obtain the right a higher value. A node in a hill climbing algorithm has
shortest route. two components: state and value. When a good
heuristic is available, hill climbing is commonly used.
4.4.4 Applications & Limitations We don't need to maintain and handle the search tree
or graph in this algorithm because it only keeps a
Dijkstra’s Algorithm is used in:
single current state. It does not retrace the search space
It is used in finding Shortest Path. because it does not remember previous states.
It is used in geographical Maps.
Heuristic Function
To find locations of Map which refers to
vertices of graph.
Distance between the location refers to edges.
It is used in IP routing to find Open shortest
Path First.
It can't give proper result for the graphs Figure 4.5 Heuristic Function
having negative weighed edges.
This leads to acyclic graphs and most often A heuristic function is one that ranks all possible
cannot obtain the right shortest path. alternatives based on the available information at any
branching step in the search algorithm. It assists the
12 | P a g e
algorithm in selecting the best route from among those pure optimization problems in which the goal is to find
available. the best state given the objective function.
Plateau
Ridge
Figure 4.5.1 Graphical Representation of Hill Climbing
Algorithm Because movement is downward in all directions, any
point on a ridge can appear to be a peak. As a result,
Local maximum: It is a state that is better than its the algorithm terminates when it reaches this state.
neighboring state, but there is another state that is
better than it (global maximum). This state is To overcome Ridge, use two or more rules before
preferable because the objective function's value is testing. It implies moving in several directions at the
higher here than in its neighbors. same time.
Global Maxima: The best possible state in the state 4.5.4 Applications
space diagram is called the global maximum. This is Hill Climbing Algorithm is used in:
because the objective function has the highest value at
this stage. Hill climbing is commonly used in robotics
to assist their systems in working as a team
Local maximum plateau/flat: It is a flat region of
and maintaining coordination.
state space in which adjacent states have the same
The algorithm can be useful in team
value.
management in various marketing domains
Ridge: A region that is higher than its neighbors but where hill climbing can be used to find an
has a slope to it. It is a particular type of local optimal solution. This algorithm can be used
maximum. to optimise a sales member's travel time or
the places he visits per day.
4.5.2 Advantages
4.6 A* Algorithm
Hill climbing can be used in both continuous and
domain contexts. This method is extremely useful in The A* Search algorithm is one of the most effective
job shop scheduling, automatic programming, circuit and widely used techniques in pathfinding and graph
design, and vehicle routing. It is also useful in solving traversal. Informally, unlike other traversal
techniques, A* Search algorithms have "brains." It is
13 | P a g e
a smart algorithm, which distinguishes it from other which A* search is executed is highly dependent on
conventional algorithms. It is also worth noting that the accuracy of the heuristic algorithm used to
many games and web-based maps use this algorithm compute h(n). It does not always find the shortest path
to efficiently find the shortest path. This makes A* because it relies heavily on heuristics and
intelligent and puts it far ahead of traditional approximation. There are some complexity issues with
algorithms. The most well-known type of best-first the A* search algorithm. The main disadvantage of A*
search is A* search. It employs the heuristic function is its memory requirement, as it keeps all generated
h(n) and the cost to reach the node n from the initial nodes in memory, making it unsuitable for a variety of
state g(n). large-scale problems.
It combines UCS and greedy best-first search features 4.6.4 Applications & Limitations
to efficiently solve the problem. The heuristic function
A* Algorithm is used in:
is used by the A* search algorithm to find the shortest
path through the search space. This search algorithm It is used to determine the shortest path. You
expands fewer search trees and returns optimal results can use this to find a path to the goal for each
more quickly. The A* algorithm is similar to the UCS enemy. One example is the extremely
algorithm except that it uses g(n)+h(n) instead of g(n), popular game Warcraft III.
and the sum of these two numbers is known as the It can be used in map-based applications as a
fitness number. path-finding algorithm.
4.6.1 Implementation This can also be used by string searching
applications to determine the goal state. NLP
We can use any data structure to implement open list uses this to check for parsing errors.
and closed list but for best performance, we use a set
data structure of C++ STL (implemented as Red-Black It’s not reliable in some as:
Tree) and a Boolean hash table for a closed list. The
Despite being the best path finding algorithm
implementations are similar to Dijkstra’s algorithm
available, A* Search Algorithm does not
except we add in a heuristic. If we use a Fibonacci
always produce the shortest path because it
heap to implement the open list instead of a binary
heavily relies on heuristics / approximations
heap/self-balancing tree, then the performance will
to calculate - h
become better (as Fibonacci heap takes O (1) average
time to insert into open list and to decrease key). 4.6.5 Evaluation of Algorithm
4.6.2 Advantages
The A* search algorithm outperforms all other search
algorithms. The search algorithm A* is both optimal
and complete. This algorithm can resolve extremely
complex problems.
4.6.3 Disadvantages
If the branching factor is finite and every action has a Figure 4.6.2 Evaluation of A* Algorithm
fixed cost, this algorithm is complete. The speed with
14 | P a g e
4.6.1 8 Puzzle Game & A* The game principle is described as follows: there are 8
sliding tiles which are numbered by digits from 1 to 8
A* search technique is also used to solve the 8-puzzle
to be located in an array with three rows and three
game. This game was invented by Loyd in 1870. The
columns; the number 0 represents the empty cell
8-puzzle game is a well-known game used for the
(blank space), and any numbered tile can slide into an
evaluation and showcase of the power of Artificial
empty sell. It means that the digit 0 can simply be
Intelligence in general and search methods in
replaced by the void. The initial state is made by a
particular.
random positioning of the digits and the goal state is
usually defined in a way that the numbers from 1 to 8
can be read in ascending or descending order,
following a unique direction. The number of different
possible configurations the 8-puzzle game is equal to
9!=362880. The number of accessible state
configurations in 8-puzzle game is just half of 9!; in
other words 9!/2 is the number of solvable (reachable)
configurations in 8-puzzle sliding game.
4.7.1 Implementation
15 | P a g e
4.7.2 Advantages 4.8.1 Implementation
It is the best algorithm. If you traverse according to the To be honest, it doesn't really matter in terms of data
node ordering. It can be applied to both the OR and structures because the cost of managing the tree is
AND graphs. It is an easy-to-understand step-by-step negligible in comparison to the cost of everything else
representation of a solution to a given problem. An in a branch-and-bound algorithm, particularly in C++.
algorithm follows a specific procedure. It is not Only when solving 1-2 variable problems will you
dependent on any programming language, making it notice the cost of sorting or inserting nodes, and even
simple to understand even for those with no then, it will be very small.
programming experience. Each step in an algorithm
has its own logical sequence, making debugging
simple. Because the problem is broken down into
smaller pieces or steps by using an algorithm, it is
easier for a programmer to convert it into an actual
programme.
4.7.3 Disadvantages
Algorithms take time to develop. It is difficult to
demonstrate Branching and Looping in Algorithms.
Algorithms struggle to handle large tasks. It can't
always find the best path for unsolvable nodes. Its
complexity is greater than that of other algorithms.
16 | P a g e
View publication stats
4.8.4 Applications & Limitations * ‘m‘ – maximum depth state space(maybe infinity)
17 | P a g e