add a prepareEdge method to Graph that takes the vertex ids