Graph traversal returns indeces of vertices.