For a dyad (i,j) (directedness of the network irrelevant), we can check if an edge exists either by searching out-neighbours of i or in-neighbours of j. The size of the corresponding BST is the node's out- and in-degree, respectively. We can find which is smaller in constant time, so in principle, we could gain some performance by searching the end of the node with the smaller degree. I am not sure how much practical speed up there would be, however.