breadth_first: Breadth first search of a directed unweighted graph with...

Description Usage Arguments Value

Description

Performs a breadth first search of node_matrix to find a path from node 'from' to node 'to'. If a path is found, returns path and distance.

Usage

1
breadth_first(node_matrix, from, to)

Arguments

node_matrix

A square matrix where cells are 1 if there is an edge between the row cell and the column cell and 0 otherwise

from

The origin node

to

The destination node

Value

A list with the keys 'status' (TRUE if there is a path, FALSE if not), and if there is a path, also 'distance' and 'path'.


aaronrudkin/werner documentation built on May 23, 2019, 6:03 a.m.