@@ -124,17 +124,17 @@ Problem: Wrap a paragraph to a line length, minimizing the sum of the squares of
## Backpointer Class
* Information for the final result:
*…
*What was the position of the previous linebreak?
* Information to go back:
*…
*What was the position of the previous linebreak? (redundant with the info above) (alternatively, we could track the number of words on the chosen line)
* Information to compare quality:
*…
*What was the *total* penalty for the lines placed so far?
## Choosing a Backpointer
* Exhaustive search:
* Generate ….
* Check that ….
* Generate start-of-line positions (in reverse order) as long as the character count does not exceed the line length and the start-of-line position does not go negative.
* Check that the backpointer minimizes total penalty.
## Example
...
...
@@ -146,13 +146,17 @@ Problem: Wrap a paragraph to a line length, minimizing the sum of the squares of