For an explicit algorithm, keep an unnormalized residual , initially , whose row and column sums all equal a common mass , initially one. While , find a perfect matching in its positive support, form its permutation matrix , and subtract , where is the smallest selected entry. Record and replace by .
If the residual mass is positive, the same proof of the Hall marriage theorem condition applies after division by . Every subtraction removes at least one positive entry and creates no new positive entries. Before the last subtraction, any positive-mass residual has at least positive entries; the last step removes all its entries. If is the initial number of positive entries, thenSince the residual ultimately vanishes, summing the recorded subtractions gives , and the row sums give .
A perfect matching can be found by at most searches for an augmenting path in a matching, each costing in a graph with at most edges. Thus each iteration costs , including forming the support and updating the residual, and there are iterations. HenceThis bound uses exact real arithmetic. For rational input, a common denominator lets all residual subtractions be performed on integers of polynomial bit length, giving a polynomial bit-time implementation as well.
Articles by others on the same topic
There are currently no matching articles.