diff options
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | src/tsp_approx.rs | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -516,7 +516,7 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "embeddings-sort" -version = "0.3.0" +version = "0.3.1" dependencies = [ "ahash", "anyhow", diff --git a/src/tsp_approx.rs b/src/tsp_approx.rs index 2c6cbf9..e3448a1 100644 --- a/src/tsp_approx.rs +++ b/src/tsp_approx.rs @@ -292,7 +292,7 @@ fn refine_2_opt(dist_cache: &DistCache, tour: Vec<usize>) -> (bool, Vec<usize>) let mut tour: Vec<_> = tour .into_iter() .enumerate() - .map(|(i, v)| (i - 1, v, i + 1)) + .map(|(i, v)| (i.wrapping_sub(1), v, i + 1)) .collect(); let n = tour.len(); // fix boundary |