Added a function to get the average cost in the legalizer
Bug correction

Corrected a small bug leading to suboptimalities in the transportation
algorithm
Optimized transportation by avoiding shortest path calculations when
possible
Changed the cost formulation so that it reads as a distance