add_edge method in graph object and edges refactring