7. A computer storage medium having computer-executable instructions for performing steps comprising: accessing data representing a sequence of strokes in a handwritten equation; performing a forward pass through the sequence of strokes from the first stroke in the sequence to the last stroke in the sequence, the forward pass comprising at each stroke, determining a path score for a plurality of symbol-relation pairs that each represents a symbol and its spatial relation to a predecessor symbol; constructing a symbol graph comprising nodes and links by backtracking through the strokes from the last stroke to the first stroke and assigning scores to the links based on the path scores for the symbol-relation pairs, wherein assigning scores to the links comprises determining a score for the link based on a path score for a symbol-relation pair and a separate path score for a predecessor symbol-relation pair; using the symbol graph to recognize a mathematical expression based in part on the scores for the links; and storing the mathematical expression.
10. The computer storage medium of claim 7 wherein determining a path score comprises determining a path score that is associated with a symbol-relation pair, a predecessor symbol-relation pair and a stroke.