private void addEdge ( int i , int j ) { if ( ! nodes . contains ( i ) ) { nodes . add ( i ) ; edges . put ( i , new HashSet < Integer > ( ) ) ; size ++ ; } else if ( ! edges . containsKey ( i ) ) { edges . put ( i , new HashSet < Integer > ( ) ) ; } if ( ! nodes . contains ( j ) ) { nodes . add ( j ) ; size ++ ; } edgesInv . put ( j , i ) ; if ( ! edges . get ( i ) . contains ( j ) ) { edges . get ( i ) . add ( j ) ; } }
i - > j