How to write CVRP (capacitated vehicle routing problem) objective function?
Mostrar comentarios más antiguos
Respected Sir/Madam,
Can you please help me in writing this objective function in the script?

Respuestas (1)
Yoan
el 25 de Oct. de 2023
0 votos
routeLength = @(route, distance) sum(arrayfun(@(n) distance(route(n), route(n+1)), 1:(numel(route)-1)));
Categorías
Más información sobre Optimization en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!