An exact solver for tree genetics optimization problems