IsForest - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

All Products    Maple    MapleSim


GraphTheory

  

IsForest

  

test if graph is a forest

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

IsForest(G)

Parameters

G

-

graph

Description

• 

The IsForest command returns true if the input graph is a forest or false otherwise. A forest is a graph whose connected components are all trees.

Examples

withGraphTheory:

FGraph1,2,3,4,5,6,1,2,2,3,5,6

FGraph 1: an undirected graph with 6 vertices and 3 edge(s)

(1)

IsForestF

true

(2)

CConnectedComponentsF

C1,2,3,4,5,6

(3)

seqIsTreeInducedSubgraphF,i,i=C

true,true,true

(4)

NumberOfVerticesFNumberOfEdgesFnopsConnectedComponentsF

0

(5)

See Also

ConnectedComponents

InducedSubgraph

IsTree