GATE 2026 DA Q.13
Which of the following algorithms is NOT an example of uninformed search?
- (A)
Breadth First Search
- (B)
Depth First Search
- (C)
A* Search
- (D)
Depth-limited Search
GATE DA
Uninformed, informed and adversarial
Search is how an agent finds a sequence of actions from a start state to a goal, and how it picks a move against an opponent. These notes give, for each algorithm, its completeness, optimality and complexity with the conditions they need, the exact procedure for tracing the order of expansion, the tests for admissible and consistent heuristics, and how to find the root value and the pruned branches in minimax and alpha-beta. Conventions (tie-breaking, when the goal test is applied, the alpha-beta cut-off) are stated so a trace can be reproduced exactly.
7 previous-year questions · 7 solved · 5 practice questions
A search problem is defined by five things: an initial state, the actions available in each state, a transition model (the state an action leads to), a goal test, and a path cost that adds up step costs. A solution is a path from the initial state to a goal state; an optimal solution has the least path cost. The search builds a tree of nodes from the initial state. Expanding a node means generating all its children; the set of generated but not yet expanded nodes is the frontier. The strategies below differ in which frontier node they expand next.
Symbols used for complexity
= branching factor (maximum number of children of a node)
= depth of the shallowest goal node (root has depth 0)
= maximum depth of the search tree (may be infinite)
= depth limit in depth-limited search
= cost of an optimal solution, = smallest step cost (assumed greater than 0)
The four properties asked about
Completeness: is a solution always found when one exists?
Optimality: is the first solution returned a least-cost one?
Time complexity: number of nodes generated.
Space complexity: maximum number of nodes held in memory at once.
Conventions used in these notes. Step costs are non-negative. Heuristic values are non-negative and . Ties between frontier nodes are broken alphabetically (by node label) unless a question says otherwise. For uniform-cost search, greedy best-first search and A* the goal test is applied when a node is expanded (removed from the frontier), not when it is generated; for uniform-cost search and A* this is what makes them optimal. For breadth-first search both rules are in use, so its complexity is given for each. In alpha-beta, the remaining children are pruned as soon as . If a question uses a different rule, follow the question.
Uninformed (blind) strategies use only the problem definition. They differ in the data structure that holds the frontier: a queue (FIFO) gives breadth-first search, a stack (LIFO) gives depth-first search, and a priority queue ordered by path cost gives uniform-cost search.
Procedure for tracing breadth-first and depth-first search
Put the start node on the frontier.
Remove the next node: the oldest one for BFS, the newest one for DFS.
With the goal test at expansion, test the removed node and stop if it is a goal. Otherwise generate its children in the stated order (alphabetical unless told otherwise).
With the goal test at generation (the early test), test each child as it is generated and stop as soon as a goal appears. The order in which nodes are expanded is the same under both rules; only the point where the search stops, and so the count of nodes, changes.
For BFS append the children at the back; for DFS push them so that the first child in the order is popped first (so push in reverse order on a stack).
Do not add a state that is already on the current path (or already visited, in graph search) if the question says so.
Algorithm | Complete? | Optimal? | Time | Space |
|---|---|---|---|---|
Breadth-first | Yes, if is finite | Yes, if all step costs are equal | with the goal test at generation; at expansion | Same as time |
Uniform-cost | Yes, if every step cost is at least and is finite | Yes | ||
Depth-first | No in tree search (infinite depth or loops); yes in graph search on a finite state space, or tree search on a finite tree | No | (tree search) | |
Depth-limited (limit ) | Yes if (finite ); no if | No | ||
Iterative deepening | Yes, if is finite | Yes, if all step costs are equal | ||
Bidirectional (BFS from both ends) | Yes, if is finite | Yes, if all step costs are equal |
BFS finds the shallowest goal, which is the cheapest only when every step costs the same. Uniform-cost search expands nodes in non-decreasing order of and so returns the cheapest goal; with zero-cost loops it can run forever, which is why is required. For BFS, the goal test at generation gives and the goal test at expansion gives , because with the late test every child of the depth- nodes expanded before the goal is also generated. Check which rule a question uses before counting nodes.
Iterative deepening runs depth-limited DFS with until a goal is found. It combines BFS's completeness and optimality (equal step costs) with DFS's linear memory. For the repeated work is small, because most nodes of a uniform tree lie at the deepest level.
NODES GENERATED BY ITERATIVE DEEPENING (WORST CASE)
Uniform tree with branching factor , goal at depth , the last iteration generating every node to depth , root counted in every iteration. Nodes at depth are generated times.
BOUND ON THE ITERATIVE-DEEPENING OVERHEAD
From the sum above with : . For the factor is 4; for it is about 1.23.
Bidirectional search runs two searches, forward from the start and backward from the goal, and stops when their frontiers meet. Each search goes only to about depth , which is where comes from. It needs a single explicit goal state and a way to compute predecessors.
EXAM TIP
DFS on a graph with cycles and no visited check can loop forever, so it is not complete even when a goal is one step away. Depth-limited search is the standard fix, but a limit below misses the goal, so it is incomplete.
Informed search uses a heuristic , an estimate of the cheapest cost from node to a goal, with . Write for the path cost from the start to found so far, and for the true cheapest cost from to a goal.
A* EVALUATION FUNCTION
A* always expands the frontier node with the smallest . Greedy best-first search uses alone; uniform-cost search is A* with .
ADMISSIBLE HEURISTIC
Never overestimates the true remaining cost. Enough for A* to be optimal in tree search, and in graph search when cheaper paths re-open expanded nodes.
CONSISTENT (MONOTONE) HEURISTIC
A triangle inequality on estimates. Every consistent heuristic is admissible; the converse is false. Along any path never decreases when is consistent.
A* procedure (graph search with re-opening of cheaper paths)
Frontier = {start}, with and .
Remove the frontier node with the smallest ; break ties alphabetically. If it is a goal, stop and return its path and cost.
Otherwise expand it. For each successor compute and .
If the successor is new, add it. If it is already on the frontier with a larger , replace it with the cheaper path. If it was already expanded with a larger , re-open it (never needed when is consistent).
Repeat.
Why A* is optimal (tree search, admissible ). Suppose the goal first removed from the frontier is a suboptimal goal with . Some node on an optimal path is still on the frontier, and because is admissible. Since , would be removed before , a contradiction. With a consistent , never decreases along a path, so nodes are expanded in non-decreasing order of . The first time a node is expanded its is already the cheapest, so graph-search A* needs no re-opening. A* then expands every node with , possibly some with , and none with . With an admissible but inconsistent the first of these can fail, because can drop along a path.
Algorithm | Orders the frontier by | Complete? | Optimal? |
|---|---|---|---|
Uniform-cost | Yes (, finite ) | Yes | |
Greedy best-first | No in tree search (can loop); yes in finite graph search with a visited set | No | |
A* | Yes (, finite ) | Yes with admissible (tree search, or graph search with re-opening); with consistent (graph search without re-opening) |
EXAM TIP
To check admissibility, compare with the true cheapest remaining cost at every node, not only on the path found. To check consistency, test every edge of the graph. One failing edge is enough to make the heuristic inconsistent.
Combining and comparing heuristics
Dominance. If for every and both are consistent, every node A* expands with and is also expanded with . Differences can arise only among nodes with , which depend on tie-breaking. So the larger heuristic expands no more nodes, apart from those ties.
If and are admissible, is admissible and dominates both. If both are consistent, so is .
The sum of two admissible heuristics need not be admissible.
A tracing question gives a small weighted graph and a table of values, and asks for the order of expansion, the number of nodes expanded, or the cost of the returned path. Keep a table with columns expanded node, frontier with and . Write the goal test result when a node is removed. Count the goal itself as expanded if the question says 'including the goal'.
WORKED EXAMPLE · A* AGAINST GREEDY BEST-FIRST ON ONE GRAPH
Directed edges with step costs: S→A 1, S→B 4, S→D 2, A→B 2, A→C 5, B→C 1, C→G 3, D→G 20. Heuristic values: , , , , , . Ties are broken alphabetically and the goal test is applied when a node is removed from the frontier. Give the expansion order and path cost for A* and for greedy best-first search, and say whether is admissible and consistent.
True remaining costs: , , , , . Every is at most , so is admissible.
Consistency edge by edge: S→A ; S→B ; S→D ; A→B ; A→C ; B→C ; C→G ; D→G . All hold, so is consistent.
A*: expand S (). Frontier: A (), B (), D ().
Expand A. B improves to , . C enters with , . Frontier: B 6, C 9, D 11.
Expand B (). C improves to , . Expand C. G enters with , . Then expand G, which is the goal.
A* order: S, A, B, C, G. Path S→A→B→C→G with cost . D is never expanded because .
Greedy uses only. Expand S; frontier A (5), B (3), D (9). Expand B (smallest ); frontier gets C (3). Expand C; G (0) enters. Expand G.
Greedy order: S, B, C, G. Path S→B→C→G with cost , which is not optimal.
Answer: A*: S, A, B, C, G with cost 7. Greedy best-first: S, B, C, G with cost 8. The heuristic is admissible and consistent.
In a two-player, turn-taking, zero-sum game with perfect information, one player (MAX) tries to maximise a utility value and the other (MIN) tries to minimise it. The game tree has MAX and MIN levels alternating. Minimax assumes both play optimally: leaf values are given by the utility (or an evaluation function at a depth cut-off), and each internal node takes the maximum (MAX node) or the minimum (MIN node) of its children's values. The value at the root is the best outcome MAX can guarantee.
MINIMAX VALUE
Two-player zero-sum game, perfect information, finite tree. The value is computed bottom-up.
MINIMAX COMPLEXITY
is the maximum depth of the game tree. Minimax is complete on a finite tree and optimal against an optimal opponent.
The minimax value is a guarantee: if MAX follows the minimax strategy, MAX gets at least the minimax value whatever MIN does. Against a weaker MIN, another move might do better for MAX, but the minimax move never gets less than its value.
Games with chance (expectiminimax). When the tree also has chance nodes (for example a dice roll), a chance node takes the probability-weighted average of its children, . MAX and MIN nodes are evaluated as in minimax. Minimax decisions are unchanged by any order-preserving change of the leaf values, but expectiminimax decisions are guaranteed unchanged only under a positive linear transformation. Plain alpha-beta does not apply to chance nodes as written, because an average cannot be bounded without bounds on the leaf values.
Alpha-beta computes exactly the same root value as minimax, and returns a best move of the same value, but skips subtrees that cannot change the answer. It carries two numbers down the tree: , the best value MAX can already guarantee on the path to the root (starts at ), and , the best value MIN can already guarantee (starts at ). Children are visited left to right, as drawn, unless the question says otherwise.
ALPHA-BETA CUT-OFF RULE
Updates: at a MAX node ; at a MIN node , where is the best child value so far. Pruning when is safe because it cannot change the root value. Some sources prune only when ; that can change the number of pruned leaves but never the root value. These notes use .
1 function ALPHABETA(node, alpha, beta, isMax)
2 if node is a leaf: return its value
3 if isMax:
4 v = -infinity
5 for each child c of node, left to right:
6 v = max(v, ALPHABETA(c, alpha, beta, false))
7 alpha = max(alpha, v)
8 if alpha >= beta: break
9 return v
10 else:
11 v = +infinity
12 for each child c of node, left to right:
13 v = min(v, ALPHABETA(c, alpha, beta, true))
14 beta = min(beta, v)
15 if alpha >= beta: break
16 return vALPHA-BETA TIME COMPLEXITY
With perfect ordering alpha-beta can look about twice as deep as minimax in the same time; with random ordering the cost is roughly . The root value is the same for every ordering; only the number of pruned leaves changes.
LEAVES EVALUATED WITH PERFECT ORDERING
Uniform game tree with branching factor , all leaves at depth , distinct leaf values, children ordered best-first for the player to move. Example: , gives leaves (all three under the first MIN child, then one under each other child).
WORKED EXAMPLE · ALPHA-BETA ON A THREE-LEVEL TREE
A MAX root has three MIN children , , , each with three leaves, in left-to-right order. : 7, 9, 4. : 3, 10, 12. : 8, 5, 9. Run alpha-beta left to right. Find the root value and the leaves that are never evaluated.
Root starts with , . At : leaves 7, 9, 4 give of 7, then 7, then 4; throughout, so no cut. . Root .
At (with ): the first leaf 3 gives and . Now , so the leaves 10 and 12 are pruned. is at most 3, so it cannot beat 4.
At (with ): leaf 8 gives ; leaf 5 gives which is above ; leaf 9 leaves . No cut. . Root .
Root value .
Leaves evaluated: 3 + 1 + 3 = 7 of 9.
Answer: Root value 5; the leaves 10 and 12 under Q are not evaluated (2 pruned leaves).
EXAM TIP
and are only ever passed down from ancestors. A cut at a MIN node uses an that some MAX ancestor already holds, and a cut at a MAX node uses a from a MIN ancestor. In a two-level tree (MAX root, MIN children whose children are leaves), nothing under the first MIN child is pruned, because there. In deeper trees, cuts can occur inside the first subtree: a MAX node below the first MIN child can be cut by that MIN node's . Never change the order of children unless told to; the number of pruned leaves depends on the order.
PREVIOUS-YEAR QUESTIONS
Try each question first, then open the answer. We placed each question under a topic ourselves; the exam paper does not label topics.
See these papers in full: GATE DA 2026 · GATE DA 2025 · GATE DA 2024
Which of the following algorithms is NOT an example of uninformed search?
Breadth First Search
Depth First Search
A* Search
Depth-limited Search
Consider the game tree for a two-player turn-taking minimax game as shown in the figure. The value of a terminal node represents the utility of the game state if the game ends there. The numbers written next to the edges denote the strategies.
There are two players MAX and MIN. At any particular state of the game, MAX prefers to move to a state of maximum value. On the other hand, MIN prefers to move to a state of minimum value.
Suppose MAX starts the game at the root and has three strategies: 1, 2 and 3. Next, MIN plays and also has three strategies: 1, 2 and 3. The game ends there. Both players always take optimal strategies throughout the game.
At the root, the best strategy for MAX is ____________ . (Answer in integer)
Tap to open full sizeA three-level game tree. The root is a MAX node (upward triangle). It has three edges labelled 1, 2 and 3 (left to right) leading to three MIN nodes (downward triangles). Each MIN node has three edges labelled 1, 2, 3 (left to right) leading to terminal nodes (upward triangles). Terminal values under the first MIN node (edge 1 from root): 8, 6, -1. Under the second MIN node (edge 2): 1, 5, 7. Under the third MIN node (edge 3): -4, -3, -12. Level labels MAX (root) and MIN (middle) are written at the left.
Consider game trees Tree-1 and Tree-2 as shown. The first level is a MAX agent and the second level is a MIN agent. The value in the square node is the output of the utility function.
For what ranges of and , the right child of node and the right child of node will be pruned by alpha-beta pruning algorithm?
Tap to open full sizeTwo game trees. Tree-1: root A (circle, MAX level) has two children: a left leaf (square) with value 2, and a right child B (circle, MIN level). B has two children: a left leaf with value x and a right leaf with value 1 (joined to B by a dotted edge, meaning it is the branch to be pruned). Tree-2: root C (circle, MAX level) has two children, D (circle) and E (circle), both at the MIN level. D has two leaf children with values 5 and y. E has a left leaf child with value 2 and a right child drawn as a triangle (a subtree) joined to E by a dotted edge, the branch to be pruned.
and
and
and
and
The state graph shows the action cost along the edges and the heuristic function h associated with each state. Suppose A* algorithm is applied on this state graph using priority queue to store the frontier. In what sequence are the nodes expanded?
Tap to open full sizeDirected graph. Edges with costs: S->A (4), S->E (1), A->B (2), B->C (2), E->C (2), C->D (3), D->G (3). Heuristic values in boxes: A h=2, B h=2, C h=6, D h=2, G h=0, E h=6. S has no heuristic printed. S is the start and G the goal.
S,A,E,C,B,D,G
S,E,A,C,B,D,G
S,A,E,B,C,D,G
S,A,B,E,C,D,G
Let and be two admissible heuristics used in search.
Which ONE of the following expressions is always an admissible heuristic?
Consider the following statement:
In adversarial search, - pruning can be applied to game trees of any depth where is the (m) value choice we have formed so far at any choice point along the path for the MAX player and is the (n) value choice we have formed so far at any choice point along the path for the MIN player.
Which ONE of the following choices of (m) and (n) makes the above statement valid?
(m) = highest, (n) = highest
(m) = lowest, (n) = highest
(m) = highest, (n) = lowest
(m) = lowest, (n) = lowest
Consider a state space where the start state is number 1. The successor function for the state numbered returns two states numbered and . Assume that the states in the unexpanded state list are expanded in the ascending order of numbers and the previously expanded states are not added to the unexpanded state list.
Which ONE of the following statements about breadth-first search (BFS) and depth-first search (DFS) is true, when reaching the goal state number 6?
BFS expands more states than DFS.
DFS expands more states than BFS.
Both BFS and DFS expand equal number of states.
Both BFS and DFS do not reach the goal state number 6.
PRACTICE
A tree has finite branching factor , every step costs 1, and the shallowest goal is at depth . Which statement about iterative deepening depth-first search on this tree is correct?
It is complete and optimal, with time and space .
It is complete but not optimal, because it uses depth-first search.
It is optimal, but its space requirement is .
It is not complete because the depth limit may be too small.
Answer: (A)
Iterative deepening tries limits , so it reaches the limit eventually and finds a goal: complete.
It finds the goal with the smallest depth first, and with unit step costs the shallowest goal is the cheapest: optimal.
Each iteration is a depth-first search that stores only one path and its siblings, so space is .
For fixed the repeated work multiplies the node count by less than , a constant, so time is . Hence A.
In a uniform tree with branching factor 2 the shallowest goal is at depth 3. Iterative deepening runs depth-limited searches with limits 0, 1, 2 and 3. In each iteration count every node of the tree up to the current limit once (the root included), and assume the last iteration generates all nodes up to depth 3. What is the total number of nodes generated over all iterations?
Answer:
Nodes up to each limit: limit 0 gives 1; limit 1 gives ; limit 2 gives ; limit 3 gives .
Total .
Check with the formula: .
Which of the following statements about heuristics for A* search are TRUE? Here for every heuristic.
Every consistent heuristic is admissible.
Every admissible heuristic is consistent.
If is consistent, the -values of the nodes along any path from the start never decrease.
Greedy best-first search with an admissible heuristic always returns an optimal path.
Answer: (A), (C)
A is true: apply consistency along an optimal path to a goal and add the inequalities; the sum telescopes to because .
B is false. Example: edges costing 1 and costing 3, with , , . Then and , so is admissible, but , so it is not consistent.
C is true: by the consistency inequality.
D is false: greedy ignores , so it can return a costlier path even when is admissible (the worked example gives cost 8 against the optimum 7). Answer A and C.
Directed edges with step costs: S→A 2, S→B 3, A→C 4, B→C 1, B→G 9, C→G 2. Heuristic values: , , , , . A* graph search is run from S to G, replacing a frontier entry when a cheaper path to the same node is found and breaking ties alphabetically. What is the cost of the path that A* returns?
Answer:
Expand S (): A has , ; B has , .
Expand A (tie with B, alphabetical): C has , .
Expand B (): C improves to , ; G enters with , .
Expand C (): G improves to , .
Expand G, the goal. Its path is S→B→C→G with cost . The heuristic is admissible and consistent (true costs: , , , ; every edge satisfies the consistency inequality), so 6 is optimal.
A MAX root has two MIN children, L and R. L has two MAX children (leaves 5, 3) and (leaves 6, 9). R has two MAX children (leaves 3, 4) and (leaves 7, 2). Leaves are visited left to right and children are visited in the order given. Using alpha-beta pruning, which pair gives the root value and the number of leaves that are NOT evaluated?
Root value 5; 3 leaves not evaluated
Root value 5; 2 leaves not evaluated
Root value 4; 3 leaves not evaluated
Root value 6; 1 leaf not evaluated
Answer: (A)
Left MIN node L, , . : leaves 5 and 3 both evaluated, , so .
with : first leaf 6 gives , so the leaf 9 is pruned (1 leaf). . Root .
Right MIN node R with . : leaves 3 and 4 are evaluated (a MAX node cuts only when ), so and .
Now , so is pruned entirely: leaves 7 and 2 (2 leaves).
Root . Leaves not evaluated: . Answer A.
OFFICIAL GATE 2027 SYLLABUS WORDING
Copied from the GATE 2027 syllabus; see all 2027 syllabi.
GATE DA
Search: informed, uninformed, adversarial
Preparing in Kolkata? IAE Academy's course for GATE DA.