Optimal vaccination and treatment of an epidemic network model