-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclasses.h
51 lines (41 loc) · 1.03 KB
/
classes.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
//
// Created by Hao Pan on 9/2/20.
//
#ifndef CLIQUESIG_CLASSES_H
#define CLIQUESIG_CLASSES_H
#include <algorithm>
#include <iostream>
#include <fstream>
#include <vector>
#include <queue>
using namespace std;
class node{
public:
int name;
int degree;
vector<int> neighbors;
vector<int> adjacency; // used in CommunityPeel
vector<int> F; // used in CommunityPeel
vector<int> numCommonNeighbors; // used in CommunityPeel
vector<vector<int>> commonNeighbors; // used in CommunityPeel
//constructor
node(int);
};
class graph {
public:
string name;
int n, m;
vector<node> nodeList;
int maxDeg;
int maxDegNode;
vector<int> kCore;
// constructor
graph(string);
graph(){};
// functions
void GetKCore(int); // this function gets kCore of a single static graph without reordering vertices
bool IsAdj(int, int); // this function checks if two nodes are adjacent
vector<int> FindCommonNeighbors(int, int);
vector<int> BFS(int);
};
#endif //CLIQUESIG_CLASSES_H