A* algorithm uses f' = g + h' to estimate the cost of getting from the initial…

2012

A* algorithm uses f' = g + h' to estimate the cost of getting from the initial state to the goal state, where g is a measure of the cost of getting from initial state to the current node and the function h' is an estimate of the cost of getting from the current node to the goal state. To find a path involving the fewest number of steps, we should set

Answer: A. g = 1Concept: In A*, the evaluation function f' = g + h' ranks nodes for expansion, where g is the cost already accumulated along the path from the start node to…

  1. A.

    g = 1

  2. B.

    g = 0

  3. C.

    h' = 0

  4. D.

    h' = 1

Attempted by 37 students.

Show answer & explanation

Correct answer: A

Concept: In A*, the evaluation function f' = g + h' ranks nodes for expansion, where g is the cost already accumulated along the path from the start node to the current node, and h' is the estimated cost still remaining from that node to a goal.

The value of g is decided entirely by the cost we attach to each move. Whatever quantity an edge is made to cost is the quantity the search accumulates in g, and therefore the quantity it minimises along the path it finally returns.

Application to this question:

  1. The requirement is the fewest number of steps, that is, the smallest count of moves on the path.

  2. The count of moves on a path is exactly the sum of 1 taken once for each move made.

  3. So make every move cost the constant 1, that is, set g = 1 per move. Then g at any node equals the number of moves made to reach that node from the initial state.

  4. Minimising f' = g + h' now minimises that move count, so A* returns the path with the fewest steps. Hence we should set g = 1.

Cross-check against the other settings:

  • g = 0 erases the accumulated term and leaves f' = h', so the search becomes greedy best-first and keeps no record of how long the path already is.

  • h' = 0 erases the estimate and leaves f' = g, so A* degenerates to uniform-cost search, which minimises accumulated cost without fixing how that cost counts steps.

  • h' = 1 adds the same constant to every node, and a constant shifts all f' values equally, so it changes no ordering at all.

Setting g = 1, a constant unit cost per move, is what makes A* minimise the number of steps; setting g to the true edge cost instead makes it minimise the total path cost.

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…