43 const std::unordered_map<int, int>& pivot,
bool induced,
bool cbj,
44 bool count_only =
false,
bool edge_orbit_filter =
false,
98 void setConflict(uint64_t* set,
int d)
const { set[d >> 6] |= uint64_t{1} << (d & 63); }
The graph type shared by the pattern, the data graph and its induced subgraphs.
Iterative orbit filtering: candidate sets and Algorithm 1 (IterOrbitFilter) of the paper.
std::unordered_map< int, std::vector< int > > CandidateSets
A candidate assignment: pattern node ID -> the data node IDs it may be mapped to.
Definition FilterEngine.h:13
std::vector< int > Mapping
One embedding: the data node ID each pattern vertex is mapped to, indexed by pattern node ID (pattern...
Definition SearchEngine.h:14
Symmetry-breaking constraints for counting embeddings.
Backtracking enumeration of the embeddings of the pattern, within the candidate sets.
Definition SearchEngine.h:24
std::vector< int > intersect_buffer
The second buffer of that swap.
Definition SearchEngine.h:132
bool limitReached() const
Whether the search stopped at the match limit.
Definition SearchEngine.h:61
const std::vector< int > & order
Definition SearchEngine.h:103
void run()
Runs the search.
Definition SearchEngine.cpp:392
void backtrack(int depth)
Chronological backtracking from depth.
Definition SearchEngine.cpp:522
std::vector< std::vector< int > > candidate_lists
Per pattern vertex, its candidates sorted by data node ID.
Definition SearchEngine.h:123
std::vector< int > fast_inverse_mapping
Data node ID -> the pattern node ID mapped to it (-1 if none).
Definition SearchEngine.h:118
std::vector< uint64_t > backward_masks
Backjumping: per depth, the bitset of the depths of order[depth]'s backward neighbours.
Definition SearchEngine.h:160
bool stopped
Definition SearchEngine.h:110
std::vector< int > identity
0, 1, 2, ...: "every candidate", for a vertex with no backward neighbour.
Definition SearchEngine.h:134
const std::vector< long long > & getLocalCandidatesPerDepth() const
Local candidates computed at each order depth, summed over the visits.
Definition SearchEngine.h:65
bool computeLocalCandidates(int depth)
Computes the local candidates of order[depth] from the index (local_ptr, local_len).
Definition SearchEngine.cpp:419
long long countLastLevel(int depth, uint64_t *used_by) const
Counts the embeddings completed at the last pattern vertex without visiting each one; the pattern ver...
Definition SearchEngine.cpp:492
long long getIndexEntriesAfter() const
Entries of the candidate-space index after the edge-orbit filter.
Definition SearchEngine.h:69
std::vector< size_t > local_len
Per depth, the number of local candidates.
Definition SearchEngine.h:138
long long getMatchCount() const
The number of embeddings, saturated at INT64_MAX (see countOverflowed()); with a match limit,...
Definition SearchEngine.h:59
std::vector< long long > local_per_depth
Definition SearchEngine.h:150
bool enable_cbj
Definition SearchEngine.h:105
std::vector< int > fast_mapping
The partial embedding: pattern node ID -> data node ID (-1 if unmapped).
Definition SearchEngine.h:114
void setMatchLimit(long long limit, bool store)
Enumeration with a match limit (the protocol of Sun and Luo): without count_only, visit the embedding...
Definition SearchEngine.h:50
bool store_matches
Definition SearchEngine.h:109
std::vector< const int * > local_ptr
Per depth, the local candidates, as positions in the candidate list.
Definition SearchEngine.h:136
std::vector< uint64_t > conflict_bits
Backjumping: one conflict set per depth, a bitset in which bit d stands for the pattern vertex at dep...
Definition SearchEngine.h:158
std::vector< int > fast_mapping_local_index
Pattern node ID -> position of its image in its candidate list.
Definition SearchEngine.h:116
uint64_t symmetry_multiplier
The factor the final count is multiplied by (SymmetryBreaking::multiplier).
Definition SearchEngine.h:144
const AppGraph & data_graph
Definition SearchEngine.h:101
std::vector< int > order_position
Pattern node ID -> depth in the matching order.
Definition SearchEngine.h:153
std::vector< std::vector< int > > local_candidates
Per depth, a buffer for the intersection; swapped with intersect_buffer instead of copied (see comput...
Definition SearchEngine.h:130
const AppGraph & pattern_graph
Definition SearchEngine.h:102
long long match_limit
Definition SearchEngine.h:108
bool countOverflowed() const
Whether the count exceeded 64 bits and was saturated.
Definition SearchEngine.h:71
bool inducedConflict(int u, int v, int &conflict_u) const
Under induced semantics: whether mapping u to v puts an edge between the images of two non-adjacent p...
Definition SearchEngine.cpp:478
const std::vector< long long > & getNodesPerDepth() const
Search-tree nodes visited at each order depth.
Definition SearchEngine.h:63
bool count_overflow
Definition SearchEngine.h:145
long long match_count
Definition SearchEngine.h:107
std::vector< std::vector< int > > smaller_depths
Symmetry breaking: per depth, the earlier depths whose image must have a smaller data node ID than th...
Definition SearchEngine.h:142
int backtrack_cbj(int depth)
Backtracking with conflict-directed backjumping. Returns the depth to return to.
Definition SearchEngine.cpp:563
std::vector< std::vector< int > > backward_non_neighbors
Per depth, the earlier pattern vertices not adjacent to order[depth] (induced search).
Definition SearchEngine.h:127
bool is_induced
Definition SearchEngine.h:104
uint64_t * conflicts(int depth)
Definition SearchEngine.h:97
std::vector< uint8_t > in_use
Data node ID -> whether some pattern vertex is mapped to it.
Definition SearchEngine.h:120
bool count_only
Definition SearchEngine.h:106
long long getIndexEntriesBefore() const
Entries of the candidate-space index before the edge-orbit filter.
Definition SearchEngine.h:67
void setConflict(uint64_t *set, int d) const
Definition SearchEngine.h:98
size_t conflict_words
Backjumping: the number of 64-bit words in one conflict set.
Definition SearchEngine.h:155
void mergeConflicts(int target_depth, int source_depth)
Definition SearchEngine.cpp:386
const std::vector< Mapping > & getMatches() const
The embeddings found (empty with count_only, or when not stored).
Definition SearchEngine.h:56
long long index_entries_after
Definition SearchEngine.h:147
std::vector< std::vector< BackwardEdge > > backward_edges
Per depth, the index along each backward edge of order[depth].
Definition SearchEngine.h:125
std::vector< long long > nodes_per_depth
Definition SearchEngine.h:149
long long index_entries_before
Definition SearchEngine.h:146
std::vector< Mapping > matches
Definition SearchEngine.h:162
The index along one backward edge of the pattern vertex at some depth: for the i-th candidate of from...
Definition SearchEngine.h:77
std::vector< uint32_t > targets
Definition SearchEngine.h:80
std::vector< uint32_t > offsets
Definition SearchEngine.h:79
int from_u
Definition SearchEngine.h:78
Symmetry-breaking constraints for counting embeddings (Grochow and Kellis).
Definition Symmetry.h:17