I\'m not sure how to solve this with a heuristic algorithm. It is a type that I don\'t understand very well. Code will be written in Java.
An a() algorithm that takes