Pudu programming language
Menu
API reference

Std.Graph.reachableFrom

1 declaration

fn

reachableFrom: &Std.Graph.Graph[N] -> N -> Array[N] where N: Ord

This is a callable function.

What it does

Every node reachable from a starting node, nearest first.

Breadth first, so the order says something: a node listed earlier is no

further away than one listed later. The queue is a deque because the walk

takes from the front on every step, which is the one thing an array is bad

at.

Read the signature

  • The text after the name is the type checked by Pudu.
  • Read arrows from left to right: inputs come first, and the final type is returned.
  • & borrows a value for this call instead of moving or copying it.
  • Names inside [ ] are type arguments, such as the item type held by a collection.

Back to Std.GraphSearch related declarations