<p>Let $(P, &lt;, \mu)$ be a labeled poset, that is, a partial order $(P, &lt;)$ with a labeling function $\mu$ that maps the elements of $P$ to labels in an alphabet $\Sigma$. A <em>label list</em> (or <em>word</em>) is a finite sequence $L$ of elements of $\Sigma$ (formally $L$ maps every position $i \in \{1, \ldots, |L|\}$ to a label $L[i] \in \Sigma$, where $|L|$ is the length of $L$). We say that $L$ is a <em>linear extension</em> of $P$ if there is an order- and value-preserving bijection $f$ from $P$ to $L$: formally, $f$ is a bijection from $P$ to $\{1, \ldots, |L|\}$, we have $\forall x, y \in P$, if $x &lt; y$ then $f(x) &lt; f(y)$, and $\forall x \in P$, $\mu(x) = L[f(x)]$.</p>

<p><strong>My question is to determine the complexity of the following problem:</strong> I am given as input a set $S$ of label lists, and I want to know if there exists a labeled poset $P_S$ such that $S$ is <em>exactly</em> the set of the linear extensions of $P_S$. (Also, if possible, compute $P_S$.)</p>

<p>For instance, for the input $S = \{(A, B, A), (A, A, B)\}$, a choice of labeled poset would be $P_S = (\{a_1, a_2, b\}, &lt;_S, \mu_S)$, where $&lt;_S = \{a_1 &lt; a_2, a_1 &lt; b\}$ and $\mu_S$ maps $a_1$ and $a_2$ to $A$ and $b$ to $B$.</p>

<p>Of course, the answer is trivially "no" if all lists of $S$ do not have the same length, or actually if they do not have the same domain of values (seen as a multiset). Conversely, if they do, I can easily construct a labeled poset (e.g., the empty order relation on the domain) such that all label lists of $S$ are linear extensions of the poset. However, can I do this and avoid that other label lists not in $S$ are also extensions?</p>

<p>Other remarks:</p>

<ul>
<li><p>The problem can alternatively be phrased in terms of directed labeled graphs and topological sorts: a label list $L$ is a linear extension of a labeled poset $P$ iff it is the label of some topological sort of a labeled transitive DAG $G_P$ that represents $P$ (i.e., its Hasse diagram). So my problem can be equivalently phrased as follows: given $S$, determine if there is a labeled DAG $G_S$ such that $S$ is <em>exactly</em> the set of the labels of the topological sorts of $G_S$.</p></li>
<li><p>For the case of ordinary posets (not labeled posets), or equivalently of unlabeled DAGs, the problem <a href="http://people.cs.vt.edu/naren/papers/poset-kdd06.pdf" rel="nofollow noreferrer">is in PTIME</a>. The argument is to construct a candidate poset $P_S$ by intersecting the comparability relations implied by $S$ (which you cannot do in the labeled case because of the ambiguity of labels), and then check that $P_S$ realizes no other linear extensions by enumerating them (you cannot tractably do this with labels because there may be a lot of "linear extensions" that end up being the same label set). This implies that the problem is in PTIME if the list $L$ contains no duplicate values, or if $\mu$ is injective.</p></li>
<li><p>Other related results are the fact that counting the number of linear extensions of an input labeled poset (actually, even when there are no labels), <a href="http://link.springer.com/article/10.1007%2FBF00383444" rel="nofollow noreferrer">is #P-hard</a>. This does not imply hardness of my problem, though, because enumeration approaches could conceivably work though they do not directly adapt (see above). Also, from an <a href="https://cstheory.stackexchange.com/a/19415">answer to a previous question</a> I know that it is NP-hard, given a labeled poset $P$ and label list $L$, to determine whether $L$ is a linear extension of $P$; yet I see no easy reduction between that problem and the question asked here.</p></li>
<li><p>I am not even sure that my problem is in NP. Of course we can try to guess the poset $P_S$ and bijections that realize the linear extensions of $S$, but then we need to verify the absence of other linear extensions, so this only gives a $\Sigma_2^P$ upper bound.</p></li>
</ul>

CC BY-SA 3.0
2014-11-24T21:53:36.603Z
Nitpick: Unless it is a standard terminology, I would call L a “label list” instead of “labeled list,” because it is a list of labels instead of a list of something with labels.
Tsuyoshi Ito
CC BY-SA 3.0
2014-11-25T07:28:46.377Z
OK, I renamed it. I had just made up the terminology. A more standard term would be just *word*, which I added.
Antoine Amarilli 'a3nm'
CC BY-SA 3.0
2014-11-25T20:06:31.717Z
A small observation: If S is given as a multiset by repeating duplicate elements, then the problem is in NP because the linear extensions of a poset can be enumerated in polynomial time per output by using backtracking.
Tsuyoshi Ito
CC BY-SA 3.0
2014-11-25T21:19:55.283Z
@TsuyoshiIto: True, I believe this is how the case of unlabeled posets works, so indeed we can extend it to labeled posets in this way... but it doesn't help if the same label lists can be obtained in a large number of possible ways.
Antoine Amarilli 'a3nm'
<cc.complexity-theory><ds.algorithms><np-hardness><partial-order><order-theory>
Reconstructing labeled poset from linear extensions
Antoine Amarilli 'a3nm'
# Reconstructing labeled poset from linear extensions

