HungarianSolve
Before calling HungarianSolve, ensure that related parameters are initialized by HungarianHandleInit. Otherwise, HungarianSolve cannot be executed correctly.
Function Usage
To execute the Hungarian algorithm to solve the minimum weight matching problem of the bipartite graph, execute HungarianHandleInit first.
Prototype
int HungarianSolve(HungarianHandle &handle, const std::vector<std::vector<int>> &cost, const int rows, const int cols);
Parameter Description
Parameter |
Input/Output |
Description |
|---|---|---|
handle |
Input |
Struct dedicated for the Hungarian algorithm. |
cost |
Input |
Weight matrix. |
rows |
Input |
Number of rows in the matching matrix of the Hungarian algorithm. |
cols |
Input |
Number of columns in the matching matrix of the Hungarian algorithm. |
Return Parameter Description
Data Structure |
Description |
|---|---|
APP_ERROR |
Error code returned during program execution. For details, see the MxBase/ErrorCode/ErrorCode.h file. |
Parent topic: Hungarian