GraphTheory - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Discrete Mathematics : Graph Theory : GraphTheory Package : GraphTheory/IsConnected

GraphTheory

  

IsConnected

  

ConnectedComponents

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

IsConnected(G)

ConnectedComponents(G)

Parameters

G

-

graph

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

withGraphTheory:

withSpecialGraphs:

GCycleGraph4

GGraph 1: an undirected unweighted graph with 4 vertices and 4 edge(s)

(1)

IsConnectedG

true

(2)

HGraphComplementG

HGraph 2: an undirected unweighted graph with 4 vertices and 2 edge(s)

(3)

IsConnectedH

false

(4)

ConnectedComponentsH

1,3,2,4

(5)

DrawGraphH

GGraph1,2,3,4,5,6,1,2,2,3,4,5

GGraph 3: an undirected unweighted graph with 6 vertices and 3 edge(s)

(6)

IsConnectedG

false

(7)

ConnectedComponentsG

1,2,3,4,5,6

(8)

GOctahedronGraph

GGraph 4: an undirected unweighted graph with 6 vertices and 12 edge(s)

(9)

ConnectedComponentsG

1,2,3,4,5,6

(10)

HGraphComplementG

HGraph 5: an undirected unweighted graph with 6 vertices and 3 edge(s)

(11)

IsConnectedH

false

(12)

ConnectedComponentsH

1,2,3,4,5,6

(13)

DrawGraphG

DrawGraphH

See Also

ArticulationPoints

GraphRank

IsBiconnected

IsReachable

IsStronglyConnected

IsTwoEdgeConnected

StronglyConnectedComponents

UnderlyingGraph