Trivial Graph Format

Trivial Graph Format (TGF) is a simple text-based file format for describing graphs. It consists of a list of node definitions, which map node IDs to labels, followed by a list of edges, which specify node pairs and an optional edge label. Node IDs can be arbitrary identifiers, whereas labels for both nodes and edges are plain strings.

The graph may be interpreted as a directed or undirected graph. For directed graphs, to specify the concept of bi-directionality in an edge, one may either specify two edges (forward and back) or differentiate the edge by means of a label. For more powerful specification of graphs, see the other graph file formats below.

Example

A simple graph with 2 nodes and 1 edge might look like this:

1 First node
2 Second node
#
1 2 Edge between the two

The # sign marks the end of the node list and the start of the edge list.

See also

External links


This article is issued from Wikipedia - version of the Sunday, November 29, 2015. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.