refactored library graph functions to return lists of edge and vertex objects rather than just ids