[mod] refactor graph implmentation (directed edges)