The data type GRAPH is a parameterized version of the data type
graph. The nodes and edges of a Parameterized
Graph contain additional (user defined) information.
Parameterized Graphs can represent directed and undirected
graphs G=(V,E), where V is the list of nodes and E is the list of directed,
respectively undirected, edges. Nodes and edges are of type item.
Simple example of
how to use a parameterized graph
- all operations available for
graph are also defined for
- additional operations to access and update information associated
with nodes and edges conveniently
- can be used whereever
graph is possible (assignments,
arguments to functions with formal parameter
- flexible: Parameterized Graphs work well for dynamic graphs. It is
possible to associate information with new nodes and edges without restriction.
This is not possible for Node Arrays
and Edge Arrays.
- faster than Node Arrays and Edge Arrays
- Only one piece of information can be associated with each node/edge
of a graph
- Use Parameterized Graphs if the information to associate with nodes
and edges is an essential part of the graph.
- If you need to associate more than one piece of information with
each node/edge of a graph, consider using one of the related
- If you know the number of objects you want to associate with a node/edge
beforehand, you can use the special constructor G(int
n_slots,int e_slots) for graphs.
How to Associate Information
and Related Data Types
GraphWin for visualizing graphs
and graph algorithms
Page Parameterized Graphs
Defined Parameter Types