Compute tour length given a TSP instance and a tour/permutation.

computeTourLength(x, tour, close.tour = TRUE, round = FALSE)

Arguments

x

[Network]
TSP instance.

tour

[integer]
Permutation of nodes.

close.tour

[logical(1)]
Should the tour be closed? I.e., do we want a roundtrip tour? Default is TRUE.

round

[logical]
Should the distances be rounded? Default is FALSE. Concorde internally does this.

Value

[numeric(1)]