-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLNS.h
52 lines (42 loc) · 1.36 KB
/
LNS.h
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "Solution.h"
using namespace std;
struct aSolution {
vector<vector<vector<int>>> list;
vector<vector<double>> arrivalTimes;
double score;
};
class LNS : public Solution
{
private:
int Iter;
float T0, Alpha, Lambda, Nu, Xi;
aSolution bestS, curS, newS;
//double bestScore = (double)INT_MAX, curScore = (double)INT_MAX;
//vector<vector<vector<int>>> bestS, curS, newS;
vector<vector<int>> rmdNodes; //day * tmp rmd nodes, 1~nNodes
void genInitSolution();
void removal();
void randomRemoval();
void relatedRemoval();
void clusterRemoval();
void worstRemoval_timeConsistency();
void synchronized_servicesCustomerRemoval();
int rmFromEachday(int node);
int R(int i, int j);
int r(int i, int j);
int getu();
vector<int> findMSTAndCutIntoTwo(vector<int> nodes);
void insertion();
void randomInsertion();
void greedyInsertion();
void regretInsertion(int);
void earliestInsertion();
void latestInsertion();
vector<vector<vector<int>>> transFormat(const vector<vector<int>>& v);
vector<vector<int>> transFormat(const vector<vector<vector<int>>>& v);
//void calculateObjectiveAndadjustDepartureTime(const vector<vector<vector<int>>>& bef);
public:
LNS();
LNS(int Iter, float T0, float Alpha, float Lambda, float Nu, float Xi);
void solve();
};