directed graph class