Graph Adjacency List Generator

Generate or convert adjacency lists for graph representations.

Graph input

Accepted formats: A B, A,B, A B 5 (weighted), 1 2, node_1 node_2 1.25. Separators are auto-detected.

How to use

Paste your edges, choose whether the graph is directed or weighted, then click Generate. Switch between adjacency list, JSON, and adjacency matrix using the tabs.

Methodology

From an edge list \(E\), the tool constructs an adjacency list \(Adj(v)\) that stores the neighbors of each node \(v\). For undirected graphs, each edge \((u,v)\) is inserted both into \(Adj(u)\) and \(Adj(v)\). For directed graphs, \((u,v)\) is inserted only into \(Adj(u)\).

The adjacency matrix \(A\) is built over the ordered node set \(V=\{v_1,\dots,v_n\}\) such that \(A_{ij}=1\) if \((v_i,v_j)\in E\) and \(A_{ij}=0\) otherwise. (Weights are displayed in the list/JSON; the matrix shown here is 0/1.)

Full original guide (expanded)

Keep node names consistent. For directed graphs, edge A→B does not imply B→A. For weighted graphs, provide the weight as a third token (e.g., A B 2.5).

Formulas

Adjacency list construction:

\[ Adj(u)=\{v \mid (u,v)\in E\} \quad\text{(directed)} \] \[ Adj(u)=\{v \mid \{u,v\}\in E\} \quad\text{(undirected)} \]

Adjacency matrix:

\[ A_{ij}= \begin{cases} 1, & (v_i,v_j)\in E \\ 0, & \text{otherwise} \end{cases} \]
Citations
Changelog
  • 0.1.1 — 2026-01-28: Hardened parsing, fixed weighted checkbox semantics, and made tab output deterministic (no stale sample JSON).
Verified by Ugo Candido
Last Updated: 2026-01-28
Version 0.1.1