int GetNextCollapser()
{
// Scan
// Not done as a sort because want to keep the lookup simple for now
float bestVal = float.MaxValue;
int bestIndex = 0; // NB this is ok since if nothing is better than this, nothing will collapse
for ( int i = 0; i < numCommonVertices; ++i )
{
if ( worstCosts[ i ] < bestVal )
{
bestVal = worstCosts[ i ];
bestIndex = i;
}
}
return bestIndex;
}