implement single linkage distance function in assembly.allmaps