change the implementation of Arc in Graph.