Maximize g-value as secondary key in the heap comparator function in A*
implementation.