-
Notifications
You must be signed in to change notification settings - Fork 0
/
BKz8.h
65 lines (53 loc) · 1.71 KB
/
BKz8.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// Created by admin on 16/03/2017.
//
#ifndef GRAD_BKZ8_H
#define GRAD_BKZ8_H
#include "MCE.h"
#define DENSITY_THRESHOLD 0.006
class BKz8:public MCE{
public:
void preprocessing(){
P.clear();
X.clear();
R.clear();
for(int t = 0; t < vNum; t++) graph.d[t] = graph.g[t].size();
auto start = high_resolution_clock::now();
graph.basicInfo();
//graph.filterMixed_();
graph.filterBasedOnDegree();
//graph.basicInfo();
graph.filterBasedOnEdge();
//graph.basicInfo();
graph.filterBasedOnDegree();
//graph.basicInfo();
graph.filterBasedOnEdge();
//graph.basicInfo();
graph.filterBasedOnDegree();
//for(int t = 0; t < vNum; t++) graph.d[t] = graph.g[t].size();
//graph.filterBasedOnKcore2();
graph.basicInfo();
//graph.basicInfo();
for(int t = 0; t < vNum; t++) graph.d[t] = graph.g[t].size();
//for(int i = 0; i < vNum; i++) if(graph.live[i]) P.insert(i);
cout << duration_cast<milliseconds>(high_resolution_clock::now() - start).count() << "ms\n";
//exit(0);
}
void solve(){
dfsGenerate();
//BronKerboschz(graph, P, X, recursiveCount);
}
private:
set<int> P;
set<int> X;
vector<int> R;
int initP;
vector<int> subgraph_c2r;
vector<int> subgraph_r2c;
void BronKerboschz(Graph &subgraph, set<int> P, set<int> X, int recursiveCallCount);
void pivotSelection2(Graph &subgraph, set<int> &, set<int> &, vector<int> &, int);
bool dfsRun(set<int> &ans, vector<bool> &live, int point);
bool bfsRun(set<int> &ans, vector<bool> &live, int point);
void dfsGenerate();
};
#endif //GRAD_BKZ8_H