 It's necessary and sufficient for a heuristic to obey the triangle inequality in order to be consistent.In the A* search algorithm, using a consistent heuristic means that once a node is expanded, the cost by which it was reached is the lowest possible, under the same conditions that Dijkstra's algorithm requires in solving the shortest path problem (no negative cost cycles).In fact, if the search graph is given cost formula_13 for a consistent formula_14, then A* is equivalent to best-first search on that graph using Dijkstra's algorithm.