Assignment Algorithm Implants Research Paper
However, we can apply a few general rules of programming style to simplify this problem.The same rules can be applied to any step-algorithm.The main loop for Munkres as a step-wise algorithm is shown here implemented in C#.is set to some value outside the range 1..7 so that done will be set to true and the program will end.We will assume that the cost matrix C(i,j) has already been loaded with the first index referring to the row number and the second index referring to the column number.For each row of the matrix, find the smallest element and subtract it from every element in its row. We can define a local variable called minval that is used to hold the smallest value in a row.Notice that there are two loops over the index j appearing inside an outer loop over the index i.
Save the smallest uncovered value and Go to Step 6. Continue until the series terminates at a primed zero that has no starred zero in its column.
Rotate the matrix so that there are at least as many columns as rows and let k=min(n,m). If there is no starred zero in the row containing this primed zero, Go to Step 5.
Otherwise, cover this row and uncover the column containing the starred zero.
In the completed program the tagged (starred) zeros flag the row/column pairs that have been assigned to each other.
We will discuss the implementation of a procedure for each step of Munkres' Algorithm below.
Once minval has been found this value is subtracted from each element of that row in the second inner loop over j. In this step, we introduce the mask matrix M, which in the same dimensions as the cost matrix and is used to star and prime zeros of the cost matrix.