common fig generation
hungarian algorithm