private String getHalfMatrixString ( Permutation permutation ) { StringBuilder builder = new StringBuilder ( permutation . size ( ) ) ; int size = permutation . size ( ) ; for ( int indexI = 0 ; indexI < size - 1 ; indexI ++ ) { for ( int indexJ = indexI + 1 ; indexJ < size ; indexJ ++ ) { builder . append ( getConnectivity ( permutation . get ( indexI ) , permutation . get ( indexJ ) ) ) ; } } return builder . toString ( ) ; }
Get the upper - half of the adjacency matrix under the permutation .