Algorithm Search⌘K

Problemcore

Rental harmony

Also called rent division problem.

Assign rooms to housemates and split a fixed rent so that every housemate prefers its room at its price to any other room at that room's price.

Time
O(n^3) worst
Where
n = the number of rooms and tenants

Rental harmony asks how nn housemates should share a house with nn rooms and a fixed total rent: each housemate gets one room and a price, the prices add up to the rent, and no housemate prefers another room at that room's price to its own room at its own price. This page is the problem: its two models, the existence theorem and the known bounds. Su's algorithm is one procedure for it, which finds an approximate solution in the model where tenants only answer which room they would choose. In the model where each tenant has a money value for each room, the problem is solved exactly by a maximum-weight assignment and its dual prices. Rental harmony mixes an indivisible good (the rooms) with a divisible one (the rent), so it differs from cake cutting, where everything is divisible, and from chore division, where every part is a burden.

In plain words

Some friends rent a house together, and its rooms differ. The friends must decide who gets which room and how much each pays, and the total must be the rent of the house.

A good split leaves nobody jealous. Each friend looks at its own room and its own price, then at every other room and its price, and finds its own deal at least as good. This can hold even when the friends disagree about the rooms, because a room that more friends want can cost more.

Such a split always exists under mild conditions. Finding it depends on what the friends can tell. If each friend can name a money value for each room, a fast method finds an exact split. If a friend can only say which room it would take at given prices, a split can be found only approximately.

Definition

There are nn tenants, nn rooms and a total rent R>0R > 0. A price vector is p=(p1,…,pn)p = (p_1, \dots, p_n) with ∑jpj=R\sum_j p_j = R.

  • Output. A bijection σ\sigma from tenants to rooms and a price vector pp.
  • Condition. The pair (σ,p)(\sigma, p) is envy-free: for each tenant ii and each room jj, tenant ii likes room σ(i)\sigma(i) at price pσ(i)p_{\sigma(i)} at least as much as room jj at price pjp_j.

The input and the measure depend on the model.

  • The ordinal model (Su). Prices must be nonnegative. At each price vector, each tenant tells which rooms it would choose. Su's conditions are: (1) at every price vector, each tenant finds some room acceptable; (2) tenants are miserly, so a tenant prefers a free room to a room that costs something; (3) the preference sets are closed, so a room that a tenant chooses along a sequence of price vectors is also chosen at the limit. The measure is the number of questions, and the goal is an approximate solution: an envy-free pair at prices within δ\delta of pp.
  • The quasi-linear model. Tenant ii has a value vijv_{ij} for room jj, and its utility for room jj at price pjp_j is vij−pjv_{ij} - p_j. The input is the n×nn \times n matrix of values, and the measure is the running time. Prices may be negative.

Variants

  • Nonnegative prices. In the quasi-linear model, an envy-free solution with all prices nonnegative need not exist; see the second example.
  • The weaker miserly condition. Su notes that condition (2) can be weakened: it is enough that no tenant chooses the most expensive room when some room is free.
  • Choosing among envy-free solutions. There are often many envy-free price vectors. In the quasi-linear model, for a fixed assignment the envy-free price vectors form a polytope, so one can choose a best one, for example the one that maximizes the smallest utility, with one linear program.
  • Rebates. Su also discusses rent as a burden to split, and a version in which some rooms may get a negative price, so that a tenant is paid to take them.

Examples

Three tenants with values. The rent is R=900R = 900. Tenants aa, bb and cc have these values for rooms 1, 2 and 3.

room 1 room 2 room 3
aa 400 300 200
bb 300 400 200
cc 300 300 350

Give room 1 to aa, room 2 to bb and room 3 to cc, at prices (300,300,300)(300, 300, 300). Tenant aa has utility 100100 for room 1 and 00 and −100-100 for the others; tenant bb is the mirror case; tenant cc has utility 5050 for room 3 and 00 for each other room. Nobody envies. At prices (280,280,340)(280, 280, 340), tenant cc has utility 1010 for room 3 but 2020 for room 1, so it envies aa: making the room that cc likes cost more than 5050 above the others breaks the split.

No nonnegative solution. The rent is R=10R = 10. Two tenants both value room 1 at 100100 and room 2 at 00. One of them gets room 2, and it must not envy the other, so 0−p2≥100−p10 - p_2 \ge 100 - p_1; the other gives the reverse inequality, so p1−p2=100p_1 - p_2 = 100. With p1+p2=10p_1 + p_2 = 10 this gives p1=55p_1 = 55 and p2=−45p_2 = -45. These tenants are not miserly: each prefers room 1 at price 1010 to room 2 for free, which is why Su's theorem does not apply.

Known algorithms

