Formats/GDF - Maple Help

Home : Support : Online Help : Formats/GDF

GDF (.gdf) Graph Format

GDF file format

Description

 • GDF is a simple text-based file format for storing a graph first used by the GUESS graph visualization software.
 • It also allows the application of labels to vertices and edges.
 • The GraphTheory[ImportGraph] and GraphTheory[ExportGraph] commands can read from and write to this format.
 • The general-purpose commands Import and Export also support this format.

Examples

Import a GDF file encoding a graph.

 > $G≔\mathrm{Import}\left("example/mirzakhani.gdf",\mathrm{base}=\mathrm{datadir}\right)$
 ${G}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 63 vertices and 183 edge\left(s\right)}}$ (1)
 > $\mathrm{GraphTheory}:-\mathrm{DrawGraph}\left(G,\mathrm{style}=\mathrm{spring}\right)$

Export the Dyck graph to a GDF file in the home directory of the current user.

 > $\mathrm{DG}≔\mathrm{GraphTheory}:-\mathrm{SpecialGraphs}:-\mathrm{DyckGraph}\left(\right)$
 ${\mathrm{DG}}{≔}{\mathrm{Graph 2: an undirected unweighted graph with 32 vertices and 48 edge\left(s\right)}}$ (2)
 > $\mathrm{Export}\left("dyck.gdf",\mathrm{DG},\mathrm{base}=\mathrm{homedir}\right)$
 ${437}$ (3)