Javascript implementation of a graph structure which maintains edges to the nearest node in any direction.