Converting graph to directed edges

The undirected graph required detecting duplicate edges, which was
buggy and broken. Now we keep duplicated edges, but detectably.