finds a coloring with minimal size for the edges in the graph g.
FindEdgeColoring[g,{c1,c2,…}]
finds a coloring {c1,c2,…,ck} for the edges in the graph g.
FindEdgeColoring
finds a coloring with minimal size for the edges in the graph g.
FindEdgeColoring[g,{c1,c2,…}]
finds a coloring {c1,c2,…,ck} for the edges in the graph g.
Details and Options
- FindEdgeColoring is also known as graph coloring and edge labeling.
- FindEdgeColoring is typically used for modeling scheduling and assignment problems.
- FindEdgeColoring[g] finds a coloring {c1,c2,…,ck} with minimal size for the edges of g where ci are integers and ci is not equal to cj for two adjacent edges ei and ej of g with indices i and j.
- FindEdgeColoring[g,{c1,c2,…}] uses the specified colors ci.
- FindEdgeColoring[g,l] is effectively equivalent to FindEdgeColoring[g,{1,2,…,l}].
Examples
open all close allBasic Examples (2)
Find an edge coloring of the Petersen graph:
FindEdgeColoring[PetersenGraph[]]Assign distinct colors to adjacent edges of a graph:
g = PetersenGraph[];FindEdgeColoring[g, ColorData[106, "ColorList"]]Annotate[g, {EdgeStyle -> Thread[EdgeList[g] -> %]}]Scope (7)
FindEdgeColoring works with undirected graphs:
FindEdgeColoring[[image]]FindEdgeColoring[[image]]FindEdgeColoring[[image]]FindEdgeColoring[[image]]Use rules to specify the graph:
FindEdgeColoring[{1 -> 2, 1 -> 3, 1 -> 4, 1 -> 5, 2 -> 3, 2 -> 5, 3 -> 4, 4 -> 5}]Assign distinct colors to adjacent edges of a graph:
FindEdgeColoring[[image], ColorData[3, "ColorList"]]FindVertexColoring works with large graphs:
g = GridGraph[{10, 10, 10}];AbsoluteTiming[FindEdgeColoring[g];]Applications (3)
Basic Applications (1)
Tournament Schedule (2)
To schedule a round-robin tournament, build a graph where vertices correspond to the competitors in the tournament and the edges correspond to games:
g = [image];Find a schedule with as few rounds as possible so that each pair of competitors plays each other in one of the rounds:
res = FindEdgeColoring[g]Find the pairs of competitors who will play the first round:
EdgeList[g][[Flatten@Position[res, 1]]]FindEdgeColoring[g, ColorData[106, "ColorList"]];Annotate[g, {EdgeStyle -> Thread[EdgeList[g] -> Thread[{Thickness[0.02], %}]]}]In the National Football League, the pairs of teams that will play each other in a given year are determined based on the teams' records from the previous year. Build a graph where vertices correspond to the teams and the edges correspond to games:
g = [image];Assign games to the weekends on which they are played:
FindEdgeColoring[g]Find the minimum number of weekends needed:
Max[%]Properties & Relations (4)
An edge coloring of a graph is just a vertex coloring of its line graph:
g = PetersenGraph[]FindVertexColoring[LineGraph[g]]FindEdgeColoring[g]Using FindEdgeColoring to compute EdgeChromaticNumber:
g = PetersenGraph[];Max[FindEdgeColoring[g]]EdgeChromaticNumber[g]The number of colors needed to edge color a simple graph is either its maximum degree
or
:
g = Table[RandomGraph[{5, i}], {i, 10}];Max[FindEdgeColoring[#]]& /@ gMax[VertexDegree[#]]& /@ gThe number of colors needed to edge color a bipartite graph is its maximum degree:
g = {[image], [image], [image], [image]};BipartiteGraphQ /@ gMax[FindEdgeColoring[#]]& /@ gMax[VertexDegree[#]]& /@ gRelated Guides
History
Text
Wolfram Research (2021), FindEdgeColoring, Wolfram Language function, https://reference.wolfram.com/language/ref/FindEdgeColoring.html.
CMS
Wolfram Language. 2021. "FindEdgeColoring." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FindEdgeColoring.html.
APA
Wolfram Language. (2021). FindEdgeColoring. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindEdgeColoring.html
BibTeX
@misc{reference.wolfram_2026_findedgecoloring, author="Wolfram Research", title="{FindEdgeColoring}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/FindEdgeColoring.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_findedgecoloring, organization={Wolfram Research}, title={FindEdgeColoring}, year={2021}, url={https://reference.wolfram.com/language/ref/FindEdgeColoring.html}, note=[Accessed: 13-June-2026]}