for (int j = 0; j < d; ++j) { final Edge f = g.edgeAt(u, j); if (isDirectional(f, replacements) && safeToClean(g, f.other(u), replacements)) { replacements.put(f, new Edge(u, f.other(u), Bond.IMPLICIT)); for (int j = 0; j < d2; ++j) { final Edge f = g.edgeAt(v, j); if (isDirectional(f, replacements) && safeToClean(g, f.other(v), replacements)) replacements.put(f, new Edge(v, f.other(v), Bond.IMPLICIT));