2
$\begingroup$

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.".

$\endgroup$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.