Search⌘ K

Maps for Node Values

Explore how to represent and query node values in Elixir using maps. Understand how to read graph vertices, find inbound and outbound edges by node properties, and test paths between nodes in directed graphs. This lesson helps you model and interact with graph data effectively in Elixir.

Visual representation

We can use a map for node values, as shown in the following figure.

Nodes as maps
Nodes as maps

Reading

We can read our book graph selecting maps for node values as follows:

iex> g = NativeGraph.Examples.Book.book(false)
...