is_acyclic: Acyclic graphs

is_acyclicR Documentation

Acyclic graphs

Description

This function tests whether the given graph is free of cycles.

Usage

is_acyclic(graph)

Arguments

graph

The input graph.

Details

This function looks for directed cycles in directed graphs and undirected cycles in undirected graphs.

Value

A logical vector of length one.

Related documentation in the C library

is_acyclic().

See Also

is_forest() and is_dag() for functions specific to undirected and directed graphs.

Graph cycles feedback_arc_set(), girth(), has_eulerian_path(), is_dag()

Other structural.properties: bfs(), component_distribution(), connect(), constraint(), coreness(), degree(), dfs(), distance_table(), edge_density(), feedback_arc_set(), girth(), is_dag(), is_matching(), k_shortest_paths(), knn(), reciprocity(), subcomponent(), subgraph(), topo_sort(), transitivity(), unfold_tree(), which_multiple(), which_mutual()

Examples


g <- make_graph(c(1, 2, 1, 3, 2, 4, 3, 4), directed = TRUE)
is_acyclic(g)
is_acyclic(as_undirected(g))

igraph/rigraph documentation built on March 5, 2025, 3:35 a.m.