When I think about high-density housing, my mind has been trained to associate the term with New York tenements from the early 1800s. Tenements were generally five-story apartment buildings, with each floor divided into four apartments of three rooms each — only one of which had windows. The phenomenon isn't unique to New York, of course. Kowloon, a walled enclave in Hong Kong, had a population density of 1,255,000 inhabitants per square kilometer in 1987. It has since been destroyed and turned into a park due to its "ungovernable" nature and high crime rates (mostly prostitution and gambling). High population densities isn't limited to the modern era, though. Roman insulae were also about five stories high. Individual apartments were even smaller, than the ones in New York, with only two rooms. The nature of urban life inherently involves cramming a bunch of people into a relatively limited space — but I remember how surprised I was when I discovered that this isn't actually the most efficient use of space. I read an article once, years ago, about how machine learning algorithms design rooms that efficiently use space. It wasn't this one about calculating the best shapes for future building projects (I read it before I learned how to take good notes), but it had a similar point: that the most efficient designs for different purposes are often deeply unintuitive. Humans often default to rigid shapes when we build things. Bridges generally have lots of arches and triangles. Houses are typically shaped as a series of cubes, perhaps with an angled roof. For example, heat sinks usually look like rigid fins. But when optimizing for space, the most efficient design actually looks like a tree. This doesn't mean humans are stupid, of course. One of the obvious reasons we tend to build things with straight lines and simple curves is because these shapes are easier to create with the materials we typically have available to us, like saws, wood, hammers, pottery, and metal ores. The shapes we see in the natural world, though, like branching trees (which resemble roots, which resemble neuron structures) and amorphous blobs, exist for good reason, even if they sometimes feel chaotic compared to the strictly regimented shapes of a human settlement. Bees store honey in hexagonal cells, and it's not an accident. They're optimizing for energy usage: each ounce of wax takes eight ounces of honey to create. It wasn't until 1999 that mathematicians were able to prove that a regular hexagonal grid is the best way to divide a surface into regions of equal area with the least total perimeter. It's true, though. So why don't most of us build houses with hexagonal rooms? Well for one thing, right angles are easier to cut, which makes rectangular houses easier to build. But that doesn't mean that rectangular houses are the only way. From a historical perspective, round houses are actually very common. Evidently, they're more resistant to weather events (if nothing else, they're more aerodynamic) and are more efficient from a materials-use perspective. It's possible to optimize for other things, though — like making the trip between rooms as short as possible, or maximizing the number of people who can safely work in an irregular space. (Note: this link is the neatest one of the bunch; make sure to check it out if you think machine learning + architecture is interesting.)