What does "machine learning" mean here? How does the algorithm guarantee the trip is optimal?
Unless the problem is very constrained, there usually is no guarantee of optimality; here there is probably no guarantee of optimality. It might be "locally" optimal, in that there might be no better trip that differs from this one by only a tiny bit.
And, no, "machine learning" here doesn't mean the enterprise and establishment of "Machine Learning", just some algorithm that the author used.