Implementation of a directed Graph