Assignment Problem
Assignment Problem Solver
OperationsResearchModels.solve
— Methodsolve(a)
Arguments
a::AssignmentProblem
: The problem in type of AssignmentProblem
Output
AssignmentResult
: The custom data type that holds problem, solution, and optimum cost.
Description
Solves an assignment problem given by an object of in type AssignmentProblem
.
Example
julia> mat = [
4 8 1;
3 1 9;
1 6 7;
];
julia> problem = AssignmentProblem(mat);
julia> result = solve(problem);
julia> result.solution
3×3 Matrix{Float64}:
0.0 0.0 1.0
0.0 1.0 0.0
1.0 0.0 0.0
julia> result.cost
3.0
AssignmentProblem
OperationsResearchModels.Assignment.AssignmentProblem
— TypeAssignmentProblem
Arguments
costs::Array{T,2}
: The cost matrix of the assignment problem.
Description
The AssignmentProblem
struct represents an assignment problem with a cost matrix.
AssignmentResult
OperationsResearchModels.Assignment.AssignmentResult
— TypeAssignmentResult(problem, solution, cost)
Arguments
problem::AssignmentProblem
: The original assignment problem.solution::Matrix
: The solution matrix of the assignment problem.cost::Real
: The optimal cost of the assignment.
Description
The AssignmentResult
struct represents the result of solving an assignment problem. It contains the original problem, the solution matrix, and the optimal cost.