Added bidirectional edge processing.