Graphlet - Maple Help

Graphlet (.gml) Graph Format

Graphlet file format

Description

 • Graphlet GML (Graph Modelling Language) is a text-based file format for storing a single directed or undirected graph.
 • 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 Graphlet file encoding the Petersen graph.

 > $\mathrm{Petersen}≔\mathrm{Import}\left("example/petersen.gml",\mathrm{base}=\mathrm{datadir}\right)$
 ${\mathrm{Petersen}}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 10 vertices and 15 edge\left(s\right)}}$ (1)
 > $\mathrm{GraphTheory}:-\mathrm{DrawGraph}\left(\mathrm{Petersen}\right)$

Import a Graphlet file encoding the constellation Draco.

 > $\mathrm{Draco}≔\mathrm{Import}\left("example/draco.gml",\mathrm{base}=\mathrm{datadir}\right)$
 ${\mathrm{Draco}}{≔}{\mathrm{Graph 2: an undirected unweighted graph with 14 vertices and 14 edge\left(s\right)}}$ (2)
 > $\mathrm{GraphTheory}:-\mathrm{DrawGraph}\left(\mathrm{Draco}\right)$

Export the Herschel graph to a Graphlet file in the home directory of the current user.

 > $\mathrm{HerschelG}≔\mathrm{GraphTheory}:-\mathrm{SpecialGraphs}:-\mathrm{HerschelGraph}\left(\right)$
 ${\mathrm{HerschelG}}{≔}{\mathrm{Graph 3: an undirected unweighted graph with 11 vertices and 18 edge\left(s\right)}}$ (3)
 > $\mathrm{Export}\left("herschel.gml",\mathrm{HerschelG},\mathrm{base}=\mathrm{homedir}\right)$
 ${1225}$ (4)