-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
74 lines (61 loc) · 2.63 KB
/
main.cpp
File metadata and controls
74 lines (61 loc) · 2.63 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
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
66
67
68
69
70
71
72
73
74
#include <iostream>
#include "Analyser.h"
#include "SpectralPartitioner.h"
#include "Annealing.h"
#include "FreeStylePartitioner.h"
int main() {
FreeStylePartitioner fsp = FreeStylePartitioner("../files/adjList", "../files/ErdosIndex");
std::cout << fsp.tower.back()->size << " " << fsp.getNumberOfLeaves() << '\n';
fsp.hideLeaves();
std::cout << fsp.tower.back()->size << " " << fsp.getNumberOfLeaves() << "\n";
std::cout << fsp.findCutVertices().size() << '\n';
/*
//-------------------------------annealing-------------------------------------
Annealing ann = Annealing("../files/adjList", "../files/ErdosIndex");
ann.anneal();
ann.saveGuess("../files/annealingPartition", ann.bestGuess);
int minSize = 0;
for (auto b : ann.bestGuess)
minSize += b;
std::cout << "conductance:\t" << ann.bestConductance << "\tsizes of the parts:\t" << minSize << ' ' << ann.size - minSize << '\n';
*/
//-----------------------------spectral partition------------------------------------
/*
SpectralPartitioner sp("../files/adjList", "../files/ErdosIndex");
double conductance;
std::vector<float> v2;
std::vector<bool> guess;
v2 = sp.readV2("../files/v2");
std::tie(conductance, guess) = sp.getPartition(0, v2);
sp.saveGuess("../files/spectralPartition", guess);
int minSize = 0;
for (auto b : guess)
minSize += b;
std::cout << "conductance:\t" << conductance << "\tsizes of the parts:\t" << minSize << ' ' << sp.size - minSize << '\n';
std::tie(conductance, guess) = sp.getPartition(10000, v2);
sp.saveGuess("../files/spectralPartition>10000", guess);
minSize = 0;
for (auto b : guess)
minSize += b;
std::cout << "conductance:\t" << conductance << "\tsizes of the parts:\t" << minSize << ' ' << sp.size - minSize << '\n';
std::vector<int> ignoreList;
for (int i = 0; i < sp.size; i++) {
if (guess[i])
ignoreList.push_back(i);
}
v2 = sp.readV2("../files/v2-37");
std::tie(conductance, guess) = sp.getPartition(0, v2);
sp.saveGuess("../files/spectralPartition-37", guess);
minSize = 0;
for (auto b : guess)
minSize += b;
std::cout << "conductance:\t" << conductance << "\tsizes of the parts:\t" << minSize << ' ' << sp.size - minSize << '\n';
std::tie(conductance, guess) = sp.getPartition(10000, v2);
sp.saveGuess("../files/spectralPartition-37>10000", guess);
minSize = 0;
for (auto b : guess)
minSize += b;
std::cout << "conductance:\t" << conductance << "\tsizes of the parts:\t" << minSize << ' ' << sp.size - minSize << '\n';
return 0;
*/
}