Network structure and optimal technological innovation