Cycles and coloring in graphs and digraphs