Next: Building Graphs Up: Algorithms Previous: ContainerNode

## The Default Graph Object Attributes

- back [int] Set by Depth-first search for each vertex v, this attribute stores the discovery time of the earliest ancestor which v is adjacent to via a back edge.
- color [char *] This attribute, commonly associated with both vertices and edges, takes on string values representing Tk colors. See the Tk manual for details, but the values are typically very straightforward, e.g. "blue" or "green." The STk interface uses this value to determine the actual color of each vertex or edge (and can modify it).
- direction [int] This outdated attribute stores information indicating whether an edge object is directed or undirected. A more natural way to tell this is: e->vertices()->sortedQ(), where an answer of ``yes'' means undirected.
- distance [double] Distance calculations such as shortest paths use and modify this attribute, usually associated with vertices.
- name [char *] This attribute stores the name by which this graph or graph object is identified. This attribute should never change.
- finishtime [int] Depth-first search sets this attribute as it finishes searching the neighbors of each vertex. Ordering the vertices by finishtime yields a postorder walk.
- label [char *] The label of a vertex or edge is a string of text currently associated with the object. Users and algorithms may change this from the interface and from C++ programs.
- low [int] Set by Depth-first search for each vertex v, this attribute stores the discovery time of the earliest proper ancestor to which any child of v is adjacent to via a back edge.
- mark [int] This general purpose attribute is provided to call attention to special vertices or edges. For example, the strongly connected components algorithm sets this mark for each component leader.
- partition [int] Various graph algorithms partition the vertex and/or edge sets of a graph into two or more parts. This attribute is used to store the locations of graph objects.
- pred [Vertex*] Graph searches induce a tree which is very useful for constructing more advanced algorithms. This tree is stored in the form of predecessor information for each vertex. The root of the search tree is found by following pred pointers as far as possible.
- size [int] This attribute is usually associated only with Vertex objects, and specifies the size in pixels of the vertex on the screen.
- starttime [int] Depth-first search sets this attribute as it discovers each vertex. Ordering the vertices by starttime yields a preorder walk.
- type [int] This is another general purpose attribute. One examples usage is to store the classification of an edge e during and after a depth-first search.
- width [int] The width of an edge is the screen width in pixels. Common values range from 1 to 4.
- weight [double] Graphs with vertex and edge weights arise in many, many applications. This double- precision attribute stores the weight of a Vertex or Edge object.
- x [double] This is the ``x'' coordinate of a Vertex object or the label (and control point) of an Edge object. The value is expected to be in world coordinates, where the world ranges from 0 to 1 in each direction.
- y [double] Similar to ``x.''

Next: Building Graphs Up: Algorithms Previous: ContainerNode