OpenersPrimaryExamplesSection(Spacer1)Examples  (5)

OpenersExampleSection0(Spacer1)Basic Examples  (5)

Import a sparse6 example file, giving a visual representation:

Import["ExampleData/sparse.s6"]

Read the adjacency matrix of the above example and render it as (RefLink[MatrixPlot, paclet:ref/MatrixPlot]):

Import["ExampleData/sparse.s6","AdjacencyMatrix"] [[1]] // MatrixPlot

Export a (RefLink[Graph, paclet:ref/Graph]) object to the sparse6 format:

ExportString[PathGraph[Range[10]], "Sparse6"]

Export the adjacency matrix of a graph to the sparse6 format:

ExportString[GraphData["ZamfirescuGraph75","AdjacencyMatrix"],"Sparse6"]

Export edge rules:

ExportString[{1->2,1->3,1->5,2->4,2->6,3->4,3->7,4->8,5->6,5->7,6->8,7->8}, "Sparse6"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {Related Formats:  (RefLink[Graph6, paclet:ref/format/Graph6])  ▪  (RefLink[GraphML, paclet:ref/format/GraphML])  ▪  (RefLink[GXL, paclet:ref/format/GXL])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Importing & Exporting, paclet:guide/ImportingAndExporting])}, {▪(RefLinkPlain[Listing of All Formats, paclet:guide/ListingOfAllFormats])}, {▪(RefLinkPlain[Mathematical Data, paclet:guide/MathematicalData])}, {▪(RefLinkPlain[Mathematical Data Formats, paclet:guide/MathematicalDataFormats])}})}})