The g-trie is a data structure to count occurrences of subgraphs on larger graphs, determining if they are network motifs.