Graph Adjacency List Generator
Generate or convert adjacency lists for graph representations.
Accepted formats: A B, A,B, A B 5 (weighted), 1 2, node_1 node_2 1.25. Separators are auto-detected.
No graph generated yet.
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).