DIMACS (.col, .col.b) Graph Format - Maple Programming Help

Home : Support : Online Help : Programming : Input and Output : File Formats : Formats/DIMACS

DIMACS (.col, .col.b) Graph Format

DIMACS file format

Description

 • DIMACS is a file format for storing a single undirected graph. It is has both text and binary variants.
 • The commands GraphTheory[ImportGraph] and GraphTheory[ExportGraph] can read from and write to the text-based version of this format.
 • The general-purpose commands Import and Export also support this format.

Examples

Import a DIMACS file encoding the Coxeter graph.

 > $\mathrm{coxeter}≔\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left["example/coxeter.col"\right],\mathrm{base}=\mathrm{datadir}\right)$
 ${"C:\Program Files\Maple 2016\data\example\coxeter.col"}$ (1)
 > $G≔\mathrm{Import}\left(\mathrm{coxeter}\right)$
 ${G}{:=}{\mathrm{Graph 1: an undirected unweighted graph with 28 vertices and 42 edge\left(s\right)}}$ (2)
 > $\mathrm{GraphTheory}:-\mathrm{DrawGraph}\left(G,\mathrm{style}=\mathrm{spring}\right)$