Why has collaboration become increasingly central to technological progress? We document the role of lowered travel costs by combining patent data with the rollout of the Swedish railroad network in the 19th and early -20th century. Inventors that gain access to the network are more likely to produce collaborative patents, which is partly driven by long-distance collaborations with other inventors residing along the emerging railroad network. These results suggest that the declining costs of interacting with others is fundamental to account for the long-term increase in inventive collaboration.