is_acyclic.board | R Documentation |
Block dependencies are represented by DAGs and graph utility functions
topo_sort()
and is_acyclic()
are used to create a topological ordering
(implemented as DFS) of blocks and to check for cycles. An adjacency matrix
corresponding to a board is available as as.matrix()
.
## S3 method for class 'board'
is_acyclic(x)
## S3 method for class 'links'
is_acyclic(x)
topo_sort(x)
is_acyclic(x)
## S3 method for class 'matrix'
is_acyclic(x)
x |
Object |
Topological ordering via topo_sort()
returns a character vector
with sorted node IDs and the generic function is_acyclic()
is expected to
return a scalar logical value.
brd <- new_board(
c(
a = new_dataset_block(),
b = new_dataset_block(),
c = new_scatter_block(),
d = new_subset_block()
),
list(from = c("a", "d"), to = c("d", "c"))
)
as.matrix(brd)
topo_sort(brd)
is_acyclic(brd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.