How to write CVRP (capacitated vehicle routing problem) objective function?
显示 更早的评论
Respected Sir/Madam,
Can you please help me in writing this objective function in the script?

回答(1 个)
Yoan
2023-10-25
0 个投票
routeLength = @(route, distance) sum(arrayfun(@(n) distance(route(n), route(n+1)), 1:(numel(route)-1)));
类别
在 帮助中心 和 File Exchange 中查找有关 Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!