-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathminCostAlgorithm.hpp
More file actions
26 lines (21 loc) · 1.51 KB
/
minCostAlgorithm.hpp
File metadata and controls
26 lines (21 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef MIN_COST
#define MIN_COST
#include <iostream>
#include <vector>
class minCostAlgorithm
{
public:
minCostAlgorithm() = default;
~minCostAlgorithm() = default;
double Solve(std::vector< std::vector<double> >& costMatrix, std::vector<int>& Assignment);
private:
void optimalAssignment(int *assignment, double *cost, double *costMatrix, int nOfRows, int nOfColumns);
void buildAssignmentVector(int *assignment, bool *starMatrix, int nOfRows, int nOfColumns);
void computeAssignmentCost(int *assignment, double *cost, double *costMatrix, int nOfRows);
void step2a(int *assignment, double *costMatrix, bool *starMatrix, bool *newStarMatrix, bool *primeMatrix, bool *coveredColumns, bool *coveredRows, int nOfRows, int nOfColumns, int minDim);
void step2b(int *assignment, double *costMatrix, bool *starMatrix, bool *newStarMatrix, bool *primeMatrix, bool *coveredColumns, bool *coveredRows, int nOfRows, int nOfColumns, int minDim);
void step3(int *assignment, double *costMatrix, bool *starMatrix, bool *newStarMatrix, bool *primeMatrix, bool *coveredColumns, bool *coveredRows, int nOfRows, int nOfColumns, int minDim);
void step4(int *assignment, double *costMatrix, 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 *costMatrix, bool *starMatrix, bool *newStarMatrix, bool *primeMatrix, bool *coveredColumns, bool *coveredRows, int nOfRows, int nOfColumns, int minDim);
};
#endif