I'm having problem to solve this problem in DP:(adsbygoogle = window.adsbygoogle || []).push({});

Given 2 subsequences:

X = {x1, x2,...., xm} and Y = {y1, y2, .... , yn}

so `n <= m` and also `y1 <= y2 <= .... <= yn`.

The goal is to find a sub-sequence of `X` (xi1, xi2, ..... , xin) such that:

sum(k is 1 to n) | xik - yk | is minimal

The DP algorithm should be `o(mn)`.

I though about that: define `B(i,j)` as the minimun sum so |Y| is j and |X| is I, but it seems I get stuck here.

Any help?

Thanks in advance

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Dynamic programming problem

Loading...

Similar Threads for Dynamic programming problem |
---|

Insights Intro to Algorithms for Programming - Comments |

Nosé Hoover Thermostat for the realization of a canonical ensemble in molecular dynamics |

Difference between Energy Minimization and Equilibration |

Compute Fluid drag, Swim Physics |

Fortran Fortran for Computational Fluid Dynamics Problems |

**Physics Forums | Science Articles, Homework Help, Discussion**