Suppose there is a matrix with the value of 0 and 1. The hit-map of the matrix (0 is blue and 1 is red) create some connected component (see the following figure as an instance):

enter image description here

Is there any efficient algorithm to minimize the number of connected components (constructed from red cells) by swapping rows and columns of the matrix with this constraint that "As row and column of this matrix comes from the same property set, if we swapping row $i$ with row $j$, we must swapping the column $i$ with column $j$ too.".


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.