modify the part of setAdjVertexAndEdges in knn search