1. A method of partitioning electronic ink strokes into lines, comprising: obtaining a plurality of electronic ink strokes from a data structure; partitioning the plurality of electronic ink strokes into an initial arrangement of groups; partitioning the plurality of electronic ink strokes into at least one alternate arrangement of groups; for each of the arrangements determining a cost value for the arrangement using characteristics of the arrangement; identifying the arrangement of groups having the lowest cost value; and updating the data structure to indicate that each group of strokes in the identified arrangement forms a line.