Maybe it would help if you define the distance function for your matrix and tell us that function?
In reply to Re^3: perl array matrix by Corion in thread perl array matrix by perlhelp