write two edge for bidirectional