Find the leaves of a graph
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.
- One of
"out". This argument is ignored when
objectis undirected and required otherwise. When
degree.dir="out"), nodes have no in coming (out going) edges will be returned.
A character vector giving the node labels of the leaves.
data(graphExamples) graphExamples[] leaves(graphExamples[]) data(apopGraph) leaves(apopGraph, "in") leaves(apopGraph, "out")