IndependentEdgeSetQ[g,elist]
yields True if the edge list elist is an independent edge set of the graph g, and False otherwise.
IndependentEdgeSetQ
IndependentEdgeSetQ[g,elist]
yields True if the edge list elist is an independent edge set of the graph g, and False otherwise.
Details
- An independent edge set is also known as a matching.
- An independent edge set is a set of edges that are never incident to the same vertex.
- IndependentEdgeSetQ works with undirected graphs, directed graphs, multigraphs, and mixed graphs.
Examples
open all close allBasic Examples (1)
Scope (5)
IndependentEdgeSetQ[[image], {12, 36, 45}]IndependentEdgeSetQ[[image], {21, 36, 54}]IndependentEdgeSetQ[[image], {12, 36, 45}]IndependentEdgeSetQ[[image], {21, 36, 54}]IndependentEdgeSetQ works with large graphs:
g = GridGraph[{10, 10, 10, 10}];IndependentEdgeSetQ[g, {12, 56}]//TimingApplications (2)
Enumerate all independent edge sets for a cycle graph:
g = CycleGraph[4]Enumerate all subsets of edges and select the independent edge sets:
Subsets[EdgeList[g]]esl = Select[%, IndependentEdgeSetQ[g, #]&]Table[HighlightGraph[g, h, GraphHighlightStyle -> "Thick"], {h, esl}]Enumerate all maximal independent edge sets for a wheel graph:
g = WheelGraph[5]Find the length of a maximal independent edge set:
Length[FindIndependentEdgeSet[g]]Enumerate all edge subsets of length 2 and select the independent edge sets:
esl = Select[Subsets[EdgeList[g], {2}], IndependentEdgeSetQ[g, #]&]Highlight maximal independent sets:
Table[HighlightGraph[g, h, GraphHighlightStyle -> "Thick"], {h, esl}]Properties & Relations (3)
A largest independent edge set can be found using FindIndependentEdgeSet:
PetersenGraph[5, 2]IndependentEdgeSetQ[%, FindIndependentEdgeSet[%]]Bipartite graphs have independent edge sets and vertex covers of equal length:
g = CompleteGraph[{2, 3}]Length[FindVertexCover[g]] == Length[FindIndependentEdgeSet[g]]For a graph without isolated vertices, the sum of the size of the independent edge set and the size of the edge cover equals the number of vertices:
g = PetersenGraph[5, 2]Length[FindEdgeCover[g]] + Length[FindIndependentEdgeSet[g]] == VertexCount[g]Related Guides
Text
Wolfram Research (2010), IndependentEdgeSetQ, Wolfram Language function, https://reference.wolfram.com/language/ref/IndependentEdgeSetQ.html (updated 2014).
CMS
Wolfram Language. 2010. "IndependentEdgeSetQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/IndependentEdgeSetQ.html.
APA
Wolfram Language. (2010). IndependentEdgeSetQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/IndependentEdgeSetQ.html
BibTeX
@misc{reference.wolfram_2026_independentedgesetq, author="Wolfram Research", title="{IndependentEdgeSetQ}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/IndependentEdgeSetQ.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_independentedgesetq, organization={Wolfram Research}, title={IndependentEdgeSetQ}, year={2014}, url={https://reference.wolfram.com/language/ref/IndependentEdgeSetQ.html}, note=[Accessed: 12-June-2026]}