00:01
Hello students, so here three problems are given.
00:03
8 puzzle problem is given, second one is given 8 queen problem and the third one is given xor problem.
00:13
So here solving this problem using a general searching algorithm in ai typically involves implementing search algorithms such as dfs, bfs and a star search.
00:23
So here first i am taking the 8 puzzle problem.
00:26
The 8 puzzle problem is a sliding puzzle game with 3 into 3 grids and one empty tile.
00:33
The goal is to rearrange the tiles from the initial state to the target.
00:37
Here is a high level approach.
00:40
So here i am just writing the pseudocode defining the initial state and the target state.
00:46
So we have to first define the initial and then the target implementing a search algorithm.
00:50
Here i am using bfs, dfs or a star to explore the possible move because i have to do the searching here.
00:58
So in bfs manner, in dfs manner or a star.
01:01
So generate the successor state by moving the empty tile.
01:05
So now i have to take the move either up, down, left or right.
01:11
So here up, down, left or right.
01:15
Keep the track of the visited state to avoid the revisiting because we have to visit only once.
01:21
So we have to keep the track and after this continue the searching until you find the target state.
01:28
So here until we find the target state, we have to keep our searching.
01:34
So in this way we can find, we can solve our 8 puzzle problem.
01:40
So i have written all the steps.
01:42
Now take the second problem which is 8 queen problem.
01:45
The 8 queen problem is to place the 8 queen on a chessboard such that no two queen threatens each other.
01:53
So we have to keep the queen in such a way so there is no attack row wise, no attack column wise, no attack diagonally.
02:04
So we have to keep the queen in such a way.
02:09
So here i have written the steps.
02:14
Initialize an empty chessboard.
02:16
So depend on the chessboard 4x4, 8x8...