The Poset Cover Problem

A partial order or poset   , P X   on a (finite) base set X determines the set   P  of linear extensions of P . The problem of computing, for a poset P , the cardinality of   P  is #P-complete. A set   1 2 , , , k P P P  of posets on X covers the set of linear orders that is the union of the   i P  . Given linear orders 1 2 , , , m L L L  on X , the Poset Cover problem is to determine the smallest number of posets that cover   1 2 , , , m L L L  . Here, we show that the decision version of this problem is NP-complete. On the positive side, we explore the use of cover relations for finding posets that cover a set of linear orders and present a polynomial-time algorithm to find a partial poset cover.


Introduction
Finite partial orders or posets have numerous applications, including scheduling [1][2][3][4][5][6][7][8], molecular evolution [9][10][11][12], data mining [13][14][15][16][17], graph theory [18][19][20][21][22][23], and algebra [24][25][26][27].Many applications implicitly or explicitly involve linear extensions of posets.For example, the solution of many scheduling problems requires a linearization of the jobs being scheduled consistent with some precedence constraints given by a poset.As the number of linear extensions of a poset may be exponential in the number of elements of the base set, many computational problems related to linear extensions are not solvable in polynomial time.Ruskey [28], West [29], Pruesse and Ruskey [30], Canfield and Williamson [31], Korsh and LaFollette [32], and Ono and Nakano [33] provide algorithms to generate all of the linear extensions of a finite poset.As the size of a solution may be exponentially large, these algorithms emphasize the ability to generate each successive linear extension in polynomial time, at least on average.Sampling the linear extensions of a poset is easier.Bubley and Dyer [34] use a rapidly mixing Markov chain to generate a random linear extension of a finite poset, sampled almost uniformly.
Problems in mining order information from databases of sequences (see, e.g., [16,17,35,36]) have an inverted character from that of many computational problems involving posets.Here, a problem instance is a set of linear orders of items from some universal set, while a solution is one or more posets that well explain, through their linear extensions, a significant number of the linear orders.An example from computational neuroscience [37] might go as follows.Each item is the firing of a neuron, while each linear order is a sequence of neuronal firings, ordered in time from an experiment.The solution is a neural circuit that explains a set of such linear orders.These novel problems are ripe for mathematical formalization and study.In this paper, we define and study one such problem.A problem instance is a set of permutations of a base set, and a solution covers the instance with linear extensions (Section 2).We prove that the Poset Cover problem (a decision problem) is NP-complete in Section 3. In Section 4, we explore how cover relations relate to poset covers.Finally, we develop a polynomial-time algorithm to find a partial cover in Section 5.

Preliminaries
In this section, we establish terminology and notation and prove some basic results.
A partial order or poset P is an irreflexive, antisymmetric, and transitive binary relation P  defined on a finite set X of cardinality 1 n  .We write P as the .In this case, the ordered pair   , x y is a cover relation for P .It is well-known that a (finite) poset is uniquely determined by its set of cover relations (see [38]).If   .The relation  on posets of X is reflexive, antisymmetric, and transitive.
A linear order   which is a permutation of X .Also, we write   L i for the element of rank i in L .A linear extension L of a poset P is a linear order such that P L  .The set of all linear extensions of P is   is the set of all linear orders on X .Brightwell and Winkler [39] prove that the problem of determining , , , k P P P    be a set of k posets on X .This set covers the set of linear orders and there is no poset P of X such that , . Let  be a set of posets on X , and let  be a set of linear orders on X . blankets  if  .
Lemma 1 Let  be the set of linear orders that is covered by a set  of posets of cardinality k .Then, there exists a cover  of cardinality k k   that also covers  such that every poset in  is maximal in  .
Proof.We construct  by examining each poset in  .Let P   .If P is maximal in  , then add P to  .Otherwise, let P be a poset of minimum cardinality (as a set of ordered pairs) such that , , , n L x x x   be a linear order on X .For each i satisfying 1 Swap ; , , , , , , , , , so the i -swap relation is symmetric, written i L L   .For pairs   , L L that are i -swaps of each other, for some i , we define the function

