through the looking glass
play

Through the Looking Glass Alice found there . . . and what Alice - PowerPoint PPT Presentation

Through the Looking Glass ... and what Through the Looking Glass Alice found there . . . and what Alice found there Frank Mittelbach TUG Conference 2017, Bachotek Introduction Dynamic programming Frank Mittelbach Algorithms


  1. Through the Looking Glass ... and what Through the Looking Glass Alice found there . . . and what Alice found there Frank Mittelbach TUG Conference 2017, Bachotek Introduction Dynamic programming Frank Mittelbach Algorithms frank.mittelbach@latex-project.org Aesthetics only L A T EX3 Project April 29, 2017 ( ) : :

  2. Time and space Through the “Well, in OUR country,” said Looking Glass ... and what Alice, still panting a little, Alice found there “you’d generally get to Frank somewhere else—if you ran Mittelbach very fast for a long time, as Introduction we’ve been doing.” Dynamic programming Algorithms “A slow sort of country!” said Aesthetics the Queen. “Now, HERE, only you see, it takes all the running YOU can do, to keep in the same place. If you want to get somewhere else, you must run at least twice as fast John Tenniel, 1870 as that!” ( ) : :

  3. Time and space Through the Looking Glass Placing figures on pages (general formula) ... and what Alice found there � � pages + figures − 1 = ? Frank figures Mittelbach Introduction Placing figures on pages (one per page maximum) Dynamic programming � � pages Algorithms = ? Aesthetics figures only Examples (assuming 1 second per quality assessment) ◮ 16 pages, 9 figures → 11440 trials → 3.1 hours ◮ 90 pages, 28 figures → 1 . 548 × 10 23 trials → 4 . 91 × 10 15 years ( ) : :

  4. Time and space Through the Looking Glass Placing figures on pages (general formula) ... and what Alice found there � � pages + figures − 1 = ? Frank figures Mittelbach Introduction Placing figures on pages (one per page maximum) Dynamic programming � � pages Algorithms = ? Aesthetics figures only Examples (assuming 1 second per quality assessment) ◮ 16 pages, 9 figures → 11440 trials → 3.1 hours ◮ 90 pages, 28 figures → 1 . 548 × 10 23 trials → 4 . 91 × 10 15 years ( ) : :

  5. Time and space Through the Looking Glass Placing figures on pages (general formula) ... and what Alice found there � � pages + figures − 1 = ? Frank figures Mittelbach Introduction Placing figures on pages (one per page maximum) Dynamic programming � � pages Algorithms = ? Aesthetics figures only Examples (assuming 1 second per quality assessment) ◮ 16 pages, 9 figures → 11440 trials → 3.1 hours ◮ 90 pages, 28 figures → 1 . 548 × 10 23 trials → 4 . 91 × 10 15 years ( ) : :

  6. So what now? Through the Looking Glass ... and what Alice found there Frank Mittelbach Introduction Dynamic programming Algorithms Aesthetics only Can it be helped a little? Takayama 2009 ( ) : :

  7. Defining the problem Through the Looking Glass ... and what Alice found Input model there ◮ A sequence of text blocks T = { t 1 , t 2 , . . . , t n } Frank Mittelbach ◮ A sequence of (figure) floats F = { f 1 , f 2 , . . . , f ℓ } Introduction ◮ (possibly some more float sequences — ignored for now) Dynamic programming Algorithms Layout model Aesthetics only ◮ A sequence of spreads S 1 , S 2 , . . . , S k ◮ with columns/pages (sizes may differ) ◮ with areas for floats ◮ constraints for the filling process ◮ some further auxiliary information ( ) : :

  8. Defining the problem Through the Looking Glass ... and what Alice found Input model there ◮ A sequence of text blocks T = { t 1 , t 2 , . . . , t n } Frank Mittelbach ◮ A sequence of (figure) floats F = { f 1 , f 2 , . . . , f ℓ } Introduction ◮ (possibly some more float sequences — ignored for now) Dynamic programming Algorithms Layout model Aesthetics only ◮ A sequence of spreads S 1 , S 2 , . . . , S k ◮ with columns/pages (sizes may differ) ◮ with areas for floats ◮ constraints for the filling process ◮ some further auxiliary information ( ) : :

  9. Defining the problem (continued) Through the Looking Glass Paginations ... and what Alice found there ◮ A mapping p : T ∪ F → { 1 , 2 , . . . , k } such that Frank Mittelbach p ( t i ) ≤ p ( t j ) for 1 ≤ i < j ≤ n Introduction p ( f i ) ≤ p ( f j ) for 1 ≤ i < j ≤ ℓ Dynamic programming ◮ P is the set of all possible paginations of T ∪ F Algorithms Aesthetics only Objective function (cost function) ◮ A function Q : P → ℜ Optimization task ◮ We seek: p 0 ∈ P such that Q ( p 0 ) ≤ Q ( p ) for all p ∈ P ( ) : :

  10. Defining the problem (continued) Through the Looking Glass Paginations ... and what Alice found there ◮ A mapping p : T ∪ F → { 1 , 2 , . . . , k } such that Frank Mittelbach p ( t i ) ≤ p ( t j ) for 1 ≤ i < j ≤ n Introduction p ( f i ) ≤ p ( f j ) for 1 ≤ i < j ≤ ℓ Dynamic programming ◮ P is the set of all possible paginations of T ∪ F Algorithms Aesthetics only Objective function (cost function) ◮ A function Q : P → ℜ Optimization task ◮ We seek: p 0 ∈ P such that Q ( p 0 ) ≤ Q ( p ) for all p ∈ P ( ) : :

  11. Defining the problem (continued) Through the Looking Glass Paginations ... and what Alice found there ◮ A mapping p : T ∪ F → { 1 , 2 , . . . , k } such that Frank Mittelbach p ( t i ) ≤ p ( t j ) for 1 ≤ i < j ≤ n Introduction p ( f i ) ≤ p ( f j ) for 1 ≤ i < j ≤ ℓ Dynamic programming ◮ P is the set of all possible paginations of T ∪ F Algorithms Aesthetics only Objective function (cost function) ◮ A function Q : P → ℜ Optimization task ◮ We seek: p 0 ∈ P such that Q ( p 0 ) ≤ Q ( p ) for all p ∈ P ( ) : :

  12. What can we do? (Getting requirements for Q ) Through the Example 1: Make a gut decision Looking Glass ... and what ◮ I.e., look at each pagination (for a second) and decide Alice found there ◮ Clearly not workable: Frank Mittelbach ◮ Already for “Through the Looking Glass” that takes longer than the current age of the universe Introduction Dynamic programming Example 2: Base decision on call-out/float distance Algorithms ◮ I.e., how many pages do I need to turn to reach a float Aesthetics only ◮ Linear formula: solvable using dynamic programming ◮ Quadratic formula: NP-complete as shown by Plass Example 3: Recto/verso criteria ◮ E.g., penalize if call-out and float are on the same type of page ◮ Again NP-complete as shown by Plass ( ) : :

  13. What can we do? (Getting requirements for Q ) Through the Example 1: Make a gut decision Looking Glass ... and what ◮ I.e., look at each pagination (for a second) and decide Alice found there ◮ Clearly not workable: Frank Mittelbach ◮ Already for “Through the Looking Glass” that takes longer than the current age of the universe Introduction Dynamic programming Example 2: Base decision on call-out/float distance Algorithms ◮ I.e., how many pages do I need to turn to reach a float Aesthetics only ◮ Linear formula: solvable using dynamic programming ◮ Quadratic formula: NP-complete as shown by Plass Example 3: Recto/verso criteria ◮ E.g., penalize if call-out and float are on the same type of page ◮ Again NP-complete as shown by Plass ( ) : :

  14. What can we do? (Getting requirements for Q ) Through the Example 1: Make a gut decision Looking Glass ... and what ◮ I.e., look at each pagination (for a second) and decide Alice found there ◮ Clearly not workable: Frank Mittelbach ◮ Already for “Through the Looking Glass” that takes longer than the current age of the universe Introduction Dynamic programming Example 2: Base decision on call-out/float distance Algorithms ◮ I.e., how many pages do I need to turn to reach a float Aesthetics only ◮ Linear formula: solvable using dynamic programming ◮ Quadratic formula: NP-complete as shown by Plass Example 3: Recto/verso criteria ◮ E.g., penalize if call-out and float are on the same type of page ◮ Again NP-complete as shown by Plass ( ) : :

  15. The dynamic programming methodology When possible? Through the Looking Glass ... and what Alice found there Frank Mittelbach Problem consists of overlapping subproblems Introduction ◮ Clearly, that’s the case (with sensible subproblems) Dynamic programming Algorithms Problem exhibits optimal substructure (optimality principle) Aesthetics only ◮ The tricky bit ( ) : :

  16. The dynamic programming methodology When possible? Through the Looking Glass ... and what Alice found there Frank Mittelbach Problem consists of overlapping subproblems Introduction ◮ Clearly, that’s the case (with sensible subproblems) Dynamic programming Algorithms Problem exhibits optimal substructure (optimality principle) Aesthetics only ◮ The tricky bit ( ) : :

  17. The dynamic programming methodology When possible? Through the Looking Glass ... and what Alice found there Problem consists of overlapping subproblems Frank Mittelbach ◮ Clearly, that’s the case (with sensible subproblems) Introduction a,b ◮ We denote with P ( S i ,..., S j ) c,d to mean Dynamic programming ◮ all paginations of text blocks t a , . . . , t b and figures Algorithms f c , . . . , f d onto spreads S i , . . . , S j Aesthetics only Problem exhibits optimal substructure (optimality principle) ◮ The tricky bit ( ) : :

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend