new constructor in directedgraph