Costs of walks and closed walks #
The traveling salesman modules measure a route through a cost function δ : α → α → W in two
ways: walkCost δ a L b is the cost of the walk from a through the entries of L in order to
b, and cycleCost δ t is the cost of the closed walk visiting the entries of t in order and
returning to the first. A closed walk is a walk from its first vertex back to itself
(cycleCost_cons), and its cost does not depend on the starting point (cycleCost_rotate).
Main definitions #
Cslib.Algorithms.Lean.TSP.walkCost: the cost of a walk through a list of vertices.Cslib.Algorithms.Lean.TSP.cycleCost: the cost of a closed walk.
Main results #
walkCost_append_singleton,walkCost_map: extending a walk at its end, relabeling vertices.cycleCost_cons: a closed walk fromais the walk fromathrough the rest back toa.cycleCost_rotate,cycleCost_append_comm: a closed walk costs the same from any starting point.