1. A computer-implemented method to provide related terms in an advertising system, the method comprising: receiving query terms; accessing a graph to determine related terms for the query terms, wherein the graph includes a collection of nodes and edges, the nodes correspond to atoms included in a query log, and the edges represent a relationship between the nodes that indicate whether the nodes connected to the edge are similar; calculating edit distances between nodes in the graph, wherein the edit distance represents a number of operations performed to transform each node in the graph to a related node; assigning the edit distances to edges; pruning edges assigned edit distances above a maximum-edit threshold, wherein pruning edges assigned edit distances above a maximum-edit threshold further comprises: determining an average number of characters for each group of mutually connected nodes, assigning the average number of characters as the maximum-edit threshold for that group of mutually connected nodes, and removing edges in each group of mutually connected nodes that are above the maximum-edit threshold for that group of mutually connected nodes; removing disconnected nodes to generate groups of mutually-connected nodes; electing a root node for each group of mutually-connected nodes, wherein electing a root node for each group of mutually-connected nodes further comprises, determining usage frequencies for atoms corresponding to the nodes in each group of mutually-connected nodes, assigning the usage frequencies to the nodes in each group of mutually-connected nodes, and marking the node with the largest usage frequency in each group of mutually-connected nodes; and providing the related terms corresponding to the nodes having usage frequencies above a predetermined frequency threshold.