In such a case, A* is guaranteed to find the best sequence.
we start with the naive (but admissible) heuristic as follows the heuristic of node y t to the end is the sum of max edge scores between any two positions and max node scores per position.