title: How can I find the minimum number of lines needed to cover all the zeros in a 2 dimensional array?
body: <p>I'm trying to make a decent implementation of the hungarian algorithm however I'm stuck at how to find the minimum number of lines that cover all the zeros in an array</p>
  
  <p>also I need to know these lines to make some computations later</p>
  
  <p>here is the explanation:</p>
  
  <p><a href="http://www.ams.jhu.edu/~castello/362/Handouts/hungarian.pdf" rel="nofollow">http://www.ams.jhu.edu/~castello/362/Handouts/hungarian.pdf</a></p>
  
  <p>in step 3 it says</p>
  
  <blockquote>
    <p>Use as few lines as possible to cover all the zeros in the matrix. There is  no easy rule to do this - basically trial and error. </p>
  </blockquote>
  
  <p>what does trial and error mean in terms of computation? If I have for example an 2d array of 5 rows and 5 columns then</p>
  
  <p>The first row can cover all the zeros, the first and second, the first row and first column, etc etc too many combinations</p>
  
  <p>isn't there something more efficient than this?</p>
  
  <p>thanks in advance</p>