-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathgraphlet_vertex.h
78 lines (66 loc) · 2.74 KB
/
graphlet_vertex.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
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
============================================================================
Name : Parallel Parameterized Graphlet Decomposition (PGD) Library
Author : Nesreen K. Ahmed, (nesreen.k.ahmed@intel.com),
Ryan A. Rossi (rrossi@parc.com)
Description : A general high-performance parallel framework for computing
the graphlet decomposition. The library is designed to be fast
for both large sparse graphs as well as dense graphs.
Copyright (C) 2012-2015,
Nesreen K. Ahmed (http://nesreenahmed.com), All rights reserved.
Please cite the following paper:
Nesreen K. Ahmed, Jennifer Neville, Ryan A. Rossi, Nick Duffield,
Efficient Graphlet Counting for Large Networks, IEEE International
Conference on Data Mining (ICDM), pages 10, 2015.
Download PDF: http://www.nesreenahmed.com/publications/ahmed-et-al-icdm2015.pdf
@inproceedings{ahmed2015icdm,
title={Efficient Graphlet Counting for Large Networks},
author={Nesreen K. Ahmed and Jennifer Neville and Ryan A. Rossi and Nick Duffield},
booktitle={ICDM},
pages={1--10},
year={2015}
}
See http://nesreenahmed.com/graphlets for more information.
============================================================================
*/
#ifndef GRAPHLET_VERTEX_H_
#define GRAPHLET_VERTEX_H_
using namespace std;
namespace graphlet {
class Vertex {
private:
int id, b;
public:
Vertex(int vertex_id, int bound): id(vertex_id), b(bound) {};
void set_id(int vid) { id = vid; }
int get_id() { return id; }
void set_bound(int value) { b = value; }
int get_bound() { return b; }
};
/**
* @brief Order from largest to smallest value
* Note that ties are broken by vertex id
*
* @param v is a vertex object containing a vertex id and its value
* @param u is a vertex object containing a vertex id and its value
* @return Returns true if the value of v is larger than the value of u
*
*/
static bool decr_bound(Vertex v, Vertex u) {
return (v.get_bound() > u.get_bound() ||
(v.get_bound() == u.get_bound() && v.get_id() > u.get_id()));
}
/**
* @brief Order from smallest to largest value
* Note that ties are broken by vertex id
*
* @param v is a vertex object containing a vertex id and its value
* @param u is a vertex object containing a vertex id and its value
* @return Returns true if the value of v is smaller than the value of u
*/
static bool incr_bound(Vertex v, Vertex u) {
return (v.get_bound() < u.get_bound() ||
(v.get_bound() == u.get_bound() && v.get_id() > u.get_id()));
};
};
#endif