Skip to contents

A directed acyclic graph (DAG) is a directed graph with no directed cycles. For directed graphs, only directed cycles are considered.

Usage

is_dag(graph)

is_acyclic(graph)

Arguments

graph

An igraph_ptr object.

Value

A logical value.

Examples

dag = graph_tree(5L)
tree = graph_tree(5L, mode = 2L)
ring = graph_ring(5L)

is_dag(dag)
#> [1] TRUE
is_dag(tree)
#> [1] FALSE
is_dag(ring)
#> [1] FALSE

is_acyclic(dag)
#> [1] TRUE
is_acyclic(tree)
#> [1] TRUE
is_acyclic(ring)
#> [1] FALSE