test-driven algorithm to determine closest distance between two cities