View full-text article in PMC Sensors (Basel). 2021 Feb 10;21(4):1260. doi: 10.3390/s21041260 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 1. Pseudocode for the Hungarian algorithm Function Hungarian-Algorithm (G). % initial vertex feasible labeling l1 i=1,j=1 ∀x∈X,l1(x)=minx∈X{w(exy)} ∀y∈Y,l1(y)=0 M1← initial matching while Mi<X % find the maximum matching M Mij=Mi do Fij+1←alternating forest of Mij rooted at the unmatched vertices x∈X Pij+1← a path of Fij+1 which contain another unmatched vertex y∈Y Mij+1=Mij⊕E(Pij+1) Qj+1=[X−V(Fij+1)]∪[Y∩V(Fij+1)] j=j+1 while Mij≠Qij Mi=Mij % update the feasible vertex labeling Fi←alternating forest of Mi rooted at the unmatched vertices x∈X S=V(Fi)∩X T=V(Fi)∩Y α=minx∈S,y∉T{w(exy)−li(x)−li(y)} li+1(v)=li(v)+αli(v)−αli(v)if v∈Sif v∈Totherwise i=i+1 done