DSA Graph Visualizer

Draw a graph — add nodes and connect them with weighted edges, or load one of the course examples. Running the algorithms on it (BFS, DFS, Dijkstra, Prim, Kruskal) comes next.

Build a graph

Minimum spanning trees need an undirected graph; traversals and Dijkstra work with either.

Run an algorithm

A traversal explores the vertices reachable from the start node, in the order the adjacency list gives them.

Click empty space to add a node. Drag a node to move it. Click a node or edge to select it.

Adjacency matrix

Add nodes to see the matrix.

One row and column per vertex; the cell is the edge's weight. Compact for a dense graph — every pair has a slot.

Adjacency list

Add nodes to see the list.

Each vertex lists only the neighbours it actually connects to, with the edge weight in parentheses. Compact for a sparse graph.