EconCSLib.SocialChoice.FairDivision.Indivisible.EnvyCycle #
The envy-cycle elimination algorithm and its EF1 correctness proof, stated on the
canonical bundled AdditiveInstance interface.
Main definitions #
envies v A i j— agentistrictly envies agentj:v_i(A_i) < v_i(A_j)isSource v A i—ihas in-degree 0 in the envy graph (no one enviesi)isEnvyCycle v A l—lis a directed cycle in the envy graphhasEnvyCycle v A— the envy graph contains at least one directed cyclerotateBundles A l— rotate bundles around cycleleliminateAllCycles v A— iterate rotation until no envy cycle remainsfindSource v A h— a source in the acyclic envy graphenvyCycleAllocation I— full bundled algorithm: processI.allGoodsin list orderenvyCycleRule I— the algorithm as a feasible-allocation rule
Main results #
rotateBundles_not_mem— agents outside the cycle are unaffected by rotationrotateBundles_isAllocation— rotation preserves the partition propertyrotateBundles_improves— every agent in the cycle strictly improves after rotationrotateBundles_nondecreasing— no agent loses value under a rotation stepeliminateAllCycles_acyclic— after elimination, the envy graph contains no cycleeliminateAllCycles_isAllocation— valid allocations are preserved by eliminationeliminateAllCycles_nondecreasing— agent values do not decrease under eliminationeliminateAllCycles_eq_of_acyclic— elimination is the identity on already-acyclic allocationsacyclic_has_source— a finite acyclic directed graph always has a sourcefindSource_isSource— the agent returned byfindSourcesatisfiesisSourceenvyCycleAllocation_isAllocation— output is a valid complete allocationenvyCycleAllocation_isEF1— output satisfies EF1 for nonnegative additive weightsenvyCycleRule_isEF1— rule-style EF1 correctness
Algorithm outline #
Process a list of goods one at a time. The current partial allocation A is kept cycle-free
throughout (loop invariant). Each step is:
- Let
A_dag = eliminateAllCycles v A(no-op ifAis already acyclic). - Find a source
sin the envy graph ofA_dag(exists becauseA_dagis a DAG; seeacyclic_has_source). - Give the next good
gtos: updateA_dag s ↦ insert g (A_dag s). - Eliminate any new envy cycles:
eliminateAllCycles v (Function.update A_dag s ...).
Raw implementation layer #
The public algorithm below is stated on AdditiveInstance. The list-processing core is
parameterized by the raw induced valuation to keep the induction lemmas independent of
bundled-record projection noise.
EF1 invariant #
After each complete step (add good + eliminate cycles), the partial allocation is envy-free (EF) among all agents with nonempty bundles. This is maintained because:
- Before adding
g, no agent envied the sources(source property of step 2). - Adding
gtosmay introduce new envy towardss; these are resolved in step 4. - Envy between non-source agents is unchanged by steps 2–4.
When the last good is allocated the allocation is EF among nonempty-bundle agents, which
implies EF1 globally (the guard (A j).Nonempty in IsEF1 covers agents with A j = ∅).
Termination of eliminateAllCycles #
Termination is witnessed by the Pareto domination count: the number of allocations
B such that every agent weakly prefers B to the current allocation A. Each rotation
step strictly improves at least one agent (and weakly improves all), so this count strictly
decreases. Since [Fintype N] and [Fintype G] make the set of allocations finite, the
count is bounded and the loop terminates.
References #
- Lipton et al., "On Approximately Fair Allocations of Indivisible Goods" (EC 2004) [L+04]
- Nisan et al., Algorithmic Game Theory, Chapter 12
- Bouveret, Chevaleyre, Maudet — COMSOC Handbook, Ch. 12 [BCM]
Envy relation #
Agent i envies agent j under valuation v and allocation A: they strictly
prefer j's bundle over their own.
envies v A i j ↔ v_i(A_i) < v_i(A_j).
An allocation is envy-free (IsEnvyFree) iff no agent envies any other. [L+04]
Equations
- SocialChoice.FairDivision.Indivisible.envies v A i j = (v.val i (A i) < v.val i (A j))
Instances For
Sources in the envy graph #
Agent i is a source in the envy graph: no other agent envies i.
Equivalently, i has in-degree 0 in the envy graph. Sources always exist in finite
acyclic graphs (see acyclic_has_source). Giving a new good to a source is the key
step in the algorithm: since no agent envied the source before, the source can only
attract new envy from the added good — not from pre-existing bundles.
Equations
- SocialChoice.FairDivision.Indivisible.isSource v A i = ∀ (j : N), ¬SocialChoice.FairDivision.Indivisible.envies v A j i
Instances For
In an envy-free allocation, every agent is a source.
Envy cycles #
A list l : List N is a directed envy cycle under v and A if:
lis nonempty (0 < l.length),- all elements are distinct (
l.Nodup), and - every consecutive pair (with wrap-around from last to first) is an envy edge.
For l = [i₀, i₁, ..., iₖ₋₁]: agent iⱼ envies i_{(j+1) mod k} for all j.
In particular iₖ₋₁ envies i₀, closing the directed cycle. [L+04]
Equations
- One or more equations did not get rendered due to their size.
Instances For
The envy graph has a cycle: some nonempty list forms a directed envy cycle.
Equations
Instances For
A directed envy cycle must have length at least 2. A singleton [i] would require
i to envy itself, contradicting irreflexivity of <.
If i is a source, it cannot participate in any envy cycle.
Bundle rotation #
Rotate bundles around a cycle l = [i₀, i₁, ..., iₖ₋₁]:
agent iⱼ receives the bundle currently held by i_{(j+1) mod k}.
Agents not in l are unaffected.
Requires [DecidableEq N] for Function.update. Correctness lemmas assume l.Nodup
(so each agent appears at most once and the rotation is well-defined).
After rotation along an envy cycle, every participating agent receives a bundle they
strictly preferred: iⱼ gets A i_{j+1} and envies v A iⱼ i_{j+1} guarantees
v_{iⱼ}(A iⱼ) < v_{iⱼ}(A i_{j+1}). [L+04]
Equations
- One or more equations did not get rendered due to their size.
Instances For
Lemmas about rotateBundles #
Agents not in the cycle are unaffected by bundle rotation.
Each agent in the cycle receives their successor's bundle.
Concretely, if i = l.get k, then rotateBundles A l i = A (l.get k') where
k' = (k.val + 1) % l.length.
Bundle rotation preserves the partition property.
Proof sketch: the goods held by cycle participants are permuted cyclically. The disjointness and completeness properties of the partition are maintained because the multiset of bundles is merely rearranged — the same goods appear in the same total quantity, just redistributed among cycle agents.
After rotating along an envy cycle l, every agent in l strictly improves.
Proof: agent iⱼ in the cycle satisfies envies v A iⱼ i_{j+1}, i.e.,
v_{iⱼ}(A iⱼ) < v_{iⱼ}(A i_{j+1}). After rotation, iⱼ holds A i_{j+1}, so
their new value strictly exceeds their old value.
Bundle rotation does not decrease any agent's value. Cycle participants strictly
improve (see rotateBundles_improves); non-participants are unchanged.
Pareto domination count (termination measure) #
The number of allocations that weakly Pareto-dominate A: every agent weakly
prefers B's assignment over A's. This count strictly decreases with each
envy-cycle rotation, providing the termination measure for eliminateAllCycles.
Equations
Instances For
The Pareto domination set of A' is a subset of that of A when A' weakly
Pareto-dominates A.
If A' strictly Pareto-improves over A (weakly for all, strictly for some agent),
then A is NOT in the Pareto domination set of A'.
Rotation along an envy cycle strictly decreases the Pareto domination count.
Cycle elimination #
Repeatedly rotate envy cycles until none remain, producing a cycle-free allocation.
eliminateAllCycles v A is an allocation reachable from A by a finite sequence of
bundle rotations that contains no directed envy cycle.
Termination is witnessed by the paretoDomCount measure: each rotation step strictly
decreases the number of allocations that weakly Pareto-dominate the current allocation.
Since this count is a natural number, the process terminates.
Key properties (proved below):
eliminateAllCycles_acyclic: the output is cycle-free.eliminateAllCycles_isAllocation: the partition property is preserved.eliminateAllCycles_nondecreasing: no agent's value decreases.eliminateAllCycles_eq_of_acyclic: the identity on already-acyclic inputs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Unfolding lemma for eliminateAllCycles: if a cycle exists, rotate and recurse;
otherwise return the current allocation.
Lemmas about eliminateAllCycles #
After cycle elimination, the envy graph is acyclic. This is the defining correctness
property of eliminateAllCycles. [L+04]
Cycle elimination preserves the partition property. Each rotation step preserves
IsAllocation by rotateBundles_isAllocation, and the composition of
finitely many such steps preserves it inductively.
Cycle elimination does not decrease any agent's value (for additive nonneg valuations).
Each rotation step strictly improves participating agents and leaves others unchanged, so the entire sequence of rotations is value-nondecreasing for every agent.
Cycle elimination is a fixed point on acyclic inputs: if A already has no envy
cycle, then eliminateAllCycles v A = A (no rotation is performed).
Sources #
A finite directed graph with no directed cycle has at least one source (a node with in-degree 0).
Proof sketch: start from any agent i₀. If i₀ is a source, done. Otherwise pick
any i₁ that envies i₀. Repeat: if i₁ is a source, done; else pick i₂ envying
i₁. Since N is finite, this walk must revisit some node, yielding a directed cycle —
contradicting hdag. Hence the walk must terminate at a source.
[BCM Ch.12; standard directed graph theory]
Given a proof that the envy graph of A is acyclic, returns a source agent.
The specific agent chosen is unspecified beyond satisfying isSource.
Equations
Instances For
The agent returned by findSource is indeed a source in the envy graph of A.
Envy-cycle elimination algorithm #
Correctness theorems #
Helper lemmas for EF1 #
Bundled additive-instance API #
The complete envy-cycle-elimination allocation for a bundled additive instance.
Equations
Instances For
Envy-cycle elimination as a feasible-allocation rule on bundled additive instances.
Equations
Instances For
envyCycleAllocation produces a complete partition of the instance goods.
Envy-cycle elimination gives EF1 for additive instances with nonnegative item weights.
The bundled envy-cycle-elimination rule is EF1 under nonnegative item weights.