Child pages
  • Input Format
Skip to end of metadata
Go to start of metadata

The format of input graph files is a subset of the DOT format. A graph be either a directed graph or an undirected graph.

1. Directed Graph:

digraph graphName {
node1 [ attribute1=value1 attribute2=value2 ... ] #comments
"node 2" [ "attribute 1"="value 1" attribute2=value2 ... ] //comments
...
node1 -> "node 2" [ attribute1=value1 attribute2=value2 ... ] #comments
...
}

2. Undirected Graph:

graph graphName {
node1 [ attribute1=value1 attribute2=value2 ... ] #comments
"node 2" [ "attribute 1"="value 1" attribute2=value2 ... ] //comments
...
node1 -- "node 2" [ attribute1=value1 attribute2=value2 ... ] #comments
...
}

Nevertheless, the input graph can be a multigraph, where parallel edges are allowed.

You can find several example DOT files in the 'sample_graph' directory or download them here.

 

Names for graphs, nodes, edges, and attributes can be strings of any non-space characters except:

[]();#="

There are no escape characters.

Space characters can be used by wrapping the string with double-quotes.

Comments can be added throughout the DOT file with either '#' or '//'; any trailing characters are ignored by the parser.

  • No labels