JS/nodejs structure for quickly finding nearest edges and vertices