## Square matrix
##
## | 1 2 2 |
## | 2 3 3 |
## | 3 2 2 |
##
## The optimal permutation of rows/cols is (2,3,1),
## and the solution of the Linear Ordering Problem is 8.
## Te permutation matrix of the solution is
## | 0 0 0 |
## | 1 0 1 |
## | 1 0 0 |
mat_LOP <- matrix(c(1,2,3,2,3,2,2,3,2), nrow=3)
LOP(mat_LOP)
Run the code above in your browser using DataLab