IterOrbit
Subgraph isomorphism with iterative graphlet-orbit filtering
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
EVOKEOrbitCounter Class Reference

Counts graphlet orbits with the Escape/EVOKE library. More...

#include <OrbitCounter.h>

Collaboration diagram for EVOKEOrbitCounter:
[legend]

Public Member Functions

 EVOKEOrbitCounter (const AppGraph &g, int size, const std::vector< bool > *needed_orbits=nullptr)
 
 EVOKEOrbitCounter (const Escape::CGraph *g, int size, const std::vector< bool > *needed_orbits=nullptr)
 Counts on a graph given directly (vertices 0..n-1, sorted neighbour lists).
 
OrbitCounts count ()
 Counts the orbits. The result is indexed by internal index, then orbit.
 
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 vertex with internal index i.
 
const OrbitCountTimings & timings () const
 Timings of the last count() call.
 
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, 5-cliques).
 

Private Types

using Extract = std::function< void(double *const *, const int64_t *, int64_t, int)>
 Receives the counts (per_vertex[orbit][relabelled vertex]), the internal index -> relabelled vertex map, the vertex count and the orbit count.
 

Private Member Functions

void countWith (const Extract &extract)
 Counts the orbits and hands them to extract before they are freed.
 
bool needed (int orbit) const
 

Private Attributes

OrbitCountTimings last_timings
 
const Escape::CGraph * cgraph
 
int graphlet_size
 
const std::vector< bool > * needed_orbits
 
const std::vector< double > * clique4_cap = nullptr
 
const std::vector< double > * clique5_cap = nullptr
 

Detailed Description

Counts graphlet orbits with the Escape/EVOKE library.

Several of Escape's routines are replaced by reimplementations in OrbitCounter.cpp that return the same counts (checked by test/orbit_equivalence.cpp). The counter is used on the pattern (all orbits) and, in every filtering round, on the data graph or its candidate-induced subgraph.

Member Typedef Documentation

◆ Extract

using EVOKEOrbitCounter::Extract = std::function<void(double* const*, const int64_t*, int64_t, int)>
private

Receives the counts (per_vertex[orbit][relabelled vertex]), the internal index -> relabelled vertex map, the vertex count and the orbit count.

Constructor & Destructor Documentation

◆ EVOKEOrbitCounter() [1/2]

EVOKEOrbitCounter::EVOKEOrbitCounter ( const AppGraph &  g,
int  size,
const std::vector< bool > *  needed_orbits = nullptr 
)
Parameters
gthe graph to count on
sizegraphlet size: 3, 4 or 5 vertices
needed_orbitsif given, orbits whose entry is false may be left at zero. The filter passes the orbits some pattern vertex has: an orbit no pattern vertex has cannot reject a candidate.

◆ EVOKEOrbitCounter() [2/2]

EVOKEOrbitCounter::EVOKEOrbitCounter ( const Escape::CGraph *  g,
int  size,
const std::vector< bool > *  needed_orbits = nullptr 
)

Counts on a graph given directly (vertices 0..n-1, sorted neighbour lists).

Member Function Documentation

◆ count()

OrbitCounts EVOKEOrbitCounter::count ( )

Counts the orbits. The result is indexed by internal index, then orbit.

◆ countColumns()

OrbitCounts EVOKEOrbitCounter::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 vertex with internal index i.

Same counts as count().

◆ countWith()

void EVOKEOrbitCounter::countWith ( const Extract &  extract)
private

Counts the orbits and hands them to extract before they are freed.

◆ needed()

bool EVOKEOrbitCounter::needed ( int  orbit) const
inlineprivate

◆ setCliqueVertexCap()

void EVOKEOrbitCounter::setCliqueVertexCap ( int  orbit,
const std::vector< double > *  cap 
)
inline

Caps the clique count of each vertex (orbit 14: 4-cliques; any other value: orbit 72, 5-cliques).

cap is indexed by internal index. A vertex's count is then either exact or at least its cap, so every test "count >= requirement" with requirement <= cap is unchanged, while cliques among vertices that have all reached their cap are skipped.

◆ timings()

const OrbitCountTimings & EVOKEOrbitCounter::timings ( ) const
inline

Timings of the last count() call.

Member Data Documentation

◆ cgraph

const Escape::CGraph* EVOKEOrbitCounter::cgraph
private

◆ clique4_cap

const std::vector<double>* EVOKEOrbitCounter::clique4_cap = nullptr
private

◆ clique5_cap

const std::vector<double>* EVOKEOrbitCounter::clique5_cap = nullptr
private

◆ graphlet_size

int EVOKEOrbitCounter::graphlet_size
private

◆ last_timings

OrbitCountTimings EVOKEOrbitCounter::last_timings
private

◆ needed_orbits

const std::vector<bool>* EVOKEOrbitCounter::needed_orbits
private

The documentation for this class was generated from the following files: