Trivial Graph Format

From Wikipedia, the free encyclopedia
Jump to: navigation, search

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[edit]

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[edit]

  • 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[edit]

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

External links[edit]