Perhaps any of these links could be of interest? So instead of distance between points you could use costs instead.

https://www.excel-easy.com/examples/...h-problem.html

https://www.youtube.com/watch?v=-E3rSoClgMI

Alf