To find the three closest vertexes to a given target point, you might do this:
(defun find-three-closest (target vertex-list distance-fn) (with-track-best (:keep 3 :order-by-fn #'<) (dolist (v vertex-list) (track v (funcall distance-fn v target))))))
The library home page is here: http://www.nklein.com/software/track-best-library/. This library is by Patrick Stein
Topics: accumulators