Integer programming: enforce the constraint that a subgraph contains at most $k$ connected components?
Base on Komus's constraint, we add another constraint which ensures a Steiner Tree on $G^{'}=(V, E^{'})$, where $E'=\{(i,j): i,j \in V\}$: 
$$\sum_{e \in cut(U,V)}x_e \ge 1, \forall u,v \in T, \forall \text{ }u-v\text{ }cut \text{ }(U,V)$$where $cut(U,V)$ denotes the cut set of $(U,V)$.

Together with Komus's constraint, our model is obtained as follows:


  $$min \sum_{e \in E}c_e x_e$$
  subject to 
  $$\sum_{e \in cut(U,V)}x_e \ge 1, \forall u,v \in T, \forall \text{ }u-v\text{ }cut \text{ }(U,V)$$
  $$\sum_{e \notin E} x_e \le k-1$$


Base on Cao's comment, one more step is needed to prune the solution of our model: if $\sum_{e \notin E}x_e &lt; k-1$, then we delete the largest $\Delta$ edges in the solution, where $\Delta=k-1-\sum_{e \notin E}x_e$. Then we get an optimal solution.