WeakComponents
WeakComponents[g]
gives a list of all weakly connected components in the undirected graph g.
Details and Options
- WeakComponents functionality is now available in the built-in Wolfram Language function WeaklyConnectedComponents.
- To use WeakComponents, you first need to load the Graph Utilities Package using Needs["GraphUtilities`"].
- A weakly connected component of a directed graph is a set of vertices such that for each pair of vertices, there is a path between them. The graph g is considered as undirected.
Examples
Basic Examples (2)Summary of the most common use cases

https://wolfram.com/xid/0cgn0zidfztf-byy0c
This shows that the following graph has two weakly connected components:

https://wolfram.com/xid/0cgn0zidfztf-o309o

https://wolfram.com/xid/0cgn0zidfztf-joq4a6

WeakComponents has been superseded by WeaklyConnectedComponents:

https://wolfram.com/xid/0cgn0zidfztf-qs9cop

https://wolfram.com/xid/0cgn0zidfztf-s1us5t

Wolfram Research (2007), WeakComponents, Wolfram Language function, https://reference.wolfram.com/language/GraphUtilities/ref/WeakComponents.html.
Text
Wolfram Research (2007), WeakComponents, Wolfram Language function, https://reference.wolfram.com/language/GraphUtilities/ref/WeakComponents.html.
Wolfram Research (2007), WeakComponents, Wolfram Language function, https://reference.wolfram.com/language/GraphUtilities/ref/WeakComponents.html.
CMS
Wolfram Language. 2007. "WeakComponents." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/GraphUtilities/ref/WeakComponents.html.
Wolfram Language. 2007. "WeakComponents." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/GraphUtilities/ref/WeakComponents.html.
APA
Wolfram Language. (2007). WeakComponents. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/GraphUtilities/ref/WeakComponents.html
Wolfram Language. (2007). WeakComponents. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/GraphUtilities/ref/WeakComponents.html
BibTeX
@misc{reference.wolfram_2025_weakcomponents, author="Wolfram Research", title="{WeakComponents}", year="2007", howpublished="\url{https://reference.wolfram.com/language/GraphUtilities/ref/WeakComponents.html}", note=[Accessed: 23-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_weakcomponents, organization={Wolfram Research}, title={WeakComponents}, year={2007}, url={https://reference.wolfram.com/language/GraphUtilities/ref/WeakComponents.html}, note=[Accessed: 23-April-2025
]}