Dilworth theorem, chain or anti-chain?

Source: Internet
Author: User

In the past two days, the chain, and anti-chain products have become dizzy and finally have a bit of eyebrows. Let's sum up.

What the Dilworth theorem says is: For an ordering Set, the minimum number of chain partitions is equal to the length of its longest anti-chain.

The dual theorem of the Dilworth theorem refers to the fact that the minimum number of anti-Chain Division of a partial sequence is equal to the length of the longest chain.

The Dilworth theorem does not prove it first, but does not come up any time. Its Dual theorem proves as follows:

Set the minimum number of anti-chain partitions of an ordinal set S to P and the maximum length to R.

1. Verify P≥R. This is obvious, because the maximum length of a chain is R, any two of the r elements can be compared, so they must belong to different anti-chain pairs, so the number of anti-chain≥R, that is, P≥R.

2. re-verify R≥P. Set X1 = S. Find all the minimization elements of X1 and set Z1, delete it from X1, get X2, and then find all the minimization elements of X2 to form the set Z2 (pay special attention to any Element A2 in Z2, there must be an element A1 in X1 to make A1≤ A2, otherwise A2 can be placed in X1, which is in conflict with the selection of X1)And then delete Z2 from X2 to get X3 ,...... In this way, there is always a k so that the XK is not empty, but the X (k + 1) is empty. In this way, we can get a chain A1, A2, A3 ,......, AK, where Ai belongs to Xi. Because r is the longest chain length, R≥ K. On the other hand, we also get a anti-Chain Division, that is, x1, x2, X3 ,......, XK. Since P is the least anti-Chain Division, K≥P. Therefore, R≥P. Pass.

The missile interception problem can be repeated as follows: For an integer sequence s, the first question is the longest ascending subsequence, and the second question is the division number of the smallest ascending sequence.

first, define a partial order relationship. For any two numbers A and B in S, if A is not later than B and the value of A is not less than B, A and B will satisfy the partial order relationship, A ≤ B. pay special attention to the following two points: first, this is less than or equal to the number, and it is a partial order relationship, instead of being less than or equal to the value. Second, the definition says " A appears no later than B ", instead of " the appearance of a is prior to B ". This is because the partial order relationship has an Inverse symmetry, that is, the relationship between A and A is also partial.

for example, the series S is: 1, 2, and 3, 2 , 4, 1, 3, 4. The values 3 and 2 in red meet the partial order of the preceding definition. 3 ≤ 2 . In this way, a non-ascending subsequence is a chain, and the longest non-ascending subsequence is the length of the longest chain. According to the dual theorem, it is equal to the minimum number of anti-chain segments. By proving the dual theorem, we can find a minimal element set each time to obtain the least anti-Chain Division. the minimum element set here is a set like this: before a, x ≤ x. once again, the less than or equal sign indicates the partial order, not the value. According to the definition of the above partial order relationship, it can be understood as "There is no number not less than a before a", that is, there is no number greater than or equal to a before. It is not difficult to find out after conversion. you can find an ascending subsequence every time! the greedy process is as follows:

1, 2, 3,2,4,1,3, 4

The Red 1, 2, 3, 4 is X1, that is, the first anti-chain, the Blue 2, 3, 4 is X2, and the Green 1 is X3. That is, the maximum length of S sequence is 3, which can be obtained from each of the three anti-chains, such as 3, 2, and 1. Of course, this complexity is O (n ^ 2), there is no need to do so, there is a better O (nlogn)AlgorithmThis is a digress.

For the second problem, we find that the division of the chain is at least not ascending, that is, the chain division. According to the theorem, we can convert it into the longest anti-chain length. In fact, in generalThe Dilworth theorem is used in turn, that is, to find the longest anti-chain length and convert it into the smallest Chain Division of the ball. This can be obtained by finding the minimum path overwrite of the Dag. Of course, this can also be done.

I read a lot onlineArticleThe second question can be greedy, but why can it be greedy? It's a mess. Greedy solutions are actually based on the dual theorem of the Dilworth theorem, just like the proof process 2 above. However, many online users say that the greedy solution is due to the Dilworth theorem. This is just nonsense! (Of course, it is not excluded that I did not take a closer look at the process of proof of the Dilworth theorem. It is possible that the proof of the Dilworth theorem is greedy, but I have read it once and remember it)

This question can be greedy, but it is not because of the Dilworth theorem, nor is it because the dual theorem is applied directly like above (if so, it is even more nonsense ). Let's look at the second question again. We want to find at least no ascending sequence division, that is, chain division, that is, the longest anti-chain length. What is anti-chain? Is the ascending subsequence, so the second question is the longest ascending subsequence length. If we reverse the sequence, for example, S is followed by s ':,; that is, the longest ascending subsequence of the original sequence is changed to the longest descent subsequence of S, this is obvious.

We re-define a non-strict partial order relationship for S. For any two numbers A and B in S, if a appears earlier than B and the value of A is greater than B, then define≤ B. I ignore the anti-symmetry here, but it does not affect this question.DilworthProof of the dual theorem of the theorem.

So you can be greedy as above: each time you select a minimal subset, so that each a in it satisfies: There is no number with a value greater than a before. Convert it again,That is to say, each greedy search for a sequence without downgrading!So the anti-Chain Division under such a new "Partial Order" relationship:

4,3,1,4,2,3,2,1

Therefore, the longest chain length is 4. That is, S'The Longest descent sub-sequence length is 4, that is, the second answer to the original question is 4.

This method can also be used for pku1065. That is to say, you can also define a partial order relationship for anti-chain to make it another kind of "chain ".

To sum up, we can use the dual theorem of the Dilworth theorem to solve the chain and anti-chain problems in special cases. What is special?There are two different partial order definitions, so that the reverse chain under one partial order definition can form another partial order definition chain!For example, for missile interception, the longest ascending sequence can be obtained by the greedy method, and the longest descending sequence can be obtained by the greedy method. What a magic !!

Now let's think about how HDU can be converted in this way without division? Well, you have to think about it in two days ..

PS: Let's repeat the second question and ask for at least no ascending sequence division. In fact, we can redefine a "Partial Order" relationship so that a non-ascending sequence is a reverse chain under this definition! So how to define it? You can do this:The anti-chain is the chain. The non-ascending sequence is defined as a appearing before B and numerical value.≥B; under what circumstances does it not match? We can enumerate the combinations of two limits:

(1) A appears before B and the value is≥B

(2) A appears before B and the value is greater than a <B

(3) B appears before a and the value is greater than B <

(4) B appears before a and the value is greater than B≥A

Among them, (1) means no ascending sequence. In fact, (4) is also a non-ascending sequence. (1) and (4) are equivalent, but they just swap the variables! Likewise, (2) and (3) are equivalent. To make (1) and (4) Anti-chain, make (2) and (3) a chain, that is, define the chain as a ascending sequence! In this definition, the non-ascending sequence becomes anti-chain, that is, the second question is to find the minimum anti-Chain Division. Here we need to re-interpret the dual theorem of the Dilworth theorem. The greedy idea is to find the longest chain length, that is, the least anti-Chain Division, by finding a anti-chain each time. In a word,It is greedy to search for anti-chain to get the least anti-Chain Division.Therefore, each time you find a minimal element set (that is, each time you greedy to find a non-ascending sub-sequence ). As follows:

1,2,3,2,4,1,3,4

Answer: 4! It's awesome!

However, this method is only applicable when two partial order relations can be defined so that the chain under one partial order link is the reverse chain under another partial order link!

 

original article transferred from http://hi.baidu.com/lambda2fei/blog/item/6001f64476ae852acffca3be.html

>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.