generate unique ids for edges