Jump to content

Trivial Graph Format

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by AndyFielding (talk | contribs) at 08:50, 9 November 2014 (punctuation). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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.

Other Graph File Formats

  • DOT language, a plain text graph description language -- Graphviz
  • GraphML, a graph exchange format based on XML -- GraphML
  • GXL, another graph exchange format based on XML -- GXL
  • GML is another widely used graph exchange format. -- GML
  • XGMML an XML-based graph markup language closely related to GML -- XGMML

See also

  • yEd, a graph editor that can handle TGF file format.