-1
Consider the following matrix/array that contains the distances between 4 cities:

0 1 2 3
1 0 4 5
2 4 0 6
3 5 6 0

Each row/column pair (i,j) represents the distance between city i and city j. 
For example the distance between city 1 and city 4 is 3.

我只是想检查一下我的理解是否正确。就像一个数组,第一个城市从 0 开始。所以在矩阵中,城市 1 是 0,城市 2 是 1。

城市 3 和城市 3 之间的路径是 0?首先我们看第 2 行,然后看第 2 列。

假设我们有以下游览:T = {1,3,2,4}。为了解决这个问题,我们...

城市 1 到城市 3 是 2。城市 3 到城市 2 是 4。城市 2 到 4 是 5。

那么游览的长度应该是2 + 4 + 5 = 11?然而,在旅行商问题中,我们总是回到起始位置,所以从城市 4 我们必须回到 1,这将花费额外的 3,所以我们的最终旅行是 14 (11 + 3)。

4

1 回答 1

1

是,对的。有关更多 TSP 信息,请参阅TSP 网页

于 2013-05-06T14:24:28.867 回答