added binary search to func ...get_vertex_id