Distance and cost relationship