Changing Graph definition to DirectedGraph