Edge addition method modified to use the graph, instead of an adresse.