GraphTheory[IsConnected]
GraphTheory[ConnectedComponents]
|
Calling Sequence
|
|
IsConnected(G)
ConnectedComponents(G)
|
|
Description
|
|
•
|
A graph G is connected if for each pair of vertices u and v in G there exists a path from u to v in G (if G is undirected), or in the underlying graph of G (if G is directed).
|
•
|
IsConnected returns true if the input graph is a connected graph or false otherwise. If G is a directed graph then the directions of edges are ignored. Use the IsStronglyConnected command to test whether each pair of vertices is connected by a directed path.
|
•
|
ConnectedComponents returns the components of the graph as a list of lists of vertices. Each sublist is a list of vertices for a connected component.
|
|
|
Examples
|
|
>
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
| (8) |
>
|
|
| (9) |
>
|
|
| (10) |
>
|
|
| (11) |
>
|
|
| (12) |
>
|
|
| (13) |
>
|
|
>
|
|
|
|
Download Help Document
Was this information helpful?