-
Notifications
You must be signed in to change notification settings - Fork 2
/
DSAlgs.h
56 lines (46 loc) · 1.46 KB
/
DSAlgs.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
/*
* DSAlgs.h
*
* Created on: Oct 14, 2014
* Author: aepasto
*/
#ifndef DSALGS_H_
#define DSALGS_H_
#include "DynGraph.h"
#include <vector>
#include <unordered_map>
#include <cstdlib>
class UDynGraph;
typedef struct DSResult {
double density;
std::vector<int> subgraph;
unsigned long edges_in_subgraph;
DSResult() {
density = -1;
edges_in_subgraph = 0;
}
void clear() {
density = -1;
edges_in_subgraph = 0;
subgraph.clear();
}
} DSResult;
using namespace std;
void Find(const UDynGraph& graph, const double beta, const double epsilon,
DSResult * result, unordered_map<int, int>* level_map,
DynGraph* orientation, bool* valid_orientation,
unordered_map<int, int>* level_degree_map = NULL);
//TODO use template
void Incremental(const UDynGraph& graph, const double beta_zero,
const double epsilon, vector<int>::iterator current_subgraph_begin,
vector<int>::iterator current_subgraph_end, DSResult * result,
unordered_map<int, int>* level_map, DynGraph* orientation,
unordered_map<int, int>* level_degree_map = NULL);
void Incremental(const UDynGraph& graph, const double beta_zero,
const double epsilon,
unordered_set<int>::iterator current_subgraph_begin,
unordered_set<int>::iterator current_subgraph_end, DSResult * result,
unordered_map<int, int>* level_map, DynGraph* orientation,
unordered_map<int, int>* level_degree_map = NULL);
void Bahmani(const UDynGraph& graph, const double epsilon, DSResult * result);
#endif /* DSALGS_H_ */