Attaching Data to Edges and Vertices
List of: Discussion Topic
Subjects: Graph Theory
Contents: Kernel

The C++ classes of gvertex and gedge are use counted in the same way that laws are use counted. That is, they are copied by calling the add method and deleted by calling the remove method.

Several graphs may refer to the same edges and vertices without having to copy the data that they may contain. To make a gvertex or gedge contain data, derive a class from the base classes of gvertex and gedge. Use a technique similar to the entity_gvertex class which enables it to contain an entity pointer. Case methods may be added to locate vertices by name or by entity, so that type casting is not necessary. A method can also be added to return all the entities referenced by a graph.
PDF/KERN/05GRAPH.PDF
HTM/DATA/KERN/KERN/05GRAPH/0007.HTM