Max-Min Fairness 學習

理論

Max-Min Fairness (MMF) 是一種在兼顧公平的前提下,儘可能讓更多人滿意的資源分配算法。

但它並不是一個無懈可擊的終極資源分配算法,看它的一個缺點:

On the other hand, max-min fairness provides lower average throughput than maximum throughput resource management, where the least expensive flows are assigned all capacity they can use, and no capacity might remain for the most expensive flows. In a wireless network, an expensive user is typically a mobile station at far distance from the base station, exposed to high signal attenuation. However, a maximum throughput policy would result in starvation of expensive flows, and may result in fewer “happy customers”.

FROM: https://en.wikipedia.org/wiki/Max-min_fairness

可見,MMF 這種讓大多數人 happy 的策略 無法讓系統吞吐量最大化。這也很好理解,最消耗帶寬資源的用戶無法及時得到資源,當然不利於最大化吞吐量。

Max-min fairness is said to be achieved by an allocation if and only if the allocation is feasible and an attempt to increase the allocation of any flow necessarily results in the decrease in the allocation of some other flow with an equal or smaller allocation. A max-min fair allocation is achieved when bandwidth is allocated equally and in infinitesimal increments to all flows until one is satisfied, then amongst the remainder of the flows and so on until all flows are satisfied or the bandwidth is exhausted.

FROM https://en.wikipedia.org/wiki/Fairness_measure

通過例子理解MMF 算法

理解不帶權值的MMF算法,最直觀的方式是想象有幾個高矮不同的杯子,從左到右挨個逐輪往裏面滴水:

          v                        <------ round 5

          v       v                <------ round 4

  v       v       v                <------ round 3

  v       v       v                <------ round 2

  v       v       v       v        <------ round 1


        |   |
        |   |   |   |
|   |   |   |   |   |
|   |   |   |   |   |
|   |   |   |   |   |   |   |
+---+   +---+   +---+   +---+
  1       2       3       4

4 號杯子最先滿,然後是 1 號, 3 號,最後是 2 號。

MMF算法考慮得比上述做法更周全一些。上面四個杯子沒有從矮到高排序。 考慮到可能中途沒水了,爲了讓更多人 Happy,可以從矮到高排序,這樣就算中途沒水了,矮個杯也更有可能被灌滿。

                          v       <-----+ round 5

                  v       v       <-----+ round 4

          v       v       v       <-----+ round 3

          v       v       v       <-----+ round 2

  v       v       v       v       <-----+ round 1


                        +   +
                +   +   |   |
        +   +   |   |   |   |
        |   |   |   |   |   |
+   +   |   |   |   |   |   |
+---+   +---+   +---+   +---+
  4       1       3       2

最極端的,考慮只有一滴水的情況。如果不排序,沒有一個杯子會被裝滿,大家都不滿意。如果排序,4號杯子能被裝滿,至少有一個人滿意。


  v                               <-----+ round 1


                        +   +
                +   +   |   |
        +   +   |   |   |   |
        |   |   |   |   |   |
+   +   |   |   |   |   |   |
+---+   +---+   +---+   +---+
  4       1       3       2

下面考慮有 4 滴水的情況,滴完後,4、1、3、2 杯中各有 1 滴水。4 很滿意,其餘不太滿意。那麼,能不能給 4 一滴水, 1 三滴水,其餘不滴水呢?這樣 4 和 1 都很滿意,但 3 和 2 非常不滿意,並且會高喊不公平。

公平做法:

                                  <-----+ round 5

                                  <-----+ round 4

                                  <-----+ round 3

                                  <-----+ round 2

  v       v       v       v       <-----+ round 1


                        +   +
                +   +   |   |
        +   +   |   |   |   |
        |   |   |   |   |   |
+   +   |   |   |   |   |   |
+---+   +---+   +---+   +---+
  4       1       3       2

不公平做法:



          v             

          v

  v       v


                        +   +
                +   +   |   |
        +   +   |   |   |   |
        |   |   |   |   |   |
+   +   |   |   |   |   |   |
+---+   +---+   +---+   +---+
  4       1       3       2

Rnd-1   Rnd-2   Rnd-3   Rnd-4

由此可見, MMF 算法是在兼顧公平的前提下儘可能讓更多人滿意的算法。

發佈了415 篇原創文章 · 獲贊 106 · 訪問量 174萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章