本地搜索算法,完全混乱
在(a)和(b)中,假设有一个2交换变换算子,将解决方案A和B(路径表示中的TSP旅行)连接到它们在旅行C、D、E、F、G中可能的邻居,
(a) A: 1 2 3 4 5 6 7
C: 1 3 5 7 2 4 6
D: 1 2 5 4 3 6 7
E: 2 3 1 7 5 4 6
F: 4 1 7 5 3 2 6
G: 1 2 3 7 6 5 4
(b) B: 1 3 2 7 5 4 6
C: 1 3 5 7 2 4 6
D: 1 2 5 4 3 6 7
E: 2 3 1 7 5 4 6
F: 4 1 7 5 3 2 6
G: 1 2 3 7 6 5 4
我不知道这是要我做什么。
In (a) and (b), assuming a 2-exchange transformation operator, connect solutions A and B, which are TSP tours in path representation, to their possible neighbors among tours C, D, E, F, G
(a) A: 1 2 3 4 5 6 7
C: 1 3 5 7 2 4 6
D: 1 2 5 4 3 6 7
E: 2 3 1 7 5 4 6
F: 4 1 7 5 3 2 6
G: 1 2 3 7 6 5 4
(b) B: 1 3 2 7 5 4 6
C: 1 3 5 7 2 4 6
D: 1 2 5 4 3 6 7
E: 2 3 1 7 5 4 6
F: 4 1 7 5 3 2 6
G: 1 2 3 7 6 5 4
I have no clue what this is asking me to do.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
定义(从问题文本推断,也许你在课堂上也讨论过这个)
路径表示中的 TSP 游览:
数字 1 到 7 的有序序列,每个数字被引用一次且仅被引用一次。
每个数字代表旅行推销员访问的城市。
例如D:
1 2 5 4 3 6 7
,表示销售人员从城市1出发,前往城市2,然后是城市 5...最后是城市 7。
此时引入“stop”的概念并用小写字母(a trhu g)标记它们可能很有用。 (与用于标识问题中各种路径的大写字母完全没有关系)。
在 D 路径中,a 站是城市 1,c 站是城市 5 等。
2 交换转换运算符
通过恰好交换两个城市(或者更准确地说,通过将城市交换为其中两个站点)来转换 TSP 路径的操作。
因此,2 交换转换操作可以理解为采用三个参数的操作:路径 X、两个停止索引 m,n,并返回 m 和 n 处的城市已交换的路径 X'。
如果我们将此操作称为 Swp(),我们可以编写
任务(你的任务,你愿意接受吗 ;-) )
将路径表示中的 TSP 旅行的解决方案 A 和 B 连接到旅行 C、D、E、F、G 中可能的邻居
我猜测要求是在 C、D、EF 和 G(大写,即路径)中识别哪些是 A(或 B)的“邻居”路径,即哪些可以从 A(或来自 B) 的单个 Swp() 操作(并且可能提供所述操作参数)。
通过扩展,我们可以将分配解释为需要找到从 A 到所需的 Swp() 操作的a(不是,因为可能有多个)列表。另一条路径,只需最少的步骤。
Definitions (inferred from the problem text, maybe you discussed this in class too)
TSP tour in path representation:
An ordered sequence of the digits 1 thru 7, each digit cited once and only once.
Each digit represents a city visited by the Traveling Salesperson.
For example D:
1 2 5 4 3 6 7
, indicates that Salesperson starts in city 1, goes to city2,then city 5... and ends in city 7.
It is probably useful at this point to introduce the concept of a 'stop' and to label these with lowercase letters, a trhu g. (no relation at all with the uppercase letters used to identify various paths in the problem).
In the D path, the a stop is city 1, the c stop is city 5 etc.
a 2-exchange transformation operator
An operation which transforms a TSP path by exchanging exactly two cities (or, more precisely, by swapping the city for two of the stops).
A 2-exchange Transformation operation can therefore be understood as an operation which takes three arguments: a Path X, two stop indexes m,n, and returns the path X' where the cities at m and n have been swaped.
If we call this operation Swp(), we can write
The assignment (Your mission, would you accept it ;-) )
connect solutions A and B, which are TSP tours in path representation, to their possible neighbors among tours C, D, E, F, G
I'm guessing the requirement it is to identify among C,D, E F and G (upper case i.e. the Paths) which are "neighbor" paths of A (or of B), i.e. which of these can be derived from A (or from B) with a single Swp() operation (and probably to provide the said operation parameters).
By extension one may interpret the assignment as one where one needs to find a (not the as there may be several) list of Swp() operations needed to go from A to another path, in a minimal number of steps.