Find an index of maximum value in the list

Sort the fragments by area or by sum of edge lengths, which is often faster. I have two clusters for this.

If you had posted your code/geometry I would have shown you.