EF1 Fair Division

under Cardinality Constraints

The Setting

We have n agents who must share indivisible goods. The goods are grouped into categories (e.g. Paintings, Statues), and each category h has a capacity kh: no agent may receive more than kh goods from category h. Each agent has their own valuation for each item, and values are additive.

The goal: find an allocation that is EF1 and respects all capacities.

Algorithm 1: EF1 under Cardinality Constraints (main procedure)

Initialize ฯƒโฐ = sorted(agents)
For each category h = 1, โ€ฆ, m:
    Run Greedy Round-Robin on C_h with order ฯƒ^(h-1)   โ† Algorithm 2
    Build envy graph G_h (edge i โ†’ j if i prefers j's bundle)
    While G_h has a cycle (aโ‚ โ†’ aโ‚‚ โ†’ โ€ฆ โ†’ a_r โ†’ aโ‚):
        Rotate bundles along the cycle
        Rebuild G_h
    ฯƒ^h = topological sort of G_h     โ† next picking order
Return final allocation

In plain words: for each category, agents pick greedily in turns. If any envy cycles appear, we rotate bundles along the cycle (this never hurts anyone). Once the envy graph is acyclic, we topologically sort it: agents who envy others get to pick earlier next round โ€” balancing things out.

Algorithm 2: Greedy Round-Robin (subroutine โ€” one category)

Input: items M in category h, picking order ฯƒ = (aโ‚, โ€ฆ, aโ‚™)
While M is not empty:
    For each agent aแตข in ฯƒ:
        if M is empty: break
        let g* = the item in M that aแตข values most
        give g* to aแตข;  remove g* from M

In plain words: agents take turns picking, in a fixed round-robin order. On each turn, the current agent grabs the item they value most from what's still on the table.

What does it guarantee?

  • EF1 (Envy-Free up to One Good) โ€” for every pair (i, j), removing one good from j's bundle eliminates i's envy.
  • Cardinality constraints โ€” every agent gets โ‰ค kh items from each category h.

Based on: "Fair Division Under Cardinality Constraints" by A. Biswas & S. Barman (IJCAI 2018).

Configure agents, categories, and valuations in the sidebar, then click Run Algorithm to see the EF1 allocation. Or try Complex Example or Random Fill at the top of the sidebar.