How to write CVRP (capacitated vehicle routing problem) objective function?

4 次查看(过去 30 天)
Respected Sir/Madam,
Can you please help me in writing this objective function in the script?

回答(1 个)

Yoan
Yoan 2023-10-25
routeLength = @(route, distance) sum(arrayfun(@(n) distance(route(n), route(n+1)), 1:(numel(route)-1)));

类别

Help CenterFile Exchange 中查找有关 Optimization 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by