ree ▁plan ar ▁graphs , ▁the ▁number ▁of ▁colors ▁is ▁always ▁, ▁and ▁for ▁mult ig raph s , ▁the ▁number ▁of ▁colors ▁may ▁be ▁as ▁large ▁as ▁. ▁There ▁are ▁polynomial ▁time ▁algorithms ▁that ▁construct ▁optimal ▁color ings ▁of ▁b ipart ite ▁graphs , ▁and ▁color ings ▁of ▁non - b ipart ite ▁simple ▁graphs ▁that ▁use ▁at ▁most ▁ ▁colors ; ▁however , ▁the ▁general ▁problem ▁of ▁finding ▁an ▁optimal ▁edge ▁color ing ▁is ▁N P - hard ▁and ▁the ▁fast est ▁known ▁algorithms ▁for ▁it ▁take ▁exponential ▁time . ▁Many ▁variations ▁of ▁the ▁edge ▁color ing ▁problem , ▁in ▁which ▁an ▁assign ments ▁of ▁colors ▁to ▁edges ▁must ▁satisfy ▁other ▁conditions ▁than ▁non - adj ac ency , ▁have ▁been ▁studied . ▁Edge ▁color ings ▁have ▁applications ▁in ▁sched uling ▁problems ▁and ▁in ▁frequency ▁assignment ▁for ▁fi ber ▁opt ic ▁networks . ▁ ▁Ex amples ▁A ▁cycle ▁graph ▁may ▁have ▁its ▁edges ▁colored ▁with ▁two ▁colors ▁if ▁the ▁length ▁of ▁the ▁cycle ▁is ▁even : ▁simply ▁alternate ▁the ▁two ▁colors ▁around ▁the ▁cycle . ▁However , ▁if ▁the ▁length ▁is ▁odd , ▁three ▁colors ▁are ▁needed . ▁ ▁A ▁complete ▁graph ▁ ▁with ▁ ▁vertices ▁is ▁edge - color able ▁with ▁ ▁colors ▁when ▁ ▁is ▁an ▁even ▁number ; ▁this ▁is ▁a ▁special ▁case ▁of ▁Bar any ai ' s ▁theorem . ▁ ▁provides ▁the ▁following ▁geometric ▁construction ▁of ▁a ▁color ing ▁in ▁this ▁case : ▁place ▁ ▁points ▁at ▁the ▁vertices ▁and ▁center ▁of ▁a ▁regular ▁- s