It sounds like you may want to use K-means clustering (or a variant thereof). Algorithm::Cluster has a number of clustering routines, including K-means. I haven't used it, but it might be a good place to start.
HTH
In reply to Re: Grouping numbers
by bobf
in thread Grouping numbers
by tamaguchi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |