Made addEdge throw exceptions if the nodes were not in the graph