AI Unit 2
AI Unit 2
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.
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
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.
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
a. A*Search
b. Greedy Best First 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