dfs: Depth-First-Search wrapper

View source: R/depth_first_search.R

dfsR Documentation

Depth-First-Search wrapper

Description

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.

Usage

dfs(AM, output = "allLoops", k = NULL, verbose = TRUE)

Arguments

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.

Value

Returns file name.

References

Tarjan, R. (1972). Depth-First Search and Linear Graph Algorithms. SIAM Journal on Computing, 1(2), 146–160. https://doi.org/10.1137/0201010.


dswdejonge/fwstability documentation built on Dec. 7, 2022, 7:24 p.m.