(Asked by: username_0 on 2014-11-24)

Let $(P, <, \mu)$ be a labeled poset, that is, a partial order $(P, <)$ with a labeling function $\mu$ that maps the elements of $P$ to labels in an alphabet $\Sigma$. A *label list* (or *word*) is a finite sequence $L$ of elements of $\Sigma$ (formally $L$ maps every position $i \in \{1, \ldots, |L|\}$ to a label $L[i] \in \Sigma$, where $|L|$ is the length of $L$). We say that $L$ is a *linear extension* of $P$ if there is an order- and value-preserving bijection $f$ from $P$ to $L$: formally, $f$ is a bijection from $P$ to $\{1, \ldots, |L|\}$, we have $\forall x, y \in P$, if $x < y$ then $f(x) < f(y)$, and $\forall x \in P$, $\mu(x) = L[f(x)]$.

**My question is to determine the complexity of the following problem:** I am given as input a set $S$ of label lists, and I want to know if there exists a labeled poset $P\_S$ such that $S$ is *exactly* the set of the linear extensions of $P\_S$. (Also, if possible, compute $P\_S$.)

For instance, for the input $S = \{(A, B, A), (A, A, B)\}$, a choice of labeled poset would be $P\_S = (\{a\_1, a\_2, b\}, <\_S, \mu\_S)$, where $<\_S = \{a\_1 < a\_2, a\_1 < b\}$ and $\mu\_S$ maps $a\_1$ and $a\_2$ to $A$ and $b$ to $B$.

Of course, the answer is trivially "no" if all lists of $S$ do not have the same length, or actually if they do not have the same domain of values (seen as a multiset). Conversely, if they do, I can easily construct a labeled poset (e.g., the empty order relation on the domain) such that all label lists of $S$ are linear extensions of the poset. However, can I do this and avoid that other label lists not in $S$ are also extensions?

Other remarks:

* The problem can alternatively be phrased in terms of directed labeled graphs and topological sorts: a label list $L$ is a linear extension of a labeled poset $P$ iff it is the label of some topological sort of a labeled transitive DAG $G\_P$ that represents $P$ (i.e., its Hasse diagram). So my problem can be equivalently phrased as follows: given $S$, determine if there is a labeled DAG $G\_S$ such that $S$ is *exactly* the set of the labels of the topological sorts of $G\_S$.
* For the case of ordinary posets (not labeled posets), or equivalently of unlabeled DAGs, the problem [is in PTIME](http://people.cs.vt.edu/naren/papers/poset-kdd06.pdf). The argument is to construct a candidate poset $P\_S$ by intersecting the comparability relations implied by $S$ (which you cannot do in the labeled case because of the ambiguity of labels), and then check that $P\_S$ realizes no other linear extensions by enumerating them (you cannot tractably do this with labels because there may be a lot of "linear extensions" that end up being the same label set). This implies that the problem is in PTIME if the list $L$ contains no duplicate values, or if $\mu$ is injective.
* Other related results are the fact that counting the number of linear extensions of an input labeled poset (actually, even when there are no labels), [is #P-hard](http://link.springer.com/article/10.1007%2FBF00383444). This does not imply hardness of my problem, though, because enumeration approaches could conceivably work though they do not directly adapt (see above). Also, from an [answer to a previous question](https://cstheory.stackexchange.com/a/19415) I know that it is NP-hard, given a labeled poset $P$ and label list $L$, to determine whether $L$ is a linear extension of $P$; yet I see no easy reduction between that problem and the question asked here.
* I am not even sure that my problem is in NP. Of course we can try to guess the poset $P\_S$ and bijections that realize the linear extensions of $S$, but then we need to verify the absence of other linear extensions, so this only gives a $\Sigma\_2^P$ upper bound.

**Tags:** cc.complexity-theory, ds.algorithms, np-hardness, partial-order, order-theory

> **Comments:**
> **username_1**: Nitpick: Unless it is a standard terminology, I would call L a “label list” instead of “labeled list,” because it is a list of labels instead of a list of something with labels.  
> **username_0**: OK, I renamed it. I had just made up the terminology. A more standard term would be just *word*, which I added.  
> **username_1**: A small observation: If S is given as a multiset by repeating duplicate elements, then the problem is in NP because the linear extensions of a poset can be enumerated in polynomial time per output by using backtracking.  
> **username_0**: @TsuyoshiIto: True, I believe this is how the case of unlabeled posets works, so indeed we can extend it to labeled posets in this way... but it doesn't help if the same label lists can be obtained in a large number of possible ways.  

---

## 0 answers

