1) What is inactiveList doing. Nodes are added but never used.


It contains all feasible breakpoints except those that are still
active, i.e., are still in scope as the start of a line ending at the
currently considered breakpoint. At the end of the loop the active
list only contains nodes pertaining to the end of the paragraph. From
the best one of them the breakpoints of the paragraph are calculated
by tracing back to the beginning through the inactive list.

See the code in LineLM after the comment
        // use the chosen node to determine the optimum breakpoints

in the line
            bestActiveNode = bestActiveNode.previous;
the previous node is held in the inactive list.

Ok, so it isn't really needed when the algorithm is implemented in java. Just by having the previous node linked from within bestActiveNode is enough to keep the inactive nodes alive.

So inactiveList can be removed.


Reply via email to