check_dag: Check Cyclicity in a Directed Acyclic Graph

Description Usage Arguments Details Value

View source: R/check_dag.R

Description

Checks whether a given connection matrix is acyclic. The function is recursive and shrinks the search space until a solution is found.

Usage

1
check_dag(DAG, node_name, visited_nodes = list())

Arguments

DAG

A matrix where the non zero elements what connections exist. The rows indicate the node where the edge is going to, and the columns indicates the node where the edge is coming from.

node_name

A string indicating the identifier of the node from which cyclicity is checked.

visited_nodes

A list of strings indicating all the nodes that have been visited in the recursive loop.

Details

This is an internal function called by verify_dag()

Value

A boolean indicating whether a cycle is detected (TRUE), or not (FALSE)


GeertPostma/pathmodelr documentation built on Oct. 5, 2021, 4:17 p.m.