I have a $5 \times 5$ grid as below $\begin{array}{ccccc} 0& 1& 0& 1& 1\\ 1& 0& 0& 0& 0\\ 1& 0& 0& 0& 0\\ 1& 0& 0& 0& 0\\ 1& 0& 0& 1& 0 \end{array}$
It can be safely assumed the diagonals are always 0.
Now the problem is to eliminate the 1's in the grid above by choosing minimum numbers (1 to 5) such that if we strike of that numbered row and columns both then only zeros remain. example for above matrix if we choose 1,4: strike off all cells row 1 and column 1 strike off all cells row 4 and column 4 Now only 0's remain.
So the problem is to find a fast way choose minimum such numbers so that all 1's strike out.
Please suggest a way forward as I am stuck and cannot find correct way.
The Grid Dimension $N$ : $1\leq N\leq 100$.
Many thanks for your help.
Edit: My bad, It can be safely assumed the diagonals are always 0.