Random Graph Generator
Create deterministic graph data with nodes and edges: random graphs, spanning trees, directed acyclic graphs (DAGs), weighted graphs, and hierarchies.
Also known as: graph generator · edge generator · network generator
seeded · synthetic data
Presets
Output
About this tool, tips & examples
What it does
The Random Graph Generator produces edge lists for five graph structures: random graphs (with a configurable edge probability), spanning trees, directed acyclic graphs (DAGs), weighted graphs, and hierarchies — up to 100 nodes. Output is a deterministic from–to edge list, optionally weighted, exportable as CSV, JSON, NDJSON, or TSV for import into any graph tool.
Common use cases
- Graph algorithm testing — BFS, shortest path, topological sort, and MST implementations verified against structures with known properties (trees are connected and acyclic; DAGs have no cycles).
- Network simulation — synthetic topologies for routing and epidemic-spread models.
- Visualization development — edge lists for force-directed layouts and dependency diagrams (presets for a small tree, medium DAG, and weighted graph).
- Database testing — graph-shaped data for Neo4j-style stores and recursive SQL queries.
Settings
- Graph Type — random, spanning tree, DAG, weighted, or hierarchy.
- Number of Nodes — 2 to 100.
- Edge Probability — 0 to 1 for random graphs: sparse networks near 0.05, dense near 0.5.
- Add Weights — attach weights for weighted-algorithm testing.
- Seed — identical seed + settings = identical edges.
Privacy note
Graphs are generated locally in your browser and never uploaded — pure synthetic structure, representing no real network or organization.
FAQ
What format is the output?
An edge list — one from–to pair (plus optional weight) per row. It
imports directly into NetworkX (read_edgelist), Gephi, and most graph
libraries.
Are the structural guarantees real? Yes — trees come out connected with exactly n−1 edges, DAG edges only point “forward,” so algorithms with preconditions get valid input. Good material for property-based tests.
How do I pick an edge probability? Around ln(n)/n is the connectivity threshold for random graphs — below it expect disconnected components (also worth testing!), well above it graphs get dense quickly.