Added support for bidirectional edges