The path cost of a search node is the sum of step costs along the action history that reaches it:The same physical state can have different path costs when reached through different histories. Uniform-cost search orders nodes by accumulated path cost; A-star search adds a heuristic function estimating the remaining cost.
New to topics? Read the docs here!