Version that doesn't create reversed graph.