Skip to contents

Finds a path between two nodes in a graph.

Different types of graphs use different algorithims to find the paths. a DirectedGraph uses breadth-first search while an DirectedAcyclicGraph uses topological sort.

The path is represented as a character vector with the node ids of the nodes that make up the path.

Usage

find_path(graph, from, to)

Arguments

graph

A graph object

from

The starting node of the path

to

The ending node of the path

Value

A character vector