Hungarian algorithm: Difference between revisions

Content deleted Content added
B52481 (talk | contribs)
m minor improvements to Adding the j-th job in O(jW) time
B52481 (talk | contribs)
add more about the time complexity in Adding the j-th job in O(jW) time
Line 123:
* Otherwise, we add <math>w_{\text{next} }</math> and the job matched with it to <math>Z</math>.
 
Adjusting potentials takes <math>O(W)</math> time. Recomputing <math>\Delta</math> and <math>w_{\text{next}}</math> after adjustingchanging the potentials and <math>Z</math> also can be done in <math>O(W)</math> time. Case 1 can occur at most <math>j-1</math> times before case 2 occurs and the procedure terminates, yielding the overall time complexity of <math>O(jW)</math>.
 
===Implementation in C++===