method model result
Su's algorithm ordinal, miserly tenants approximate; prices within R/NR/N for a grid of size NN
maximum-weight assignment with dual prices (Hungarian algorithm) quasi-linear exact, O(n3)O(n^3) time
one linear program on top of the assignment quasi-linear an envy-free solution that is best by a linear criterion

The quasi-linear method rests on two facts that this page proves below.

Theorem 1. If (σ,p)(\sigma, p) is envy-free in the quasi-linear model, then σ\sigma is a maximum-weight assignment, that is, it maximizes ∑iviσ(i)\sum_i v_{i \sigma(i)}.

Proof. Let τ\tau be any bijection. Envy-freeness gives viσ(i)−pσ(i)≥viτ(i)−pτ(i)v_{i \sigma(i)} - p_{\sigma(i)} \ge v_{i \tau(i)} - p_{\tau(i)} for each ii. Summing over ii, both sums of prices equal RR, so ∑iviσ(i)≥∑iviτ(i)\sum_i v_{i \sigma(i)} \ge \sum_i v_{i \tau(i)}. □\square

Theorem 2. For every maximum-weight assignment σ\sigma there is a price vector pp that makes (σ,p)(\sigma, p) envy-free.

Proof. By duality for the assignment linear program, there are numbers uiu_i and qjq_j with ui+qj≥viju_i + q_j \ge v_{ij} for all i,ji, j, and ui+qσ(i)=viσ(i)u_i + q_{\sigma(i)} = v_{i \sigma(i)} for all ii. So vij−qj≤ui=viσ(i)−qσ(i)v_{ij} - q_j \le u_i = v_{i \sigma(i)} - q_{\sigma(i)}, and the prices qq are envy-free. Adding the same constant cc to every qjq_j keeps every comparison, so choose cc with ∑j(qj+c)=R\sum_j (q_j + c) = R. □\square

The Hungarian algorithm computes σ\sigma and the dual numbers qq in O(n3)O(n^3) time.

AlgorithmTimeSpacePropertiesCode
Su's algorithm for rental harmonyO(n^2 N^(n-1) + 4^n n! n^2) worstO(n N^(n-1) + n 4^n) extradeterministicofflineiterative1 language

Bounds

  • Existence, ordinal model. Under conditions (1) to (3), an envy-free division with nonnegative prices exists (Su 1999, the Rental Harmony Theorem, stated in Section 6 and proved in Section 7). The proof uses a dual form of Sperner's lemma on the simplex of price vectors. This is a theorem.
  • Existence, quasi-linear model. An envy-free solution always exists, with prices that may be negative, by Theorem 2.
  • Quasi-linear, upper bound. O(n3)O(n^3) time with the Hungarian algorithm, in the real-RAM model. Reading the input takes Ω(n2)\Omega(n^2) time.
  • Ordinal, upper bound. Su's algorithm asks at most one question per point of a grid of size NN, so at most (N+n−1n−1)\binom{N + n - 1}{n - 1} questions, and its price error is at most R/NR/N per room.
  • Ordinal, exact solutions. In the ordinal model an exact solution is in general a limit of approximate ones, as in Su's proof, which uses condition (3).

Reductions

  • To Sperner's lemma. Su gives each point of a triangulated price simplex an owner and labels it with the room the owner chooses. A fully labeled cell of the dual Sperner lemma gives an approximately envy-free division.
  • To an assignment market. In the quasi-linear model, an envy-free pair (σ,p)(\sigma, p) is a competitive equilibrium of a market with nn unit-demand buyers and nn items, in which every buyer gets an item it likes best at the prices and the prices add up to RR. Theorems 1 and 2 are the welfare theorems of this market.
  • To chore division. The rent is a burden that the tenants share, so methods for chore division with labels from Sperner's lemma apply, as Su notes.

Applications

  • Shared houses and apartments, where the rooms differ in size and features.
  • Shared offices or desks with a fixed total cost.
  • Any split of a fixed cost among people who each get one different item, such as cabins on a shared trip.

References

  1. Francis Edward Su, Rental harmony: Sperner's lemma in fair division, American Mathematical Monthly 106(10) (1999), 930-942, Section 6, Chores and Rent-partitioning (the Rental Harmony Theorem and its three conditions), Section 7 (its proof with a dual Sperner lemma) and Section 8 (the weaker miserly condition)
  2. Harold W. Kuhn, The Hungarian method for the assignment problem, Naval Research Logistics Quarterly 2 (1955), 83-97, the algorithm for a maximum-weight assignment, with its dual variables
  3. Steven J. Brams and Alan D. Taylor, Fair Division, From Cake-Cutting to Dispute Resolution, Cambridge University Press, 1996, envy-free division of goods and of burdens, as background for rent division

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a contract.yaml