View source: R/depth_first_search.R
dfs | R Documentation |
This function is a wrapper for two recursive Depth-First-Search functions. The wrapper checks data input, redirects to the right algorithm, and checks if no file will be overwritten.
dfs(AM, output = "allLoops", k = NULL, verbose = TRUE)
AM |
(required) Adjacency matrix |
output |
(required) Name for textfile to store loops. The data will be stored as "<output>.txt" if all loops are searched for, or as "<output>_k=<k>.txt". Default is "allLoops", so the text file will be "allLoops.txt" or "allLoops_k=<k>.txt". |
k |
(optional) Default is NULL. Integer of length loop to search for. |
verbose |
(optional) Default is TRUE. Set to FALSE to hide messages. |
Returns file name.
Tarjan, R. (1972). Depth-First Search and Linear Graph Algorithms. SIAM Journal on Computing, 1(2), 146–160. https://doi.org/10.1137/0201010.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.