GraphEdge (int nodeIndex1, int nodeIndex2, @NotNull GraphEdgeType type) { assert type.isNormalEdge() : "Unexpected edge type: " + type; return new GraphEdge(Math.min(nodeIndex1, nodeIndex2), Math.max(nodeIndex1, nodeIndex2), null, type); }