You don’t need to be an economist to see that one great virtue of cities is that they are places with lots and lots of people, which means it’s easier there to make a friend, find a job, sell your couch, or go on a date.

If you were an economist, though, you’d call that an agglomeration economy. This constant hum of connections is what sets cities apart from towns, and the biggest cities apart from everyplace else.

Understanding how those relationships map onto the urban form is another story: How do people meet, and maintain ties, in the big city? In New York City, at least, new research shows that it depends who lives on your subway line. Call it the “Take the ‘A’ Train” theory of socializing, after the Billy Strayhorn tune about the subway line that links Harlem and Bed-Stuy.

That’s one of the big takeaways from a working paper posted this month with the National Bureau of Economic Research. Led by Facebook’s Michael Bailey, the team makes the case that they have assembled the most comprehensive portrait to date of a city’s social network. That’s the kind of thing you can do with ZIP code-filtered, anonymized profiles and friend groups from all the Facebook users in the 35 counties, from Pennsylvania to Connecticut, that comprise the largest definition of the New York City area.

The takeaway: A 10 percent greater distance between two ZIP codes was associated with a decline in social connectedness of 8.7 percent. A 10 percent greater increase in cab cost was associated with a 10.6 decline in social connectedness. And a 10 percent greater public transit time is associated with 14.2 percent lower social connectedness. In short: Transit time seems to have the most significant relationship, over other travel variables, in where we make and maintain friends and acquaintances.

There are other organizing factors in social networks, such as state boundaries, race, and income. This tendency—called homophily—is well-documented and intuitive.

But the outsized role of public transit here is novel. The group also mapped the concentration of social networks—how dispersed your friends are, basically—and found that social networks were more concentrated in areas with poor transit, and more spread out in neighborhoods with better transit.

For neighborhoods with similar levels of wealth, transit times are less of a determinant of social connections. But ties between rich and poor neighborhoods are more likely to depend on good transit connections.

The study records correlations, not causations. It’s not clear, for example, to what extent people decide to live in places with easy transit trips to their social networks, or if easy transit trips foster and maintain those social networks. Probably a little bit of both, suggests Theresa Kuchler, a co-author and assistant finance professor New York University. “If we make areas more connected, would we expect more connections to build up? I think that is likely to be the case,” she told me.

It’s another sign of just how much easy access to transportation, as much as a good neighborhood, determines destiny. In a 2015 study, Raj Chetty and Nathaniel Hendren showed that no neighborhood characteristic was more associated with upward mobility than a short commute. Bad transit, by contrast, often makes it impossible for children to leave their neighborhoods for school, among other ill effects.

New York is not a representative case study, of course: It is the only American city where more than half of commuters use transit every day. But the broader point—that travel times, not distance, are what matter in social and economic geography—probably holds. The world is an isochrone map, where distances are only as great as the time they take you to cross.