-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstinger_server.h
More file actions
60 lines (49 loc) · 1.69 KB
/
stinger_server.h
File metadata and controls
60 lines (49 loc) · 1.69 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
#pragma once
#include <vector>
#include <iostream>
#include <string>
#include <stdint.h>
#include <dynograph_util/args.h>
#include <dynograph_util/dynamic_graph.h>
#include "stinger_graph.h"
#include "stinger_algorithm.h"
class StingerServer : public DynoGraph::DynamicGraph
{
private:
StingerGraph graph;
std::vector<StingerAlgorithm> algs;
std::vector<stinger_edge_update> recentInsertions;
std::vector<stinger_edge_update> recentDeletions;
int64_t max_active_vertex;
void onGraphChange();
void recordGraphStats();
public:
StingerServer(const DynoGraph::Args& args, int64_t max_nv);
StingerServer(const DynoGraph::Args &args, int64_t max_vertex_id, const DynoGraph::Batch &batch);
static std::vector<std::string> get_supported_algs();
void before_batch(const DynoGraph::Batch& batch, const int64_t threshold);
void insert_batch(const DynoGraph::Batch & b);
void delete_edges_older_than(int64_t threshold);
void update_alg(const std::string &name, const std::vector<int64_t> &sources, DynoGraph::Range<int64_t> data);
int64_t get_out_degree(int64_t vertex_id) const;
int64_t get_num_vertices() const;
int64_t get_num_edges() const ;
std::vector<int64_t> get_high_degree_vertices(int64_t n) const;
struct DistributionSummary
{
double mean;
double variance;
int64_t max;
double skew;
};
struct DegreeStats
{
DistributionSummary both, in, out;
};
DegreeStats
compute_degree_distribution(const DynoGraph::Batch& b);
DegreeStats
compute_degree_distribution(StingerGraph& g);
DegreeStats
compute_degree_distribution(StingerGraph &g, const DynoGraph::Batch &b);
};