Revert to edge and graph stuff. This time, use a directed graph.