Блог пользователя typedeftemplate

Автор typedeftemplate, история, 2 года назад, По-английски

Given a tree in which each vertex represents an interval [x_i, y_i], you can merge adjacent vertices iff they intersect. The merged vertex has a new interval corresponding to the intersection of the previous two intervals, and its neighbors are the union of the neighbors of the merged vertices. How can you minimize the number of vertices after the process terminates?

I tried rooting the tree and attempting dynamic programming, but I’m not sure how to approach this. Any ideas?

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится