View source: R/depth_first_search.R
dfsall | R Documentation |
This recursive Depth-First-Search function finds all loops in the foodweb starting from a certain node and writes them to a text file.
dfsall(AM, node, visited, pathway, 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. |
started |
Logical vector which stores which nodes have been used before as starting node. |
file |
String with name for textfile that will 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.