I remember a novel where one of the early scenes is a traffic accident caused because the lights both ways were set to green - the computer controlling the entire city had been programmed to be "most efficient" and had determined that it was most efficient to not have as many people in the city! That's about all I can remember. Does anyone know the book?
Could you be thinking of the 1965 film, Alphaville?
From the Wikipedia entry,
Alpha 60 is a sentient computer system ... which is in complete control of all of [the city of] Alphaville.
Alpha 60 has outlawed free thought and individualist concepts like love, poetry, and emotion in the city, replacing them with contradictory concepts or eliminating them altogether. ... People who show signs of emotion (weeping at the death of a wife, or smiling) are presumed to be acting illogically, and are gathered up, interrogated, and executed.
Could be 'The Tomorrow City' by Monica Hughes. From the Goodreads summary:
C-Three, the computer, is programmed to make the city of Thompsonville an ideal place to live in. But disaster threatens as the computer uses increasingly ruthless means to discard all that is old and useless. Caro and David are aware of the horrors, but can they alert the others in time?"