TCS / Studies / T-79.4201 / Home Assignments / Thispage
Helsinki University of Technology, 
     Laboratory for Theoretical Computer Science

Graph file format

The file format used for graphs is an extension to the DIMACS graph format found here

A line of the format "p edge " means that the graph is of normal DIMACS format and has nodes and edges with no attributes

A line of the format "c f "" "" means that the graph is of extended format and has node and edges. edgeformat contains attributes that are given in edge lines. For example "id source dest weight" means that edge lines have format giving the label, source and destination nodes, and weight.

A line starting with "c" is a comment line

A line starting with "e" describes an edge. With standard DIMACS format, the line looks like "e " where n1 and n2 are the endpoints. With extended format it has the attributes defined in the edgeformat

Example DIMACS file

p edge 4 5
e 1 2
e 2 3
e 3 4
e 4 1
e 1 3

Example extended file

p edge 4 5 " " "id source dest weight"
e 1 2 4.3
e 2 3 0.2
e 3 4 2.5
e 4 1 5.0
e 1 3 2.1

[TCS main] [Contact Info] [Personnel] [Research] [Publications] [Software] [Studies] [News Archive] [Links]
Latest update: 30 August 2005.