SwapIndex ,
L L i   .Note that the set differences of L and L , namely , each consist of a single ordered pair.In this case, the swap pair for L and L is the unordered pair

 
SwapPair , L L   .Two linear orders 1 L and 2 L differ by a swap, written 1 2 , then we write for some i , where the elements swapped are a and b .
Let  be a set of linear orders on X .The swap graph of  is the undirected graph Let P be a poset on X , and let L   .Then, P is a partial cover of . The swap graph is the same as the adjacent transposition graph of Pruesse and Ruskey [30].The swap graph of  is bipartite, since every edge connects an even permutation to an odd permutation.Moreover, the swap graph of the linear extensions of a single poset is connected (see [30]).
Let  be the set of all posets on X .Let A X X   be a set of ordered pairs.
The following properties of

 
Min A follow directly from the definitions.
Lemma 2 We have the following properties of up-sets and downsets.
< for all , Up .by the definition of down-sets.

NP-Completeness of Poset Cover
In this section, we show that PosetCover is NP-complete, in the process using the following known NP-complete decision problem [40].be a set of posets on X .First, it is easy to check whether k K  in time polynomial in n and m ; if k K  , then return No. Second, if the cardinality check succeeds, check whether  covers  as follows.For each poset i P in turn, use the Korsh and LaFollette [32] algorithm to generate all the linear extensions of i P , one at a time, in constant time per linear extension.As each linear extension is generated, check whether L   .If not, then return No.If so, then mark that element of  Covered.Note that the number of linear orders generated by a run of the Korsh and LaFollette algorithm before completion or returning No is at most m .Hence, the worst-case time for one run of the algorithm, including the checking, is   O mn .Once all the posets and their linear extensions are processed, check whether every element of  is marked Covered.If so, then return Yes; otherwise, return No.We find that the worstcase time to check whether  be an arbitrary labeling of the s edges of G .As a running example of our reduction, we provide the cubic graph in Figure 1 , , , n X x x x   be a base set of n elements.Let b L , the base order, be the linear order on X specified by We view the elements of X as consisting of 2 s  adjacent, non-overlapping pairs.Specifically, the pairs are 2 1 i x  and 2i x , where 1 2 i s    .All elements of  are obtained by a small set of swaps of such pairs, applied to b L .

Figure 1. A cubic graph as part of an instance of cubic vertex cover.
The first s pairs correspond to the s edges in a natural way.In particular, edge i e E  is associated with the edge order and, for example, , , , , For each vertex v V  , there are three edges incident on v ; let the indices of those edges be of these edges, we define the pair edge order to be For the running example, there are 18 pair edge orders.
, and   ,3 v e  , we define the triple edge order to be For the running example, there are 6 triple edge orders.The primary orders are the base, edge, pair edge, and triple edge orders.For primary pair edge order For primary triple edge order , , , there is a corresponding secondary triple edge order obtained by swapping 2 3 For the running example, there are 18 secondary pair edge orders and 6 secondary triple edge orders.
Collect the various orders into five sets, as follows: and are incident on some , and are incident on some , , .
We can now complete our instance of Poset Cover by setting and incident on some is a subset of  .Similarly, since the elements of C must be blanketed by any cover, we may assume that the set .
and that, by previous observations, it suffices to demonstrate that  blankets b L and A .Since G is nonempty, 0 E  , and 0 V   .Therefore, b L is blanketed by each of the posets , , in  , and hence every linear order in A is blanketed by  .We conclude that  covers  , as desired.Now, assume that  is a cover of  of cardinality at most K .By previous observations, we must have e be any edge of G , incident on vertices u and v .Without loss of generality, we may assume that . There are two maximal posets that blanket  and .
, as desired.The theorem follows.

Cover Relations
In this section, we examine properties of cover relations in linear orders and their consequences for poset covers.Let

 
, P P X   be a poset, thought of as a transitive DAG.Then, a topological sort of P yields an order 1 2 , , , n x x x  on X such that i P j x x  implies i j  .Assume that P is not a linear order.Then there exist , a b X  such that P a b .There exists at least one topological sort of P in which a appears to the left of b , and there exists at least one topological sort of P in which b appears to the left of a . (This follows from alternate choices available to the depth-first search used to construct a topological sort.See [41].)Select a topological sort that makes


