Algorithmic Solutions > LEDA > LEDA Guide > Graphs and Related Data Types > Associate Information with Graphs > Node Arrays

Node Arrays

The data type node_array<E> can be used to associate additional (LEDA or user defined) information of type E with the nodes of a graph.

Example of how to use a node array for a graph


  • more efficient access than with Node Maps
  • there can be an arbitrary number of Node Arrays for a graph
  • Node Arrays can be defined at any point in a program


  • less efficient than Parameterized Graphs
  • only works well for static graphs: A new node will not have a corresponding entry in the Node Array (explicit init() is necessary)
  • cost of declaring a Node Array is proportional to the number of nodes in the graph


  • Node Arrays are primarily useful for static graphs. They are the most convenient and most widely used way to associate information with nodes of static graphs and for dense arrays, that is, most of nodes need an entry.
  • Using Node Arrays for highly dynamic graphs is quite inconvenient.

See also:

Parameterized Graphs

Node Maps

Two Dimensional Node Arrays

Associate Information with Graphs

Graphs and Related Data Types


Manual Entries:

Manual Page Node Arrays

User Defined Parameter Types

Please send any suggestions, comments or questions to
© Copyright 2001-2003, Algorithmic Solutions Software GmbH