Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is_dag

Directed acyclic graphs


Description

This function tests whether the given graph is a DAG, a directed acyclic graph.

Usage

is_dag(graph)

Arguments

graph

The input graph. It may be undirected, in which case FALSE is reported.

Details

is_dag checks whether there is a directed cycle in the graph. If not, the graph is a DAG.

Value

A logical vector of length one.

Author(s)

Tamas Nepusz ntamas@gmail.com for the C code, Gabor Csardi csardi.gabor@gmail.com for the R interface.

Examples

g <- make_tree(10)
is_dag(g)
g2 <- g + edge(5,1)
is_dag(g2)

igraph

Network Analysis and Visualization

v1.2.10
GPL (>= 2)
Authors
See AUTHORS file.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.