. By applying Theorem 6 iteratively to P , we ultimately obtain a linear order L that is an extension of P (and hence of P ) such that Then P is a poset on X such that P P  and such that a and b are incom- parable in P .Moreover, , so 2 L is a linear extension of P in which 2 b a  .The theorem follows.Theorem 8 Let  be a set of linear orders on X .Let L i   , then i x and x  are comparable in P and L i   .First assume that i x and 1 i x  are comparable in P .Then it must be true that , since For the other direction, assume that, for every , a b X  for which a b   , exactly one of 1), 2), or 3) holds.Take P to be the poset generated by all the ordered pairs   , a b such that , a b is a cover sequence for  .We need to show that  equals the set of linear extensions of P .There are two cases to consider for each linear order L .Let , , , n L x x x   .Case 1. L   .To obtain a contradiction, assume that L is not a linear extension of P .Then there exist i x and , , , , , ,  cover sequence for  and hence 2) holds for x x  is a cover sequence for  , a contradiction to the fact that 3) does not hold.In this case, we conclude that L is a linear extension of P .
Case 2. L    .Without loss of generality, we may assume that there exist L and i such that L   and  is a cover sequence for  .Hence, and L cannot be a linear extension of P .
We conclude that  is precisely the set of linear extensions of P .
The theorem follows.

A Partial Cover Algorithm
In this section, we present an algorithm for finding a poset that is a partial cover with a maximal set of linear extensions.

Some Intuition
Intuition for designing an algorithm to find a partial poset cover for a set  of linear orders is developed first.It suffices to take a single L   and identify a single poset P that is a partial cover of  including L .Observe that L is such a poset but is not satisfactory if we can construct a poset P L   that covers more of  .
We use the swap graph     to direct construction of a more satisfactory P .
During the process of constructing P , we maintain a specification for a set of posets, each of which covers a constructed set     .We also maintain a set     consisting of linear orders, including L , that have already been chosen to be covered by the final constructed poset.This specification consists of two kinds of information: some  relations and some ‖ relations.These relations must be consistent, that is, there must be at least one poset that satisfies them all.A bit more formally, the  relations can be specified by a set A X X   of ordered pairs, while the ‖ relations can be specified by a set B will be maintained to satisfy the following property.Again, let L   be arbitrary, and let  .The rational for this requirement is that every poset P that covers both L and L satisfies the relation can be eliminated from further consideration for inclusion in  .
We will need these definitions.Let , a b X  be distinct, and let L be a linear order.The   , a b -interchange of L is the linear order that is the same as L except a and b have been exchanged.Let 0 1 , , , k L L L  be a sequence of linear orders such that 1 ,S w a p P a i r ,

The Algorithm
Figure 2 contains pseudocode for the algorithm Partial- . It works by adding linear orders from \    to  one at a time, while maintaining the required properties for A and B. The subroutine Trim in Figure 3 is used to ensure that the required property for A is maintained.The addition of a linear order to  (Step 9) can add at most one new unordered pair to B (Step 10).
We illustrate the algorithm with the example having  

Proof of Correctness
We assume that the following loop invariants hold each time that the test at the top of the while loop body (Step 7) is executed.To obtain a contradiction, assume that there is some i L that is not in  .Let i L be the first such.Then 0 i   , so L  cannot be in  , since it would have been deleted in a previous iteration due to the swap pair   , c d being in B .This is a contradiction.We conclude that all of the i L 's are in  .We next show that P is not just a shortest Blabeled path but is also a shortest path in  .Note that, therefore, no swap pair occurs more than once in P .
We next show that P is a B -labeled path.Since P contains no swap pair more than once and since , which is in C by the argument above.We conclude that P is a C -labeled path and hence a B -labeled path.
Finally, we show that either all of the i L  's are in   or none of them are.To obtain a contradiction, suppose that i L     and that O n  , as required.
of these posets must be in  .Moreover, we may assume that  contains only orders of this form, since each such order blankets b L , and the only other orders for  to blanket are the i e L 's. Define that case, we obtain a proper extension P of P in which maintained to satisfy the following property.Let L   be arbitrary, and let we require that   , a b A  .The rational for this requirement is that every poset P that covers L and does not cover L satisfies the relation from further consideration for inclusion in  .
B   .The first time that Step 8 is executed in Partial-Cover, The call to Trim in Step 11 finds that 21435 is not in   .The resulting cover relation   3, 4 is not new, so A remains while loop from Steps 13 to 21 has only the swap pair    (Step 10).The call to Trim in Step 11 finds that 21534 is not in   .The resulting cover relation   3,5 is new, so A is extended to the linear orders in   has 5 less than 3, so the call to Trim does not change   .The while loop from Steps 13 to 21 now has the swap pair   4, 5 to work with.Linear orders 32145, 31245, and 13245 are missing their   4, 5 swap part-

