OPTICS algorithm implementation