adds selective indexing to generic vertices and edges