Sharing costs to optimize network equilibria