adding edges to graph