Optimal lockdown in a commuting network