matrix manipulation
<p>suppose i got a matrix </p>

<pre><code>0 1 0 0 2
0 0 0 4 0 
5 0 2 1 3 
4 4 5 0 0
0 3 2 0 2
</code></pre>

<p>Select a matching by choosing a set of zeros so that each row or column has only one selected.
It means that i should have only one zero selected from each row and column!
<a href="http://www.wikihow.com/Use-the-Hungarian-Algorithm" rel="nofollow">http://www.wikihow.com/Use-the-Hungarian-Algorithm</a>
step 9 is what iam trying to do</p>

<p>i wrote this code for it. Am designing an algorithm in which this is one of the last step to compute! however this code is not doing it so! it is repeating the rows! can anybody please correct me? </p>

<p><code>temp_Matrix</code> is the main matrix like the one i wrote above! temp_tasks storing rows and <code>temp_processors</code> storing columns! <code>store_indexes_for_step_nine</code> is a pointer array that is storing the track of indexes where 0 is marked in matrix.</p>

<pre><code>for(int i=0; i&lt;temp_tasks;i++)
{
    for(int j=0; j&lt;temp_processors;j++)
    {
        if(temp_Matrix[i][j] ==0)
        {
            if(store_indexes_for_step_nine[j] = 0)
            {
                store_indexes_for_step_nine[i] =1;
                cout&lt;&lt;"i: "&lt;&lt;i&lt;&lt;"   j:"&lt;&lt;j&lt;&lt;endl;
                break;
            }
        }

    }
}
</code></pre>
