[Turn] max-min fairness maximum minimum fairness algorithm

Source: Internet
Author: User

Original: https://www.cnblogs.com/549294286/p/3935408.html

We often face the problem of dividing scarce resources into a group of users, who have equal rights to acquire resources, but some of them actually need less resources than others. So how do we allocate resources? A widely used sharing technology in practice is called "Maximum minimum fair sharing". Intuitively, Fair share the minimum requirements that each user wants to meet, and then distribute the unused resources evenly to users who need ' big resources '.

The formal definition of the maximum minimum fair allocation algorithm is as follows:

    • Resources are allocated in order of increasing demand
    • There are no users who are getting more resources than they need.
    • User-equivalent shared resources that are not met

The executable definition that corresponds to it:

Consider user collection 1, ..., n there are resource requirements x1, x2, ..., xn. Without losing its generality, to meet the requirements of x1 <=x2 <= ... <= xn. To make the server capable of C. Well, we're starting to put c/n Resources to the least demanding users. This may exceed the user's 1 requirement, Continue processing. At the end of the process, each user gets no more than they ask for, and if their needs are not met, the resulting resources will not be less than the most resources available to other users. What we call the greatest minimum Fairness Allocation is due to the fact that we maximize resources that are least allocated to users who are not satisfied with the resource.

Example 1

There are 14 users of the collection, resource requirements are 2,2.6,4,5, its total resource capacity is 10, for which the maximum minimum fair allocation is calculated

Workaround: We calculate the maximum minimum fair allocation by several rounds of calculations. In the first round, we temporarily divide the resources into 4 sizes of 2.5. As this exceeds the user 1 requirement, this leaves 0.5 evenly allocated to the remaining 3 resources, giving them each 2.66. This is more than the user 2 needs, So we have an extra 0.066 ... To allocate to the remaining two users, giving each user a 2.5+0.66...+0.033...=2.7. So the fair distribution is: User 1 gets 2, user 2 gets 2.6, user 3 and user 4 each gets 2.7.

So far, we've assumed that all users have the same rights to get resources. Sometimes we need to give some users a bigger quota. In particular, we may give different users 1, ..., n associated weights W1, w2, ..., WN, This reflects the resource quotas between them.

We extend the concept of maximum minimum fair allocation by defining a weighted maximum minimum fair allocation to include such weights:

    • Resources are allocated in order of increasing demand, standardized by weight?
    • There are no users who are getting more resources than they need.
    • Non-satisfied users share resources by weight

The following example describes how to implement the.

Example 2

There are 14 users of the collection, the resource requirements are 4,2,10,4, the weights are 2.5,4,0.5,1, the total resource capacity is 16, for which the maximum minimum fair allocation is calculated.

WORKAROUND: The first step is to standardize the weights and set the minimum weight to 1. This way the weight collection is updated to 5,8,1,2. So we pretend that we need not 4 copies of the resources, but 5+8+1+2=16. Therefore, the resources are divided into 16 parts. In each round of resource allocation, we divide resources by the proportion of weights, So, in the first round, we calculate c/n as 16/16=1. In this round, the user obtains the resources of the 5,8,1,2 unit respectively, the user 1 obtains 5 resources, but only needs 4, therefore has 1 resources more, similarly, the user 2 has more 6 resources. User 3 and User 4 are in arrears, Because their quotas are below demand. Now we have 7 units of resources that can be assigned to users 3 and 4. Their weights are 1 and 2, the minimum weight is 1, so there is no need to standardize the weights. Give users 3 additional 7X1/3 unit resources and users 4 additional 7x2/ 3 units. This causes the user 4 quota to reach 2 + 7X2/3 = 6.666, exceeding the requirement. So we will add 2.666 units to the user 3, and finally get 1 + 7/3 + 2.666 = 6 units. The final allocation is, 4,2,6,4, which is the largest minimum fair allocation with the right.

[Turn] max-min fairness maximum minimum fairness algorithm

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.