5 ) 7 )
is a connected graph, and     is a connected graph.3)The directed graph   , X A contains no cycles.4) Every element of   is a linear extension of Min A , that is, The set A equals the set of ordered pairs   , a b X X   for which there exists L  such that The set B equals the set of unordered pairs that Q is a shortest B -labeled path from 0 swap pair for some edge in the path.Consequently, C B  .Moreover, there is a path in only from C and each only once, so the length of every shortest path from 0 L to k L is C .(Think about the swaps done by bubble sort; these give one such shortest path.)Since P is a shortest Blabeled path from 0 L to k L , it must be a C -labeled path having k C is a swap pair   , a x labeling an edge of P , we must also have the swap pair   , b x labeling another edge of P , and vice versa.More succinctly,   ,

2 2 O
yield a contradiction by an analogous argument.)But, in this case, i L  would have been deleted from   in an earlier iteration, a contradiction.From this contradiction, we conclude that either all of the i L  's are in   or none of them are.Hence, Invariant 8 holds.The correctness and time complexity of the algorithm are now in view.Theorem 11 Algorithm Partial-Cover   , L  returns a set A such that   Min A is a partial cover of  including L .The algorithm has time complexity The correctness of the algorithm follows from the prior discussion of the loop invariants.For the time complexity, we first note that subroutine Trim.Trim is executed once in Step 5; once for each addition to  (Step 11;   O  times in total); and once for each deletion in Step 19 (Step 20;   O  times in total).Hence, Trim is executed   O  times.The loop in Steps 5 through 9 requires   O n  time for one execution.The time complexity to test coverage in Step 11 requires     2 O A O n  time.Hence, the loop in Steps 10 through 13 requires   2 O n  time for one execution.The while loop is executed   O  times, since each additional iteration of the loop because done False  requires the reduction of the cardinality of   by at least one.We conclude that the total time spent in trim is   n  .It is easy to check that the complexity bound for all calls to Trim dominates the time complexity of the algorithm.Hence, the time complexity of Partial-Cover is   2 2 . Since P is not maximal, P P   .More- over, any poset P contained in P of smaller cardinality will have   P    .Add P to  .The constructed  has cardinality k  .Moreover,  also covers  and every poset in  is maximal in  .The lemma follows.
P    The up-set of A is We show that Poset Cover is in NP and that Cubic Vertex Cover reduces to Poset Cover in polynomial time.We first show that Poset Cover is in NP.Let X , V  ?Theorem 4 Poset Cover is NP-complete.Proof.
, and K constitute the corresponding instance of Poset Cover, as constructed above.By Lemma 1, we may assume that every element of a cover  of  is maximal in  .Since the elements of B must be blanketed by any cover, we may assume that the set , eL is blanketed by the poset to the DAG for P and taking the transitive closure gives us the desired poset.The case requires that the algorithm never deletes an element of  from   in Step 19 or in Trim.That fact also implies L   , since L is initially put in  (Step 2) and could only be deleted in Step 19 or in Trim.The algorithm never deletes an element of  from   in Trim.To obtain a contradiction, assume that is deleted in Step 12 of Trim and that it is the first element of  deleted.The deletion of j implies that A and B are inconsistent.Invariants 4 and 5 are maintained by Trim.The consistency of A and B (Invariant 6) is maintained by Trim and the loop at Steps 15 through 21.Invariant 7 is maintained by the way that elements are added to B (Step 10).
j L  