TEXT FORMAT

LEDA

LEDA Graph Format

LEDA is the native, human-readable graph serialization used by the Library of Efficient Data types and Algorithms, a C++ library of data structures and algorithms for graph theory and computational geometry originally developed in the 1990s at the Max Planck Institute for Informatics in Saarbrücken. From 2001 to 2023 the library was commercialized by Algorithmic Solutions Software GmbH; since 2024 a free LEDA-7 distribution has been available via the University of Trier. The format stores a single directed or undirected graph in a plain-text file, most commonly with the extension .gw (GraphWin) or .lgr, and is the disk representation that LEDA's own I/O routines read and write.

The base format is strictly line-oriented. The first line is the literal string LEDA.GRAPH, followed by two lines naming the C++ types parameterizing node and edge data (for example void, string, or int). A fourth line gives -1 for a directed graph or -2 for undirected. Then comes an integer count of nodes and one line per node holding its label between |{ and }| delimiters, followed by an integer count of edges and one line per edge listing source node index, target node index, the index of the reversal (twin) edge or 0, and the edge label, again in |{ }| form. The explicit reversal field and the fact that edges are ordered by source node and by adjacency-list position let LEDA reconstruct planar maps and combinatorial embeddings exactly, which is uncommon among graph formats.

The GraphWin (GW) variant extends this base with an optional layout block written by LEDA's interactive editor. It adds global parameters (a GraphWin version tag, window scaling and coordinate bounds, label fonts, index format strings, multi-edge spacing), one attribute line per node (position, shape, border and fill colors, radii, label), and one per edge (width, color, shape such as polygon or bezier or spline, line style, direction, label, and polyline bend coordinates). This makes .gw a combined structural-plus-drawing format akin to how GML, GraphML, or GEXF carry both topology and visual hints.

In the format-conversion landscape LEDA is a niche, tool-specific format tightly coupled to the LEDA/GraphWin ecosystem rather than a broad interchange standard. Its strengths are exact preservation of embeddings and typed labels and a compact, easily parsed grammar; its limitations are the single-graph-per-file restriction, lack of arbitrary key/value attributes beyond one typed label per node and edge, and sparse support in mainstream tooling, so interchange usually routes through more common formats like GML or GraphML. Libraries such as igraph and NetworkX can read or approximate it, and the closely related C++ graph library LEMON draws on similar design goals.

Alternative Names: GW, GraphWin format

File Extensions: .gw
FeatureLEDA Graph Format
Multiple Graphs per Document not supported
Nodes supported
Undirected Edges supported
Directed Edges supported
Hyperedges not supported
Mixed-directionality Edges partial
Parallel Edges supported
Self-loops supported
Edges on Edges not supported
Nested Graphs in Nodes not supported
Nested Graphs in Edges not supported
Nested Graphs in Graphs not supported
Node Labels partial
Edge Labels partial
Attributes on Nodes partial
Attributes on Edges partial
Attributes on Graphs partial
Typed Edges partial

Tools(Read & Write)

Read-only Tools

Frequently Asked Questions

What is a LEDA Graph Format file?

A LEDA Graph Format file stores a graph — its nodes, edges and attributes — in the LEDA Graph Format format (also: GW, GraphWin format). See the feature table above for what it supports.

How do I open a LEDA Graph Format file?

Open it in a graph tool that supports LEDA Graph Format, or convert it to a format your tool reads. With GraphInOut you can convert LEDA Graph Format to GraphML, DOT, Connected JSON and more, right in your browser.

How do I convert a LEDA Graph Format file to another format?

Use the Convert from LEDA Graph Format link above: upload or paste your LEDA Graph Format file (input preset to LEDA Graph Format), choose a target format and download the result — free, no install.