  We study traffic flow on roads with a localized periodic inhomogeneity such
as traffic signals, using a stochastic car-following model. We find that in
cases of congestion, traffic flow can be optimized by controlling the
inhomogeneity's frequency. By studying the wavelength dependence of the flux in
stop-and-go traffic states, and exploring their stability, we are able to
explain the optimization process. A general conclusion drawn from this study
is, that the fundamental diagram of traffic (density flux relation) has to be
generalized to include the influence of wavelength on the flux, for the
stop-and-go traffic. Projecting the generalized fundamental diagram on the
density-flux plane yields a 2D region, qualitatively similar to that found
empirically [B. S. Kerner, Phys. Rev. Lett. {\bf 81}, 3797 (1998)] in
synchronized flow.
