MultigraphQ[g]
yields True if the graph g is a multigraph and False otherwise.
MultigraphQ
MultigraphQ[g]
yields True if the graph g is a multigraph and False otherwise.
Examples
open all close allBasic Examples (2)
Test whether a graph has multiple edges:
Graph[{12, 23, 31, 31}]MultigraphQ[%]MultigraphQ gives False for inputs that are not graphs with multiple edges:
CompleteGraph[4]MultigraphQ[%]Scope (2)
MultigraphQ gives False for expressions that are not graphs:
MultigraphQ[x]MultigraphQ works with large graphs:
m = SparseArray[{Band[{1, 2}] -> 1, {1, 3} -> 2, Band[{1, 4}] -> 1}, {100000, 100000}];g = AdjacencyGraph[m];MultigraphQ[g]//TimingProperties & Relations (2)
A PathGraph has no multiple edges:
PathGraph[{12, 23}]{PathGraphQ[%], MultigraphQ[%]}The adjacency matrix of a graph with multiple edges has some entries greater than 1:
g = {Graph[{12, 12, 23, 31}], Graph[{12, 12, 23, 31}]}MultigraphQ /@ gMatrixForm /@ AdjacencyMatrix /@ gIts incidence matrix has repeated columns:
MatrixForm /@ IncidenceMatrix /@ gPossible Issues (1)
MultigraphQ gives False for non-explicit graphs:
MultigraphQ[CompleteGraph[n]]Related Guides
History
Text
Wolfram Research (2014), MultigraphQ, Wolfram Language function, https://reference.wolfram.com/language/ref/MultigraphQ.html.
CMS
Wolfram Language. 2014. "MultigraphQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MultigraphQ.html.
APA
Wolfram Language. (2014). MultigraphQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MultigraphQ.html
BibTeX
@misc{reference.wolfram_2026_multigraphq, author="Wolfram Research", title="{MultigraphQ}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/MultigraphQ.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_multigraphq, organization={Wolfram Research}, title={MultigraphQ}, year={2014}, url={https://reference.wolfram.com/language/ref/MultigraphQ.html}, note=[Accessed: 12-June-2026]}