Graphs can be represented as DOT files, GML files, GraphML files, GXL files, edge lists or adjancency matrixes. All examples in the format descriptions below represent the following graph:
DOT file format as described in the official Graphviz documentation. Hypercube parses the complete language, but the only used attribute is the label attribute (for both edges and nodes).
Digraph { 0 -> 1 [label = 1]; 0 -> 3 [label = 2]; 0 -> 5 [label = 3]; 1 -> 2 [label = 4]; 1 -> 6 [label = 5]; 2 -> 3 [label = 6]; 2 -> 7 [label = 7]; 3 -> 4 [label = 8]; 4 -> 5 [label = 9]; 4 -> 7 [label = 10]; 5 -> 6 [label = 11]; 6 -> 7 [label = 12]; }
GML file format as described in the official documentation.
graph [ directed 1 node [id 0] node [id 1] node [id 2] node [id 3] node [id 4] node [id 5] node [id 6] node [id 7] edge [label "1" source 0 target 1] edge [label "2" source 0 target 3] edge [label "3" source 0 target 5] edge [label "4" source 1 target 2] edge [label "5" source 1 target 6] edge [label "6" source 2 target 3] edge [label "7" source 2 target 7] edge [label "8" source 3 target 4] edge [label "9" source 4 target 5] edge [label "10" source 4 target 7] edge [label "11" source 5 target 6] edge [label "12" source 6 target 7] ]
GraphML file format as given by the specification. Hypercube does not support nested graphs, hyperedges or ports.
<?xml version="1.0" encoding="UTF-8"?> <graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd"> <graph id="G" edgedefault="directed"> <node id="0"/> <node id="1"/> <node id="2"/> <node id="3"/> <node id="4"/> <node id="5"/> <node id="6"/> <node id="7"/> <edge source="0" target="1" id="1"/> <edge source="0" target="3" id="2"/> <edge source="0" target="5" id="3"/> <edge source="1" target="2" id="4"/> <edge source="1" target="6" id="5"/> <edge source="2" target="3" id="6"/> <edge source="2" target="7" id="7"/> <edge source="3" target="4" id="8"/> <edge source="4" target="5" id="9"/> <edge source="4" target="7" id="10"/> <edge source="5" target="6" id="11"/> <edge source="6" target="7" id="12"/> </graph> </graphml>
GXL file format as given by the specification. Hypercube does not support hypergraphs, hyperedges and mixed graphs.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE gxl SYSTEM "http://www.gupro.de/GXL/gxl-1.0.dtd"> <gxl> <graph> <node id="0"/> <node id="1"/> <node id="2"/> <node id="3"/> <node id="4"/> <node id="5"/> <node id="6"/> <node id="7"/> <edge from="0" to="1" id="1"/> <edge from="0" to="3" id="2"/> <edge from="0" to="5" id="3"/> <edge from="1" to="2" id="4"/> <edge from="1" to="6" id="5"/> <edge from="2" to="3" id="6"/> <edge from="2" to="7" id="7"/> <edge from="3" to="4" id="8"/> <edge from="4" to="5" id="9"/> <edge from="4" to="7" id="10"/> <edge from="5" to="6" id="11"/> <edge from="6" to="7" id="12"/> </graph> </gxl>
Each line of the input file represents an edge entry. The first value is the edge's start vertex ID, the second value the end vertex ID and the optional third value is the edge label (value). The values are strings separated by an arbitrary amount of whitespace. Quoted strings can be used, if whitespace occurs in the value.
0 1 1 0 3 2 0 5 3 1 2 4 1 6 5 2 3 6 2 7 7 3 4 8 4 5 9 4 7 10 5 6 11 6 7 12
The adjacency matrix representation starts with a single number on a separate line representing the number of vertexes of the graph. Starting with the next line, the adjacency matrix itself follows. Numbers > 0 are taken as edges with the given edge value.
8 0 1 0 2 0 3 0 0 0 0 4 0 0 0 5 0 0 0 0 6 0 0 0 7 0 0 0 0 8 0 0 0 0 0 0 0 0 9 0 10 0 0 0 0 0 0 11 0 0 0 0 0 0 0 0 12 0 0 0 0 0 0 0 0
The input (as well as output) providers of Hypercube can be easily extended. See the extensions section for more info.