Add simple directed graph type with topological sort method.