Synthesis of sequences for traffic signal controllers using techniques of the theory of graphs