code: public double pathLength (Configuration configuration) {
          double distance = 0.0;
          for (int i = 1; i < this.dimension; ++i) {
              distance += this.cities.get(configuration.valueAt(i - 1)).getDistance(this.cities.get(configuration.valueAt(i)));
          }
          distance += this.cities.get(configuration.valueAt(configuration.getDimension() - 1))
                  .getDistance(this.cities.get(configuration.valueAt(0)));
  
          return distance;
      }
docs: Returns absolute length of a path
  
  @param configuration path
  @return length