View source: R/depth_first_search.R
dfsk | R Documentation |
This recursive Depth-First-Search function finds all loops of length k starting at a certain node in the foodweb and writes them to a text file.
dfsk(AM, node, visited, pathway, k, started, file, start)
AM |
Adjacency matrix. |
node |
Current node. |
visited |
Logical vector which stores if a node is visited before. |
pathway |
Integer vector that tracks the pathway to current node. |
k |
Integer denoting the length of loops searched for. |
started |
Logical vector which stores which nodes have been used before as starting node. |
file |
String with filename to store loops. |
start |
Is integer with the current start node. |
No returned value, writes .txt file to working directory.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.