Comparison of BFS, DFID, A* and IDA* algorithms on the 15-Puzzle Problem.
The 15 puzzle is a sliding puzzle having 15 square tiles numbered 1–15 in a 4x4 frame, leaving one unoccupied tile.
Tiles in the same row or column of the open position can be moved by sliding them horizontally or vertically.
Given state of the puzzle is known as the initial state. And the ordering of tiles required to achieve is called the final state/goal state.
BFS is a method used for traversing a graph. It starts at any item we want to use as a starting position in a graph, and explores all of the neighbour items at the present depth before moving on to the items at the next depth level.
Let G be a graph with starting node S and Final node F. Let Q be a queue.
DFID is a state space or graph search strategy in which a depth-limited version of Depth First Search (DFS) is run repeatedly with increasing depth limits until the goal is found.
Let G be a graph with starting node S and Final node F. Let Q be a priority queue of nodes. Let depth allowed be D.
A* is a graph traversal and path search algorithm. Peter Hart, Nils Nilsson and Bertram Raphael of Stanford Research Institute (now SRI International) first published the algorithm in 1968. It can be seen as an extension of Dijkstra's algorithm. A* achieves better performance by using heuristics to guide its search.
Let G be a graph with starting node S and Final node F. Let Q be a priority queue of nodes. Let h(S) be the heuristic value (f(n) = g(n) + h(n)) of S, g(S) = 0.
IDA* is a graph traversal and path search algorithm that can find the shortest path between a designated start node and any member of a set of goal nodes in a weighted graph. It is a variant of DFID search that borrows the idea to use a heuristic function to evaluate the remaining cost to get to the goal from the A* search algorithm
Let G be a graph with starting node S and Final node F. Let Q be a priority queue of nodes. Let h(S) be the heuristic value (f(n) = g(n) + h(n)) of S, g(S) = 0. Suppose B be the initial bound on heuristic.
Let G be a graph having starting node S and goal node G. Let the average branching factor be ‘b’ and the depth of G from S be ‘d’.
Time Complexity, T(n) = O(bd)
Space Complexity, S(n) = O(bd)
Completeness : Yes
Optimality : Yes
Time Complexity, T(n) = O(bd)
Space Complexity, S(n) = O(bd)
Completeness : Yes
Optimality : Yes
Time Complexity, T(n) = O(bd)
Space Complexity, S(n) = O(bd)
Completeness : Yes
Optimality : Yes
Time Complexity, T(n) = O(bd)
Space Complexity, S(n) = O(bd)
Completeness : Yes
Optimality : Yes