what if we use "backtracking" to find the hamiltonian cycles and
finding the min of that. It reduces the space required.since we need to
store only one cycle at one shot. am i missing the stack space required
of recursion of backtrack.??
Dhyanesh, what about time. does it reduces the time as well??
here we go...
{
  mincost <- 0;
  answercycle < - null;

   while( (h <- GetNextHamiltoncycle()) != NULL){.
    C <- getcose(h);
    if( mincost == 0)
         mincost = C; //init.
    else if( C < mincost)
    {
        mincost <- C;
         answercycle <- h;
    } 
  }

}

Reply via email to