Next: Commonalities Among Combinatorial Objects Up: Programmer's Manual Previous: SequenceBase and Sequence

# Graph Operations

The unary and binary graph operations are listed below. For a discussion of the meaning of each operation, see [3] (for example). Note that each operation returns MHyperGraph. This allows the programmer maximum flexibility with respect to graph type. The Graphclass constructors make it easy to convert the result into a more specific form. For example, suppose the programmer knows that the result should be treated as an undirected, binary graph. The following line of code produces a copy of the g's complement which is of the appropriate type:
UBinGraph ug = g->complement();

Figure 3.10: The GraphHierarchy
MBinGraph | complement ();

Return the complement graph. The result is a mixed binary graph containing only undirected edges.

MBinGraph | intersection (const Graph& g);

Return the graph intersection of the current graph and g. Edges retain their directions, so the resulting graph may have undirected edges, directed edges, or both.

MBinGraph | lexicographicProduct (const Graph& g);

Return the lexicographic product (an undirected graph) not implemented yet.

MBinGraph | lineGraph ();

Return the line graph. Edges of the result are always undirected.

MBinGraph | product (const Graph& g);

Return the graph product of the current graph and g. The result is an undirected graph with x and y coordinates assigned to each vertex in such a way that the copies of the current graph is arranged in a circle, and each copy is itself arranged in a smaller circle.

MBinGraph | sum (const Graph& g);

Return the graph sum of the current graph and g. Edges retain their directions, so the resulting graph may have undirected edges, directed edges, or both.

MBinGraph | operator+ (const Graph& g);

Return the result of calling sum(g).

MBinGraph | operator* (const Graph& g);

Return the result of calling product(g).

- Commonalities Among Combinatorial Objects
- Permutations

Next: Commonalities Among Combinatorial Objects Up: Programmer's Manual Previous: SequenceBase and Sequence