Adjacency Matrix to Graph Visualizer Online
Paste any square N × N adjacency matrix — binary 0/1 or weighted — straight into Graph Editor. The parser detects matrix dimensions automatically, preserves isolated rows of all zeros, and plots your graph immediately.
How Matrix Auto-Detection Works
| Matrix Type | Behavior | Index Mapping |
|---|---|---|
| Undirected 0/1 Matrix | Reads upper triangle when symmetric to avoid duplicate edges | 1..N (or 0..N-1 with 0-based active) |
| Directed Matrix | Toggle Directed on to emit oriented edge i → j for every non-zero cell |
Row = source vertex, Column = target vertex |
| Weighted Matrix | Non-zero values become edge weights; 0 means no edge |
Supports positive or negative weights |
| All-Zero Rows | Disconnected vertices still appear on the canvas cleanly | Node count equals N rows |
Copy-Ready 5×5 Adjacency Matrix Example
0 1 1 0 0 1 0 1 1 0 1 1 0 0 1 0 1 0 0 1 0 0 1 1 0
Frequently Asked Questions
How do I plot a graph from an adjacency matrix online?
Paste space-separated rows directly into the left editor pane. No header or brackets required — the canvas draws immediately.
What about 3×3 matrices vs 3-column edge lists?
For 2×2 or 3×3 grids, keeping main-diagonal zeros and binary/symmetric entries distinguishes a matrix from a weighted edge list cleanly.
Can I export a matrix back into edge lists or code?
Yes. Click Export to copy clean N M edge lists, C++ vector<pair>, Python adjacency lists, or high-res PNG/SVG diagrams.