IterOrbit
Subgraph isomorphism with iterative graphlet-orbit filtering
Loading...
Searching...
No Matches
OrbitCounter.h
Go to the documentation of this file.
1
3
4#ifndef ORBIT_COUNTER_H
5#define ORBIT_COUNTER_H
6
7#include "AppGraph.h"
8#include <vector>
9#include <unordered_map>
10#include <functional>
11#include <cstdint>
12
16using OrbitCounts = std::vector<std::vector<long long>>;
17
20 double relabel_dag_ms = 0;
21 double three_ms = 0;
22 double four_closed_ms = 0;
23 double four_other_ms = 0;
24 double four_cycle_ms = 0;
25 double four_clique_ms = 0;
26 double copy_ms = 0;
27 double five_setup_ms = 0;
28 double five_tree_ms = 0;
29 double five_parallel_ms = 0;
30 double five_section_ms[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
31};
32
40public:
46 EVOKEOrbitCounter(const AppGraph& g, int size, const std::vector<bool>* needed_orbits = nullptr);
48 EVOKEOrbitCounter(const Escape::CGraph* g, int size, const std::vector<bool>* needed_orbits = nullptr);
49
52
55 OrbitCounts countColumns(const std::vector<int>& orbits);
56
58 const OrbitCountTimings& timings() const { return last_timings; }
59
64 void setCliqueVertexCap(int orbit, const std::vector<double>* cap) {
65 (orbit == 14 ? clique4_cap : clique5_cap) = cap;
66 }
67
68private:
71 using Extract = std::function<void(double* const*, const int64_t*, int64_t, int)>;
73 void countWith(const Extract& extract);
74
76 const Escape::CGraph* cgraph;
78 const std::vector<bool>* needed_orbits;
79 const std::vector<double>* clique4_cap = nullptr;
80 const std::vector<double>* clique5_cap = nullptr;
81 bool needed(int orbit) const { return !needed_orbits || (*needed_orbits)[orbit]; }
82};
83
84#endif
The graph type shared by the pattern, the data graph and its induced subgraphs.
std::vector< std::vector< long long > > OrbitCounts
Graphlet orbit counts of a graph: counts[i][k] is the number of non-induced occurrences of orbit k ro...
Definition OrbitCounter.h:16
Definition AppGraph.h:32
Counts graphlet orbits with the Escape/EVOKE library.
Definition OrbitCounter.h:39
OrbitCountTimings last_timings
Definition OrbitCounter.h:75
std::function< void(double *const *, const int64_t *, int64_t, int)> Extract
Receives the counts (per_vertex[orbit][relabelled vertex]), the internal index -> relabelled vertex m...
Definition OrbitCounter.h:71
const std::vector< bool > * needed_orbits
Definition OrbitCounter.h:78
const Escape::CGraph * cgraph
Definition OrbitCounter.h:76
const OrbitCountTimings & timings() const
Timings of the last count() call.
Definition OrbitCounter.h:58
int graphlet_size
Definition OrbitCounter.h:77
const std::vector< double > * clique5_cap
Definition OrbitCounter.h:80
void setCliqueVertexCap(int orbit, const std::vector< double > *cap)
Caps the clique count of each vertex (orbit 14: 4-cliques; any other value: orbit 72,...
Definition OrbitCounter.h:64
void countWith(const Extract &extract)
Counts the orbits and hands them to extract before they are freed.
Definition OrbitCounter.cpp:876
const std::vector< double > * clique4_cap
Definition OrbitCounter.h:79
bool needed(int orbit) const
Definition OrbitCounter.h:81
OrbitCounts countColumns(const std::vector< int > &orbits)
Counts the orbits and returns only the given ones, by column: result[j][i] is orbit orbits[j] of the ...
Definition OrbitCounter.cpp:863
OrbitCounts count()
Counts the orbits. The result is indexed by internal index, then orbit.
Definition OrbitCounter.cpp:848
Wall-clock time of each step of the last EVOKEOrbitCounter::count() call, in milliseconds.
Definition OrbitCounter.h:19
double five_section_ms[9]
each of those nine
Definition OrbitCounter.h:30
double copy_ms
copying the counts back to internal-index order
Definition OrbitCounter.h:26
double relabel_dag_ms
degree-ordered relabelling and DAG construction
Definition OrbitCounter.h:20
double four_closed_ms
4-vertex orbits with a closed form
Definition OrbitCounter.h:22
double three_ms
orbits of graphlets on up to three vertices
Definition OrbitCounter.h:21
double four_cycle_ms
4-cycle orbit
Definition OrbitCounter.h:24
double five_tree_ms
5-vertex tree orbits
Definition OrbitCounter.h:28
double four_other_ms
paw and diamond orbits
Definition OrbitCounter.h:23
double five_setup_ms
per-edge triangle lists for the 5-vertex routines
Definition OrbitCounter.h:27
double four_clique_ms
4-clique orbit
Definition OrbitCounter.h:25
double five_parallel_ms
the nine independent 5-vertex routines, run concurrently
Definition OrbitCounter.h:29