How does the foodie understand the duality of linear programming

Source: Internet
Author: User

1. What is dual

Duality (duality) is a very common concept in its own right, and it is commonplace in life. For example, you are eating a cone ice cream, in order to be able to eat a hole, you first eat from above, and then eat from below, finally you eat a hole! Of course it's a joke, and here's a serious example. For example, when climbing a big step you go up first, back to pull your girlfriend up, this time there has been a standard dual: You put your hand down (minimized), and she tried to reach up (maximize), finally met together (Strong duality theorem). In this process, the height of your hand is always higher or equal to the girlfriend's hand (weak duality theorem). The dual format in linear programming is very fixed, but individual problems have a very obvious economic explanation, and now it's about eating.

2. Foodie's decision science

I heard that English people like to eat afternoon tea because they only eat two meals, so they will be hungry at noon. However, as a foodie should not be the control of which country, as long as there is snacks can not be missed. The following table is the nutritional content (grams) and price information of two desserts in the school restaurant and the nutritional needs of the foodie:

Chocolate cake Cream Cheese Cake A meal demand
P1 Cocoa 3 0 6
P2 Sugar 2 4 10
P3 Cream 2 5 8
Price 5 8
X1 X2

For example, chocolate cake contains 3 grams, 2 grams and 2 grams of cocoa, sugar and cream, and a chocolate cake price of 5 yuan. The minimum standard for three nutrients for foodies is 6 grams, 10 grams and 8 grams. That means you have to eat enough to ensure nutrition. Obviously the two kinds of cakes only buy one is not enough to eat food, so you have to buy a little more. Assuming that the restaurant can provide bulk weighing, that is, you can not buy, then this problem will be studied, how to meet the nutritional needs can also make the lowest price. The following linear optimization problems are listed in the foodie:

Min 5*x1 + 8*x2 (Total price)

Subject to 3*x1 >= 6 (more marketing than needed)

2x1 + 4x2 >= 10

2x1 + 5x2 >= 8

x1, x2 >= 0 (obviously positive)

Among them, X1 and X2 are the purchase quantity of two kinds of cakes. The best purchase combination can be obtained by solving the linear programming. This problem is sometimes called the Nutrition problem (diet problem), which has a very direct practical explanation.

As a frugal foodie ends the problem has been solved, but the dual problem of the problem, there is also a very reasonable economic angle of interpretation. Let's put the foodie aside and consider the decision-making issues between the restaurant owner and the retailer.

3. interpretation of dual problems

Now we're going to make a few assumptions:

1. Suppose the restaurant owner only receives a foodie a day, and he also has this form, knowing how much food the foodie eats.

2. What the boss wants to do is to get the goods from the retailer and he will also tell the retailer the information on the form. We then assume that the boss is in the stock of nutrients and then processed into cakes.

3. If the price is set by the school, the restaurant owner cannot change it.

Now we're looking at the retailer's question of how to price these three elements to maximise revenue after selling to a restaurant owner.

First of all, three of the daily intake of nutrients to meet the minimum needs of the foodie, and because the restaurant owner will not entertain others, so the restaurant owner will be determined to buy 6 grams, 10 grams and 8 grams of three nutrients. Consider another factor, if we let P1,P2 and P3 for the price of these three elements, then

3*P1 + 2*p2 + 2*p3 <= 5

This condition needs to be met. The left side of the meaning is the price of a cake needs nutrients, this price if more than 5 yuan, and the boss a cake can only sell 5 yuan. So if the raw material price exceeds 5 yuan, the restaurant owner will not agree, because so he will not make money. The consequence is that he will not be able to get any more from the house. So retailers have to make sure that the restaurant is still earning money, or at least not at a loss (so we use less than equals). Thus, the duality of the last question comes out:

Max 6*p1 + 10*p2 + 8*p3 (income from selling three nutrients)

Subject to 3*P1 + 2*P2 + 2*p3 <= 5

4*P2 + 5*P3 <= 8

P1, p2, p3 >= 0

Because the value of the solution here is not important, we are not going to solve it.

4. duality theorem

Finally, take a look at the two duality theorem. The weak duality theorem means that the function value of the solution of any minimization problem will be greater than the function value of any solution that is equal to its duality problem (maximization). If we use this question to explain that: the price of food to buy cakes will certainly be greater than (up to) the restaurant owner's purchase price. This explanation is very reasonable, because the restaurant always make the difference.

The strong duality theorem refers to the value of the optimal solution of two problems must be equal. That is, if the foodie and the retailer are smart enough to find the best solution for the two of them, then the money from the foodie will be exactly the same as that of the retailer, which means the restaurant owner has not earned anything in this case.

5. Summary

Duality is a very classical and difficult to understand concept, in addition to this more obvious explanation, there is a general textbook on the Shadow Price (shadow prices) explanation, the problem is the background of factory processing raw materials. Although different from this problem, but all related to the price of raw materials, so only some textbooks, the dual vector with p to do the name, I guess that is the reason for it.

How does the foodie understand the duality of linear programming

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.