The ideal free distribution

ecology tutorial
R
foraging
behaviour
habitat selection
The ideal free distribution in R: how equal competitors free to move distribute across patches to equalise their intake, and why the result is input matching.
Author

Tidy Ecology

Published

2026-07-31

Resources are patchy, animals can move, and every animal wants the richest patch. But if they all crowd into the richest patch, it stops being the richest, because they share it. Where does everyone end up? Fretwell and Lucas 1969 Acta Biotheoretica 19(1):16-36 answered this with a model so clean it still frames the subject: the ideal free distribution.

Ideal, and free

The two words are the assumptions. Ideal: each animal knows the quality of every patch. Free: nothing stops it from settling anywhere, no territory, no travel cost, no fighting. Given both, an animal will keep moving as long as some other patch offers it more, and it stops only when no move would help. At that point every occupied patch delivers the same per-capita intake, because if one paid better the animals elsewhere would already have moved into it. The distribution is an equilibrium of self-interest: nobody can do better by switching.

Model it directly. Let patches receive resources at rates Q, shared among whoever is there, so intake in a patch is its input divided by its occupants. Start everyone in the best patch and let them move to wherever intake is currently highest.

Q <- c(30, 20, 10); N <- 60          # input rates of three patches; number of foragers
n <- c(N, 0, 0)                       # start all foragers in patch 1
for (s in 1:3000) {
  intake <- Q / pmax(n, 0.5)          # per-capita intake in each patch
  from <- which(n > 0)[which.min(intake[n > 0])]
  to   <- which.max(intake)
  if (from != to) { n[from] <- n[from] - 1; n[to] <- n[to] + 1 }  # move toward the best
}
rbind(foragers = n, intake = round(Q / n, 2))
         [,1] [,2] [,3]
foragers   30   20   10
intake      1    1    1

Input matching

The equilibrium has a strikingly simple form. Per-capita intake is equal everywhere, 1.0 in every patch. And equal intake means input divided by occupants is the same across patches, which forces the number of occupants to be proportional to the input. The fraction of animals in a patch equals the fraction of the resources it supplies.

c(forager_fractions = round(n / N, 3), resource_fractions = round(Q / sum(Q), 3))
 forager_fractions1  forager_fractions2  forager_fractions3 resource_fractions1 
              0.500               0.333               0.167               0.500 
resource_fractions2 resource_fractions3 
              0.333               0.167 

The three patches supply 50, 33 and 17 per cent of the resources, and they end up holding exactly those fractions of the foragers. This is input matching, the central prediction of the ideal free distribution: animals track resources in proportion, so a patch twice as rich holds twice as many competitors and nobody eats any better for being there.

d <- rbind(data.frame(patch = factor(1:3), frac = n/N,      what = "foragers"),
           data.frame(patch = factor(1:3), frac = Q/sum(Q), what = "resources"))
ggplot(d, aes(patch, frac, fill = what)) +
  geom_col(position = "dodge", width = 0.7) +
  scale_fill_manual(values = c("foragers" = col_for, "resources" = col_res)) +
  labs(x = "Patch", y = "Fraction of the total", fill = NULL,
       title = "Foragers match the distribution of resources")
Grouped bars for three patches; in each the forager fraction and resource fraction are equal, illustrating input matching.
Figure 1: The ideal free distribution. The fraction of foragers in each patch (green) matches the fraction of resources it supplies (ochre), and per-capita intake ends up equal across all three patches.

The equilibrium is stable because any other arrangement leaves someone able to improve. Pile everyone into the richest patch and its per-capita intake crashes below the empty ones, so movement pays; only the matching distribution leaves no such incentive.

crowd <- c(Q[1]/N, Q[2]/0.5, Q[3]/0.5)      # everyone in patch 1, others near-empty
di <- rbind(data.frame(patch = factor(1:3), intake = pmin(crowd, 25), arrangement = "all crowd the richest"),
            data.frame(patch = factor(1:3), intake = Q/n,             arrangement = "ideal free distribution"))
ggplot(di, aes(patch, intake, fill = arrangement)) +
  geom_col(position = "dodge", width = 0.7) +
  scale_fill_manual(values = c("all crowd the richest" = col_res, "ideal free distribution" = col_for)) +
  labs(x = "Patch", y = "Per-capita intake", fill = NULL,
       title = "Only the matching distribution equalises intake")
Grouped bars of per-capita intake per patch; under crowding the first patch is far lower than the others, under the ideal free distribution all three are equal.
Figure 2: Per-capita intake in each patch under two arrangements. Crowd all foragers into the richest patch (ochre) and intake is wildly unequal; at the ideal free distribution (green) it is identical across patches.

Why it matters, and where it bends

Input matching is more than a foraging curiosity. It says that density tracks resources, not fitness: every animal does equally well no matter which patch it is in, so a crowded patch is not a good patch, it is a rich one with a lot of competitors, the same warning that runs through source-sink dynamics. It also gives a null model. If animals really are ideal and free, their distribution is fixed by the resources alone, and any departure from matching points to an assumption breaking. Real animals depart from it constantly, almost always in the same direction, under-using the best patches, which the next post measures. And when what animals equalise is fitness rather than instantaneous intake, the prediction becomes the isodar of density-dependent habitat selection. The assumptions that make the model clean are exactly what the checking post interrogates.

References

  • Fretwell SD, Lucas HL 1969. Acta Biotheoretica 19(1):16-36 (10.1007/BF01601953).

Newsletter

Get new tutorials by email

New R and QGIS tutorials for ecologists, straight to your inbox. No spam; unsubscribe anytime.

By subscribing you agree to receive these emails and confirm your address once. See the privacy policy.