Basically I'm trying to solve a travelling salesman problem using clustering. Each cluster has a population of individuals that are used to form a subpath, these subpaths are then connected to form a solution for the travelling salesman problem.
I am investigating the relationship between population size and number of cities in a cluster. My objective is to find the optimal number of cities in a cluster as well as the optimal population size for a given number of cities. I'm just using trail and error runs to try to do this, I'm not sure if there is a better approach?
From a few initial runs I found that:
If a cluster has 6 cities then it performs well with 300 individuals
If a cluster has 12 cities then it performs well with 500 individuals
If a cluster has 18 cities then it performs well with 1000 individuals
If a cluster has 24 cities then it performs well with 2000 individuals
If a cluster has 30 cities then it performs well with 2500 individuals
Based on these numbers I want to write a function that takes as input the number of cities and then returns the number of individuals based on this scale. I'm not really sure of the best way to do this but any suggestions are welcome.
This is what i have so far, but I think there is a better way to do this..
public int getPopulationSize(int citySize){
if (citySize > 6)
return 300;
else if (citySize <= 12)
return 500;
else if (citySize <= 18)
return 1000;
else if (citySize <= 24)
return 2000;
else
return 2500;
}