This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

LEDA (.gw, .lgr)

LEDA graph data format.
Commonly used exchange format for graphs.
Stores a single, typed, directed, or undirected graph.
Plain text format.
Native graph file format of the LEDA graph library and the GraphWin application.
LEDA is an acronym for Library of Efficient Datatypes and Algorithms.
Developed in the 1990s at Max Planck Institute for Informatics Saarbrücken.
  • Import gives a Graph object representing the graph stored in the specified file.
  • Export exports an adjacency matrix or edge information representing a graph to the LEDA format.
  • Import imports the graph from file and returns it as a Graph.
  • Import imports the specified element from a LEDA file.
  • Import imports multiple elements.
  • Export creates a LEDA file by treating expr as specifying element elem.
  • Export treats each as specifying the corresponding .
  • Export exports expr with the specified option elements taken to have the specified values.
  • Export uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
"Elements"list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties, and settings
  • Data representation elements:
"AdjacencyMatrix"edge information, given as a matrix
"EdgeData"edge data, given as a list
"EdgeRules"connectivity data for the graph, given as a list of rules
"EdgeType"edge data type, given as a string
"Graph"graph stored in the file, given as a Graph object
"Graphics"graph stored in the file, rendered as a graph plot
"VertexCount"number of vertices in the graph
"VertexData"vertex data, given as a list
"VertexType"vertex data type, given as a string
  • Import by default uses the element when importing from LEDA.
ImageSizeAutomaticspecifies the overall size of the image to display for a graph
  • When importing from LEDA, all options supported by Graph can be given. Common settings include:
EdgeLabelsAutomaticlabels and label placement for edge
EdgeWeightAutomaticweight for edge
VertexCoordinatesAutomaticcenter coordinate for vertex
VertexLabelsAutomaticlabels and label placement for vertex
VertexShapeAutomaticgraphic shape for vertex
  • When importing as , all options supported by GraphPlot can be given. Common settings include:
DirectedEdgesAutomaticwhether to show edges as directed arrows
EdgeLabelingAutomaticwhether to include labels given for edges
EdgeRenderingFunctionAutomaticfunction to give explicit graphics for edges
VertexLabelingAutomaticwhether to show vertex names as labels
VertexRenderingFunctionAutomaticfunction to give explicit graphics for vertices
DirectedEdgesAutomaticwhether the data to be exported represents a directed graph
  • When exporting from edge rules or from a symmetric adjacency matrix, edges are taken to be undirected by default.
Import a Graph object from a LEDA file:
Show vertex labels in the Graph:
Show the Import elements available for a LEDA file:
Import connectivity rules:
Import the edge and vertex data stored in a LEDA graph file:
Export a Graph to the LEDA format:
Export an asymmetric adjacency matrix of a graph to the LEDA format:
Convert a list of edge rules representing an undirected graph to the LEDA language:
Import a Graph object from a LEDA file:
In[1]:=
Click for copyable input
Out[1]=
 
Show vertex labels in the Graph:
In[1]:=
Click for copyable input
Out[1]=
 
Show the Import elements available for a LEDA file:
In[1]:=
Click for copyable input
Out[1]=
 
Import connectivity rules:
In[1]:=
Click for copyable input
Out[1]=
 
Import the edge and vertex data stored in a LEDA graph file:
In[1]:=
Click for copyable input
Out[1]=
 
Export a Graph to the LEDA format:
In[1]:=
Click for copyable input
Out[1]=
 
Export an asymmetric adjacency matrix of a graph to the LEDA format:
In[1]:=
Click for copyable input
Out[1]=
 
Convert a list of edge rules representing an undirected graph to the LEDA language:
In[1]:=
Click for copyable input
Out[1]=