Content deleted Content added
m v2.05b - Bot T20 CW#61 - Fix errors for CW project (Reference before punctuation) |
Acknowledge that the algorithm works even with initially negative costs |
||
Line 55:
=== Matrix formulation ===
In the matrix formulation, we are given
This can be expressed as permuting the rows of a cost matrix ''C'' to minimize the [[Trace (linear algebra)|trace]] of a matrix,
Line 68:
=== Bipartite graph formulation ===
The algorithm can equivalently be described by formulating the problem using a bipartite graph. We have a [[complete bipartite graph]] <math>G=(S, T; E)</math> with {{mvar|n}} worker vertices ({{mvar|S}}) and {{mvar|n}} job vertices ({{mvar|T}}), and the edges ({{mvar|E}}) each have a
==The algorithm in terms of bipartite graphs==
Line 197:
}
}
// delta will always be
// except possibly during the first time this loop runs
// if any entries of C[j_cur] are negative
Line 357:
===Step 1===
'''For each row, its minimum element is subtracted from every element in that row.''' This causes all elements to have
This also leads to at least one zero in each row. As such, a naive greedy algorithm can attempt to assign all workers a task with a penalty of zero. This is illustrated below.
|