下载
中文
注册

HungarianHandle

功能

匈牙利算法,一种在多项式时间内求解任务分配问题的组合优化算法。

结构定义

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;
};

参数说明

参数名

输入/输出

说明

rows

输入

匹配矩阵行。

cols

输入

匹配矩阵列。

max

输出

匹配矩阵行与列最大值。

resX

输出

点集x匹配结果。

resY

输出

点集y匹配结果。

transpose

输出

矩阵转置标识符。

adjMat

输入

权值矩阵。

xMatch

输出

点集x匹配值。

yMatch

输出

点集y匹配值。

xValue

输出

点集x顶标值。

yValue

输出

点集y值,默认为0。

slack

输出

slack数组。

xVisit

输出

点集x匹配标识符。

yVisit

输出

点集y匹配标识符。