HungarianSolve

Before calling HungarianSolve, ensure that related parameters have been initialized by the HungarianHandleInit function. 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

1
APP_ERROR HungarianSolve(HungarianHandle &handle, const std::vector<std::vector<int>> &cost, const int rows, const int cols);

Parameters

Parameter

Input/Output

Description

handle

Input

Structure 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.

Response Parameters

Data Structure

Description

APP_ERROR

For details about the returned error codes, see APP_ERROR Description.