TEXT FORMAT

LGL

LGL (Large Graph Layout format)

LGL (Large Graph Layout) is a plain-text edge-file format used by the Large Graph Layout software, a network visualization and layout package developed in the early 2000s at the University of Texas at Austin in Edward Marcotte's lab, principally by Alex Adai and colleagues. The tool was introduced in a 2004 Journal of Molecular Biology paper describing an algorithm for laying out and exploring very large biological networks, such as protein-function maps. The .lgl file describes the graph's connectivity; LGL's programs then compute 2D or 3D spatial coordinates for interactive viewing.

The format was designed to be extremely compact while remaining human-readable rather than binary. It is line-oriented and groups edges by source vertex: a line beginning with # names a vertex, and each following line names one neighbor connected to it, optionally followed by an edge weight. The weight is a single number that may be negative and may use scientific notation; when omitted it defaults to zero. Vertices are identified by symbolic names (strings), and because names are whitespace-separated, a name cannot itself contain whitespace. A block continues until the next # line begins a new source vertex.

The data model is deliberately minimal. LGL graphs are always undirected, and the specification does not support directed edges, self-loops, or multiple (parallel) edges between the same pair of vertices. There is no notion of typed attributes beyond the single optional per-edge weight, and no vertex-level metadata within the file, which keeps parsing trivial but limits expressiveness compared with richer formats such as GraphML or GEXF.

In the format-conversion landscape, LGL sits alongside other lightweight name-and-weight edge lists like NCOL (also an igraph-native format), Edge List, and Pajek. The igraph library provides direct read and write support through its foreign-graph functions, optionally storing vertex names and edge weights as graph attributes on import and able to skip isolated vertices on export; igraph is therefore the most practical route to convert LGL to or from formats handled by ecosystems such as NetworkX or graph-tool. Note that while igraph will technically accept loops, multi-edges, or directed input when writing LGL, doing so produces files that violate the format's undirected, simple-graph assumptions.

Alternative Names: .lgl

Tools(Read & Write)

Frequently Asked Questions

What is a LGL (Large Graph Layout format) file?

A LGL (Large Graph Layout format) file stores a graph — its nodes, edges and attributes — in the LGL (Large Graph Layout format) format (also: .lgl). See the feature table above for what it supports.

How do I open a LGL (Large Graph Layout format) file?

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

How do I convert a LGL (Large Graph Layout format) file to another format?

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