How to write CVRP (capacitated vehicle routing problem) objective function?
8 次查看(过去 30 天)
显示 更早的评论
Respected Sir/Madam,
Can you please help me in writing this objective function in the script?![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/422138/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/422138/image.jpeg)
0 个评论
回答(1 个)
Yoan
2023-10-25
routeLength = @(route, distance) sum(arrayfun(@(n) distance(route(n), route(n+1)), 1:(numel(route)-1)));
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!