is.tree: Test if a graph is a tree or a forest.

Description Usage Arguments Details Value Author(s) Examples

View source: R/subtree.R

Description

Test if a graph is a tree or a forest.

Usage

1
2
is.tree(g)
is.forest(g,strict=FALSE)

Arguments

g

a graph.

strict

logical.

Details

test whether an undirected graph g is a tree (connected, acyclic) or a forest (disjoing union of trees). The flag strict enforces the strict rule that a forest must contain more than a single tree. The default is to allow for single-tree forests, which is the convention.

Value

a logical.

Author(s)

David J. Marchette dmarchette@gmail.com

Examples

1
2
3
4
   g <- make_tree(10)
	is.tree(g)
	is.forest(g)
	is.forest(g,strict=TRUE)

HyperG documentation built on March 4, 2021, 5:06 p.m.

Related to is.tree in HyperG...