WeaklyConnectedGraphQ
Details
- WeaklyConnectedGraphQ works for any graph object.
- A graph is weakly connected if there is a sequence of edges joining every pair of vertices.
- A graph is weakly connected if there is a sequence of edges joining every pair of vertices when the graph is considered undirected.
Examples
open all close allBasic Examples (2)
Scope (6)
WeaklyConnectedGraphQ[[image]]WeaklyConnectedGraphQ[[image]]WeaklyConnectedGraphQ[[image]]WeaklyConnectedGraphQ[[image]]WeaklyConnectedGraphQ gives False for anything that is not a weakly connected graph:
WeaklyConnectedGraphQ[a]WeaklyConnectedGraphQ works with large graphs:
GridGraph[{10, 10, 10, 10}];WeaklyConnectedGraphQ[%]//TimingProperties & Relations (3)
A tree graph is weakly connected:
TreeGraph[{12, 13, 14}]ConnectedGraphQ[%]A path graph is weakly connected:
PathGraph[Range[10]]WeaklyConnectedGraphQ[%]The minimum number of edges in a weakly connected graph with
vertices is
:
g = PetersenGraph[5, 2]WeaklyConnectedGraphQ[g]EdgeCount[g] ≥ VertexCount[g] - 1A path graph with
vertices has exactly
edges:
h = PathGraph[Range[10]]WeaklyConnectedGraphQ[h]EdgeCount[h]Related Guides
History
Text
Wolfram Research (2012), WeaklyConnectedGraphQ, Wolfram Language function, https://reference.wolfram.com/language/ref/WeaklyConnectedGraphQ.html.
CMS
Wolfram Language. 2012. "WeaklyConnectedGraphQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/WeaklyConnectedGraphQ.html.
APA
Wolfram Language. (2012). WeaklyConnectedGraphQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WeaklyConnectedGraphQ.html
BibTeX
@misc{reference.wolfram_2026_weaklyconnectedgraphq, author="Wolfram Research", title="{WeaklyConnectedGraphQ}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/WeaklyConnectedGraphQ.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_weaklyconnectedgraphq, organization={Wolfram Research}, title={WeaklyConnectedGraphQ}, year={2012}, url={https://reference.wolfram.com/language/ref/WeaklyConnectedGraphQ.html}, note=[Accessed: 13-June-2026]}