Click or drag to resize
AssignmentProblem Class

The AssignmentProblem class represents a data type for computing an optimal solution to an N-by-NAssignment problem. The assignment problem is to find a minimum weight matching in an edge-weighted complete bipartite graph.

The data type supplies methods for determining the optimal solution and the corresponding dual solution.

This implementation uses the Successive shortest paths algorithm. The order of growth of the running time in the worst case is O(N^3 log N) to solve an N-by-N instance.

Inheritance Hierarchy
SystemObject
  Algs4NetAssignmentProblem

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class AssignmentProblem

The AssignmentProblem type exposes the following members.

Constructors
  NameDescription
Public methodAssignmentProblem
Determines an optimal solution to the assignment problem.
Top
Methods
  NameDescription
Public methodDualCol
Returns the dual optimal value for the specified column.
Public methodDualRow
Returns the dual optimal value for the specified row.
Public methodStatic memberMainTest
Demo test the AssignmentProblem data type. Takes a command-line argument N; creates a random N-by-N matrix; solves the N-by-N assignment problem; and prints the optimal solution.
Public methodSol
Returns the column associated with the specified row in the optimal solution.
Public methodWeight
Returns the total weight of the optimal solution
Top
Remarks

For additional documentation, see Section 6.5Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

This class is a C# port from the original Java class AssignmentProblem implementation by the respective authors.

See Also