1

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;
}
Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194
MTA
  • 739
  • 2
  • 9
  • 29
  • i think the normal approach would be to fit a curve to your data. A quick check gave me this function: f(x) = 281 * e^(0.0776 * x - 0.0892) – Absurd-Mind Mar 16 '14 at 14:49
  • @Absurd-Mind could you please give me some guidance on how you did that? – MTA Mar 16 '14 at 16:09
  • i used http://zunzun.com for this, since your graph looks exponential, i selected exponential in the 2d function drop down. Then i selected Offset Exponential 2D y = a * exp(bx + c) entered your values and got this result. Since I'm not a mathematician i can't give you an in depth explanation. – Absurd-Mind Mar 16 '14 at 16:15

0 Answers0