A free path (with no preset extreme nodes) is located on a network, in such a way as to minimize the cost and maximize the traffic captured by the path. Traffic between a pair of nodes is captured if both nodes are visited by the path. Applications are the design of the route and locations of mailboxes for a local package delivery company, or the design of bus or subway lines, in which the shape of the route and the number of stops is determined by the solution of the optimization problem. The problem also applies to the design of an optical fiber network interconnecting WiFi antennas in a university campus. We propose two models and an exact solution method. Computational experience is presented for up to 300 nodes and 1772 arcs, as well as a practical case for the city of Concepción, Chile.