Implement directed graphs