leaves: Find the leaves of a graph

Description Usage Arguments Value Author(s) Examples

Description

A leaf of an undirected graph is a node with degree equal to one. A leaf of a directed graph is defined with respect to in-degree or out-degree. The leaves of a directed graph with respect to in-degree (out-degree) are those nodes with in-degree (out-degree) equal to zero.

Usage

1
leaves(object, degree.dir)

Arguments

object

A graph object

degree.dir

One of "in" or "out". This argument is ignored when object is undirected and required otherwise. When degree.dir="in" (degree.dir="out"), nodes have no in coming (out going) edges will be returned.

Value

A character vector giving the node labels of the leaves.

Author(s)

Seth Falcon

Examples

1
2
3
4
5
6
7

vjcitn/graph documentation built on Dec. 23, 2021, 4:06 p.m.