Added directed graph and tests.