Pudu programming language
Menu
API reference

Std.Graph.Graph

1 declaration

type

Graph

This declaration introduces a public type.

What it does

A directed graph: nodes, and the edges leading out of each one.

Held as a map from a node to the nodes it points at, because that is the

question every walk over a graph asks — given where I am, where may I go.

A node with no outgoing edges still belongs, so membership is kept apart

from the edge map rather than inferred from it; a graph that forgot its

leaves would report a shorter topological order than it has nodes.

The edges are a MultiMap, which is what several values under one key are.

That keeps the rule about a node whose last edge is removed in one place

rather than here, and it fits because membership is already held separately:

such a node leaves the edges and stays a node.

Read the signature

  • This declaration has no value signature because it introduces a type or trait.

Back to Std.GraphSearch related declarations