7
7H3ju
Guest
7H3ju Asks: Sorting a collection of tuples using merge rearrangements
Given a collection of tuples $X=\{(x_1,y_1),\dots,(x_n,y_n)\}$, where elements $x_i, y_i \in R_{\geq 0}$ are non-negative real values. The collection $X$ is sorted if $x_i \leq x_{i+1}$ and $y_i \leq y_{i+1}$ for all $i \in [n-1]$. Sorting $X$ is not always possible for instance if the given input has two tuples $(x_i,y_i), (x_j,y_j)$ such that $x_i > x_j $ and $y_i < y_j$ for some $i \neq j$. So we want to merge tuples in $X$ so that the resulting collection is sorted and the merge operation $\phi(i,j,k)$ is defined as $$\phi(i,j,k) := \Big\{\text{assign}~X[k] \gets \big\{(x_k,y_k) = \big(\frac{x_i+x_j}{2}, \frac{y_i+y_j}{2}\big)\big\} ~\text{and delete}~(x_i,y_i), (x_j,y_j)~\text{from collection}~X \big\}.$$
The problem always has an obvious solution with $(n-1)$ merge operations i.e, merging everything to a single tuple is always feasible. But we would like to find the minimum number of merge operations required to sort the collection.
Even though we suspect that finding the minimum number of merge operations is NP-hard, we do not have a hardness proof to support the claim. The problem looks like something which might have been already studied in the literature. If you are aware of any related or similar problems please guide us to relevant results. Any pointers or clues for hardness or algorithmic results are helpful.
Example: Given $X=\{(1,4),(2,2),(3,2),(4,1)\}$ with two merge operations i.e, $\phi(1,4,3)$ followed by $\phi(1,2,1)$ we can obtain $\{(2.5,2),(2.5,2.5)\}$, which is sorted.
$$\{(1,4),(2,2),(3,2),(4,1)\} \xrightarrow[]{\phi(1,4,3)} \{(2,2),(3,2),(2.5,2.5)\}$$ $$\{(2,2),(3,2),(2.5,2.5)\} \xrightarrow[]{\phi(1,2,1)} \{(2.5,2),(2.5,2.5)\}$$
Note: If the merge operation is restricted to operations of the form $\phi(i,i+1,i)$, then the minimum number of operations can be found in polynomial time using a dynamic programming algorithm.
Thanks in advance.
Given a collection of tuples $X=\{(x_1,y_1),\dots,(x_n,y_n)\}$, where elements $x_i, y_i \in R_{\geq 0}$ are non-negative real values. The collection $X$ is sorted if $x_i \leq x_{i+1}$ and $y_i \leq y_{i+1}$ for all $i \in [n-1]$. Sorting $X$ is not always possible for instance if the given input has two tuples $(x_i,y_i), (x_j,y_j)$ such that $x_i > x_j $ and $y_i < y_j$ for some $i \neq j$. So we want to merge tuples in $X$ so that the resulting collection is sorted and the merge operation $\phi(i,j,k)$ is defined as $$\phi(i,j,k) := \Big\{\text{assign}~X[k] \gets \big\{(x_k,y_k) = \big(\frac{x_i+x_j}{2}, \frac{y_i+y_j}{2}\big)\big\} ~\text{and delete}~(x_i,y_i), (x_j,y_j)~\text{from collection}~X \big\}.$$
The problem always has an obvious solution with $(n-1)$ merge operations i.e, merging everything to a single tuple is always feasible. But we would like to find the minimum number of merge operations required to sort the collection.
Even though we suspect that finding the minimum number of merge operations is NP-hard, we do not have a hardness proof to support the claim. The problem looks like something which might have been already studied in the literature. If you are aware of any related or similar problems please guide us to relevant results. Any pointers or clues for hardness or algorithmic results are helpful.
Example: Given $X=\{(1,4),(2,2),(3,2),(4,1)\}$ with two merge operations i.e, $\phi(1,4,3)$ followed by $\phi(1,2,1)$ we can obtain $\{(2.5,2),(2.5,2.5)\}$, which is sorted.
$$\{(1,4),(2,2),(3,2),(4,1)\} \xrightarrow[]{\phi(1,4,3)} \{(2,2),(3,2),(2.5,2.5)\}$$ $$\{(2,2),(3,2),(2.5,2.5)\} \xrightarrow[]{\phi(1,2,1)} \{(2.5,2),(2.5,2.5)\}$$
Note: If the merge operation is restricted to operations of the form $\phi(i,i+1,i)$, then the minimum number of operations can be found in polynomial time using a dynamic programming algorithm.
Thanks in advance.
SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.