dfsk: Depth-First-Search loops of length k

View source: R/depth_first_search.R

dfskR Documentation

Depth-First-Search loops of length k

Description

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.

Usage

dfsk(AM, node, visited, pathway, k, started, file, start)

Arguments

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.

Value

No returned value, writes .txt file to working directory.


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