This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Problem 1 0) Construction of the Algorithm Let’s consider a function s ( i,j ) = " j 1 X k = i c k + 1 # + c j that by definition of the problem calculates the amount of characters there are in a line consisting of the words [ w i ,w i +1 ,...,w j ] Because we know that a line is bounded by L characters, we can find the maximum number of words there are before word w j by finding a k such that s ( k,n ) ≤ L s ( k 1 ,n ) > L or k 1 < and enclose this operation within a function called findsegment(). We can then make the observation that if k = findsegment() is the starting position of the last line of the optimal solution, then the sum of the slacks square is just  L s ( k,n )  2 + best of slacks 2 ( k 1). However, if w k is not part of the last line in the optimal solution, then we iterate through all i such that k ≤ i < n and find the minimum value of  L s ( i,n )  2 + best of slacks 2 ( i 1). Already, we can define an optimum function of the sum of squares of the slack that gives us polynomially scaled sets of subspaces with a simple recurrence.polynomially scaled sets of subspaces with a simple recurrence....
View
Full
Document
This note was uploaded on 03/12/2012 for the course CS 4820 taught by Professor Kleinberg during the Spring '08 term at Cornell.
 Spring '08
 KLEINBERG
 Algorithms

Click to edit the document details