This can be solved by dynamic programming. The recurrence would be something like this :

cost [ i , pi ] =  min  (   cost[ i+1 , i ] + Ci + i - pi  ) ( i > pi )
                              (  cost [i+1 , pi ] + i - pi )    ( i > pi )
cost [ n , j ] = Cn  for 1<= j <=n

Least cost would be found in cost [ 0 , 0 ].

-Dhyanesh

On 3/9/06, gcet <[EMAIL PROTECTED]> wrote:

hi guys....
new problem for u....think abt it and help me :)

Suppose we want to replicate a file over a collection of n servers,
labeled S1,S2,....,Sn. To place a copy of the file at server Si results
in a placement cost of Ci, for an integer Ci>0. If a user requests the
file at server Si, and no copy of the file is present at Si, then the
servers Si+1,Si+2,.... zre scheduled in order until a copy of the file
is finally found, sat at server Sj, where j>i. This results in an
access cost of j-i. The accsess cost is 0 if Si holds a copy of the
file. We will require that a copy of the file be placed at server Sn,
so that all such searches will terminate, at the last, at Sn. A
configuration is a choice, for each server Si, with i=1,2,...,n-1, of
whether to place a copy of the file at Si or not. The total cost of a
configuration is the sum of all placement costs for servers with a copy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to