fix bugs in GraphAddEdge to disallow duplicate and self-edges