|
Public Member Functions |
| Trie (Trie *parent, const unsigned long init) |
const Trie * | is_included (const set< itemtype > &an_itemset, set< itemtype >::const_iterator item_it) const |
| It decides whether the given itemset is included in the trie or not.
|
void | find_candidate (const vector< itemtype > &basket, const itemtype distance_from_candidate, vector< itemtype >::const_iterator it_basket, const unsigned long counter_incr=1) |
| Increases the counter for those itemsets that is contained by the given basket.
|
void | delete_infrequent (const unsigned long min_occurrence, const itemtype distance_from_candidate) |
| Deletes the tries that represent infrequent itemsets.
|
void | show_content_preorder () const |
| ~Trie () |
Private Member Functions |
void | max_path_set () |
| Sets the maximal path value.
|
void | add_empty_state (const itemtype item, const unsigned long init_counter=0) |
| Adds an empty state to the trie.
|
Private Attributes |
vector< itemtype > | itemvector |
| itemvector stores the label of the edges.
|
vector< Trie * > | statevector |
| statevector stores the address of the tries of the edges point to.
|
Trie * | parent |
| parent stores the address of the parent of the Trie.
|
unsigned long | counter |
| counter stores the occurrence of the itemset represented by the Trie
|
itemtype | maxpath |
| maxpath stores the length of the longest path starting from the Trie.
|
Friends |
class | Apriori_Trie |
We can regard the trie as a recursive data structure. It has a root node and a list of (sub)trie. We can reach a subtree by a labeled edge (link). Since the root of the trie represents an itemset the counter stands for the occurrence. For the sake of fast traversal we also store the parent of a trie, the length of the maximal path starting from the root, and the edges are stored ordered according to their label.