| Algorithm 1: Iterative Message Passing |
| 1: Vars ← all variable nodes in graphical model Factors ← all factor nodes in graphical model 2: for all v in Vars do 3: e ← currently assigned candidate of v 4: end for 5: for all f in Factors do 6: v’ ← all v in Vars which has a link with f. 7: if f==f1 then 8: columnConstraint(v’); 9: else if f==f2 then 10: relationConstraint(v’); 11: end if 12: end for 13: for all v in Vars do 14: reassignCandidate(); 15: end for 16: Repeat untill all e of Vars no longer change. |