NNAI
NNAI
NNAI
FOR WOMEN
Applications of AI
Police use computer software that can recognize the face of criminal with
the stored portrait made by forensic artist.
BFS can be used to find the neighboring locations from a given source
location.In a peer-to-peer network, BFS algorithm can be used as a traversal
method to find all the neighboring nodes. Most torrent clients, such as
BitTorrent, uTorrent, etc. employ this process to find "seeds" and "peers" in
the network.
BFS can be used in web crawlers to create web page indexes. It is one of the
main algorithms that can be used to index web pages. It starts traversing
from the source page and follows the links associated with the page. Here,
every web page is considered as a node in the graph.BFS is used to
determine the shortest path and minimum spanning tree.BFS is also used in
Cheney's technique to duplicate the garbage collection.It can be used in ford-
Fulkerson method to compute the maximum flow in a flow network.
A standard BFS implementation puts each vertex of the graph into one of
two categories:
1. Visited
2. Not Visited
1. Start by putting any one of the graph's vertices at the back of a queue.
2. Take the front item of the queue and add it to the visited list.
3. Create a list of that vertex's adjacent nodes. Add the ones which aren't in
the visited list to the back of the queue.
4. Keep repeating steps 2 and 3 until the queue is empty.
The graph might have two different disconnected parts so to make sure that
we cover
EXPERIMENT 4
AIM: Write a program to implement inform A* search method.
THEORY
A-star (also referred to as A*) is one of the most successful search
algorithms to find the shortest path between nodes or graphs. It is
an informed search algorithm, as it uses information about path cost
and also uses heuristics to find the solution.
Node (also called State) — All potential position or stops with
a unique identification
Transition — The act of moving between states or nodes.
Starting Node — Whereto start searching
Goal Node — The target to stop searching.
Search Space — A collection of nodes, like all board
positions of a board game
Cost — Numerical value (say distance, time, or financial
expense) for the path from a node to another node.
g(n) — this represents the exact cost of the path from the
starting node to any node n
h(n) — this represents the heuristic estimated cost from node
n to the goal node.
f(n) — lowest cost in the neighboring node n
Each time A* enters a node, it calculates the cost, f(n)(n being
the neighboring node), to travel to all of the neighboring
nodes, and then enters the node with the lowest value of f(n).
IMPLEMENTATION
OUTPUT
EXPERIMENT 5
AIM: Write a program to implement a Tic-Tac-Toe game.
THEORY
Tic Tac Toe is a very common two player mind game. It is liked by people of
all age groups. Its working is very simple. A play area of 3X3 boxes is defined.
The player who first marks any row or column or diagonal of three boxes with
his symbol(O or X) wins the game. It is not that difficult to code either. In this
post we will share Tic Tac Toe Python Code with you and explain the logic of
this code.