Graph6 (.g6) Graph Format - Maple Programming Help

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

Graph6 (.g6) Graph Format

Graph6 file format

Description

 • Graph6 is a text-based file format for storing one or more undirected graphs.
 • 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 Graph6 file encoding the Petersen graph.

 > $\mathrm{Petersen}≔\mathrm{Import}\left("example/petersen.g6",\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},\mathrm{style}=\mathrm{spring}\right)$

Export the Clebsch graph to a Graph6 file in the home directory of the current user.

 > $\mathrm{CG}≔\mathrm{GraphTheory}:-\mathrm{SpecialGraphs}:-\mathrm{ClebschGraph}\left(\right)$
 ${\mathrm{CG}}{≔}{\mathrm{Graph 2: an undirected unweighted graph with 16 vertices and 40 edge\left(s\right)}}$ (2)
 > $\mathrm{Export}\left("clebsch.g6",\mathrm{CG},\mathrm{base}=\mathrm{homedir}\right)$
 ${22}$ (3)

References

 McKay, B.D. and Piperno, A., Practical Graph Isomorphism, II, Journal of Symbolic Computation, 60 (2014), pp. 94-112, doi:10.1016/j.jsc.2013.09.003