This preview shows page 1. Sign up to view the full content.
Unformatted text preview: (so that the th row is followed by the st row). A path across the cylinder is a succession of n array elements, such that the ﬁrst element in the path is an element of the ﬁrst column, the last element in the path is an element of the last column, and an element can be followed only by one of the three adjacent elements in the next column, namely, , , or (where all arithmetic is done modulo n). The cost of a path is simply the sum of the values of the elements in the squares crossed on the path. a. Give a recurrence relation for Min-Cost(i,j), the miminum cost of a path starting at the ﬁrst column and reaching element . b. Use the recurrence relation to design an efﬁcient algorithm which ﬁnds a minimum-cost path across the cylinder. c. Analyze and give an asymptotic upper bound on the time complexity of your algorithm. 1...
View Full Document
This note was uploaded on 05/27/2011 for the course COT 5405 taught by Professor Ungor during the Fall '08 term at University of Florida.
- Fall '08