add edge information in graph, add method to create graph from database