= Line-breaking fitness class
A \b[line-breaking fitness class] is a coarse description of how tightly or loosely a line is spaced. The <Knuth-Plass line-breaking algorithm> distinguishes tight, normal, loose and very loose lines. A transition between sufficiently different classes adds <typesetting demerits>, even when each line's own spacing is individually acceptable.<Breaking paragraphs into lines by Donald E. Knuth and Michael F. Plass>[p.1155: four fitness classes and penalties for contrasting adjacent lines]{ref}
For example, imagine one feasible line has <line adjustment ratio> $-0.7$ and the next has $0.8$. One compresses its spaces substantially, while the other expands them. That contrast can be more conspicuous than two lines with similar spacing. A paragraph objective can express this using an added term
$$
\gamma\,\mathbf 1_{|f_j-f_{j-1}|>1},\qquad \gamma\geq0,
$$
where $f_j\in\{0,1,2,3\}$ indexes the classes. The <indicator function> adds the charge only for a sufficiently large class change.
Consequently, the <dynamic programming state> needs the previous fitness information. Suppose two routes to the same break cost 10 and 12, but the cheaper route's class would add a transition charge of 5 to the next line while the other adds none. Their relevant totals become 15 and 12: discarding the second route solely because $12>10$ would be premature. The <principle of optimality> applies to states that retain the information the future cost needs.
<TeX> computes its categories using integer <typesetting badness> thresholds and handles special glue cases explicitly. Its implementation should therefore be consulted for exact boundary behaviour rather than inferring it from rounded decimal adjustment ratios.<TeX source code by Donald E. Knuth>[try_break: fit_class, badness thresholds 12 and 99, and adj_demerits]{ref}
Back to article page