We study a structural model of R&D alliance networks in which firms jointly form R&D collaborations to lower their production costs while competing on the product market. We derive the Nash equilibrium of this game, provide a welfare analysis and determine the optimal R&D subsidy program that maximizes total welfare. We also identify the key firms, i.e. the firms whose exit would reduce welfare the most. We then structurally estimate our model using a panel dataset of R&D collaborations and annual company reports. We use our estimates to identify the key firms and analyze the impact of R&D subsidy programs. Moreover, we analyze temporal changes in the rankings of key firms and how these changes affect the optimal R&D policy.