is.tree {HyperG}R Documentation

Test if a graph is a tree or a forest.

Description

Test if a graph is a tree or a forest.

Usage

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

   g <- make_tree(10)
	is.tree(g)
	is.forest(g)
	is.forest(g,strict=TRUE)

[Package HyperG version 1.0.0 Index]