From the source-code site you can read
There is small change in the code. The line min = a[i][0] + a[c][i];
should be min = a[i][c] + a[c][i];
Here is the function you’ve to change:
int least(int c)
{
int i,nc=999;
int min=999,kmin;
for(i=0;i < n;i++)
{
if((a[c][i]!=0)&&(visited[i]==0))
if(a[c][i] < min)
{
min=a[i][c]+a[c][i];
kmin=a[c][i];
nc=i;
}
}
if(min!=999)
cost+=kmin;
return nc;
}
5
solved Traveling sales man algorithm [closed]