Basically, attributes have been designed to store data indexed by graph arc and node indices. With respect to constant attribute values (e.g. all node demands equal to one), it is possible to keep the representational vector size zero. There are variants of the manipulation procedures known for STL vectors which exclude constant attributes.
Graph attributes are collected into attributePool objects in which they can be addressed by a so-called token. This denotes an index in the TPoolTable array which is associated with this attribute pool. The pool table lists clear text names, type and size info of all possible attributes. In practice, only few of the listed attributes are allocated.
All managed graph attributes conform with manipulations of the incidence structure. To allocate attributes of the correct vetor length, it takes the method abstractMixedGraph::SizeInfo() which reports about the problem dimensions.
Direct access to attributes definetely improves the performance. In order to extract attributes, the contained vectors or the contained arrays from the managing pool object, represented graph objects grant public access to all its compound attribute pools:
But observe that direct manipulation of attributes can corrupt the graph representation. For example, reducing an upper arc capacity bound might be incompatible with the lower bound and the subgraph multiplicity. Manipulating attributes by means of the representational object preserves data integrity.
For all index set subclasses, the operation indexSet::IsMember(i) verifies the membership of the index i in constant time. Particular subclasses may or may not provide efficient methods to enumerate the contained indices. The default implementations of indexSet::First() and indexSet::Successor() scan the full index range. For the current applications, this is not performance-critical since the graph algorithms run over the full index range anyway, for sake of initialization.
There are indexSet derivates which are absolutely generic, namely to specify empty sets, full index intervals 0,1,..,r-1, or singleton sets. There are classes to define the union, meet or difference of two index sets, and index set complements. Other index set objects refer to the nodes or the arcs of a particular graph with a certain property.
It is worth to note that contiguous memory stacks and queues also work as index sets.
Most graphs can be handled by the default implementation iGraph, but some graph classes come with an own investigator class. There is a factory method abstractMixedGraph::NewInvestigator() which supplies with investigator objects of the correct type.
According to the frequent investigator applications in the library, there is a mechanism to cache iterator ojbects instead of new / delete operations. Iterators taken from the cache are called managed investigators. So, a typical application code does not contain constructor or factory method calls but only calls to abstractMixedGraph::Investigate() which tries to avoid memory allocations.
Return to main page