ハンガリー語のマッチング アルゴリズムのソース コード

ハンガリー語のマッチング アルゴリズムのソース コード

注: コメント内のメソッドの手順は、ソース コードの手順とは若干異なります。

一致する main 関数を計算するには、main() 関数を参照してください。

ヘッダー ファイルに含まれる関数と手順は次のとおりです。 ハンガリー語のマッチング アルゴリズムのソース コード

class HungarianAlgorithm
{
public:
	HungarianAlgorithm();
	~HungarianAlgorithm();
	double Solve(vector <vector<double> >& DistMatrix, vector<int>& Assignment);

private:
	void assignmentoptimal(int* assignment, double* cost, double* distMatrix, int nOfRows, int nOfColumns);
	void buildassignmentvector(int* assignment, bool* starMatrix, int nOfRows, int nOfColumns);
	void computeassignmentcost(int* assignment, double* cost, double* distMatrix, int nOfRows);
	void step2a(int* assignment, double* distMatrix, bool* starMatrix, bool* newStarMatrix, bool* primeMatrix, bool* coveredColumns, bool* coveredRows, int nOfRows, int nOfColumns, int minDim);
	void step2b(int* assignment, double* distMatrix, bool* starMatrix, bool* newStarMatrix, bool* primeMatrix, bool* coveredColumns, bool* coveredRows, int nOfRows, int nOfColumns, int minDim);
	void step3(int* assignment, double* distMatrix, bool* starMatrix, bool* newStarMatrix, bool* primeMatrix, bool* coveredColumns, bool* coveredRows, int nOfRows, int nOfColumns, int minDim);
	void step4(int* assignment, double* distMatrix, bool* starMatrix, bool* newStarMatrix, bool* primeMatrix, bool* coveredColumns, bool* coveredRows, int nOfRows, int nOfColumns, int minDim, int row, int col);
	void step5(int* assignment, double* distMatrix, bool* starMatrix, bool* newStarMatrix, bool* primeMatrix, bool* coveredColumns, bool* coveredRows, int nOfRows, int nOfColumns, int minDim);
};

ネットワークディスクリンク:

链接:https://pan.baidu.com/s/141tcPcVfxABeERDvk853RQ 

おすすめ

転載: blog.csdn.net/qq_42835363/article/details/131520419