"get minimal distance" now in common_utils.