Sample code for logistics calculation using djikstra's algorithm