Template Class Munkres¶
Defined in File munkres.hpp
Class Documentation¶
-
template<typename
T>
classbrille::assignment::Munkres¶ A single-case implementation of the Munkres’ Assignment Algorithm.
See, e.g., http://csclab.murraystate.edu/~bob.pilgrim/445/munkres.html
Public Functions
-
Munkres(size_t n, std::vector<T> cmat = std::vector<T>())¶ The Munkres intializer
If the cost matrix is provided the assignment algorithm is run automatically.
- Parameters
n: the dimensionality of the system, which must be squarecmat: [optional] the cost matrix
-
void
reset()¶
-
bool
run_assignment()¶ Start the assignment algorithm.
Resets the mask matrix, cover vectors, stored indices, step, and finished state before attempting to run the assignment algorithm.
- Return
A flag to indicate if the algorithm finished successfully
-
bool
get_assignment(size_t *out)¶ After the assignment algorithm has run, use get_assignment to retrieve the result
- Return
The returned flag is true if the assignment was made.
- Parameters
[out] out: A size_t pointer at which the N task assignments will be stored
-
std::string
to_string() const¶
-