From the corresponding navigation plan, we find all connected subgraphs of size less than or equal to m. We then update the cooccurrence counts between all the n-grams w and all the connected subgraphs g. We also update the counts of how many examples we have encountered so far and counts of the n-grams w and subgraphs g. At any given time, we can compute a lexicon using these various counts.
for each n-gram w, we look at all the subgraphs g that cooccurred with it, and compute a score for the pair (w, g).