The standard Hungarian algorithm solves the problem of assigning n workers to n jobs with a given cost function.
In my variant, the cost function depends on the final matching produced by the algorithm. Explaining with an example:
if cost[w1][j1] = 10\$, in the new variant, if the final matching has w2 and j2 matching, then cost[w1][j1] = 5\$.
It's like saying that if I'm a worker and I charge 10\$ for some job j1 and if this other worker is assigned a j2 job, then I'm going to reduce my price to 5\$ for the j1 job.
Edit: I think it's safe to assume that any (wp, jp) pairing might or might not have relation to (wq, jq). If the relationship exists then the cost of (wp, jp) reduces if (wq, jq) is part of the final matching. The relationship between the pairings is pre-defined. Mathematically, we can assume that we know there exists a function f, where f(wp, jp, wq, jq) will return a tuple (boolean, discount). If the boolean is true and wp matches with jp then we apply the discount to the cost of wq and jq.
You can capture each such interaction via a weighted product of two binary decision variables. The linear objective becomes quadratic, and the resulting problem is called the quadratic assignment problem.