Skip to contents

Compute the total cost of an assignment.

Usage

compute_assignment_cost(cost_matrix, assignment)

Arguments

cost_matrix

The cost matrix.

assignment

Integer vector of column assignments.

Value

The total cost (sum of assigned costs).

Examples

if (FALSE) { # \dontrun{
cost <- matrix(c(1, 2, 3, 2, 4, 6, 3, 6, 9), nrow = 3)
assignment <- solve_lap(cost)
total <- compute_assignment_cost(cost, assignment)
} # }