HungarianHandle

Function

It uses the Hungarian Algorithm, which is a combinatorial optimization algorithm that solves the assignment problem in polynomial time.

Structure Definition

struct HungarianHandle {
    int rows;
    int cols;
    int max;
    int* resX;
    int* resY;
    bool transpose;
    std::shared_ptr<int> adjMat;
    std::shared_ptr<int> xMatch;
    std::shared_ptr<int> yMatch;
    std::shared_ptr<int> xValue;
    std::shared_ptr<int> yValue;
    std::shared_ptr<int> slack;
    std::shared_ptr<int> xVisit;
    std::shared_ptr<int> yVisit;
};

Parameter Description

Parameter

Input/Output

Description

rows

Input

Matrix rows.

cols

Input

Matrix columns.

max

Output

Maximum values of the matrix rows and columns.

resX

Output

Matching result of the vertex set x.

resY

Output

Matching result of the vertex set y.

transpose

Output

Matrix transpose ID.

adjMat

Input

Weight matrix.

xMatch

Output

Matching value of the vertex set x.

yMatch

Output

Matching value of the vertex set y.

xValue

Output

Labeling value of the vertex set x.

yValue

Output

Value of the vertex set y. The default value is 0.

slack

Output

Slack array.

xVisit

Output

Matching ID of vertex set x.

yVisit

Output

Matching ID of vertex set y.