total_length_of_cycle.m
来自「this is a simple2-opt code」· M 代码 · 共 7 行
M
7 行
function total_length = total_length_of_cycle(distances,path)
total_length = 0;
for i = 1:length(path)-1
total_length = total_length + distances(path(i),path(i+1));
end
total_length = total_length + distances(path(end),path(1));
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?