How to run an algorithm 01 Choose a panel from the tab bar — Traversal, Shortest path, Spanning tree, Order & connectivity, Flow & matching, Metrics & centrality. 02 Build the graph. Pick a preset and press Build, or use Move / connect and click two nodes in turn to toggle an edge; Add node and Delete edit vertices. Type weights in the edge list or adjacency matrix (0 = no edge). 03 Set the algorithm and its inputs — Source for BFS, DFS and Prim; Source and Target for Dijkstra, A* and Floyd–Warshall; Source and Sink for flow; the A* heuristic and PageRank damping. 04 Read the result table. The header names the method and trust level; rows report distances, paths, tree weights, flows or rankings; the canvas colours what the algorithm found. 05 Step and reuse. Animated runs offer Play, Prev, Next and a slider; publish a card or write the adjacency matrix and edge table to the workspace.
Worked examples The default graph is a six-node undirected example: A–B 4, A–C 2, B–C 1, B–D 5, C–D 8, C–E 10, D–E 2, D–F 6, E–F 3. Each readout below comes from the panel.
Panel · algorithm
Input
Readout
Shortest path · Dijkstra
Source A, Target F
Distance 13 ; path A → C → B → D → E → F ; settle order A → C → B → D → E → F
Traversal · BFS
Source A
Visit order A → B → C → D → E → F; max layer 3; 5 tree edges
Spanning tree · Kruskal
the default graph
Total weight 13 ; edges chosen 5 / 9; components 1
Flow & matching · Dinic
Flow network S→T preset
Max flow 19 ; min-cut capacity 19 ; cut edges S→A, B→D
Metrics · Degree / diameter / girth
Petersen preset
10 nodes / 15 edges; diameter 2; radius 2; girth 5; triangles 0
These integer weights keep path and tree sums exact; the flow value is cross-checked against its min cut. BFS measures hops, Dijkstra weight: from A both reach F, but BFS answers 3 and Dijkstra 13. The flow panel cross-checks Dinic against Edmonds–Karp: same 19.
Where the answers stop
Traversal, centrality and PageRank count hops, not weights. The centrality panel warns that centralities use unweighted (hop-count) paths and ignore edge weights. Weighted answers come from the Shortest path, Spanning tree and Flow panels.
The matrix editor hides on large graphs. Past 14 nodes the cell editor is replaced by the paste box, which loads a matrix wholesale. No spectral or symbolic graph work. It does not compute Laplacian eigenvalues, test isomorphism or import graph files; write the adjacency matrix to the workspace and take it to math tools for matrix algebra, to stats for statistical models, or to the scientific calculator for a single expression.
The direction trap The Directed toggle is not one lens over the panels. On the default graph, set Shortest path to Source F, Target A: undirected mode answers 13 along F → E → D → B → C → A . Switch to Directed and the same query answers ∞ with path unreachable , because both edges at F arrive there (D → F and E → F). Switch to Spanning tree with Directed still on and Prim answers unchanged — total weight 13 — with the warning "Input is directed; this algorithm treats it as undirected (edge direction ignored)". Components, cut vertices and bridges, and the bipartite check all read the graph that way; Topological sort refuses undirected mode outright.
Where it fits Teaching shortest paths and traversal Run BFS and Dijkstra on the default graph: BFS reports F at three hops, Dijkstra at 13 weight units, and the slider walks each settle and relax step. Dijkstra refuses negative weights and points to Bellman–Ford in the same panel.
Capacity planning The Flow network S→T preset returns max flow 19, min-cut capacity 19 and cut edges S→A and B→D; the cross-check row confirms Edmonds–Karp reaches 19. On K₃,₃ the Hungarian panel returns a maximum matching of 3 and a minimum vertex cover of the same size.
Ranking and structure On the default graph the highest-betweenness row reads C (2.667), level with D in the per-node rows. PageRank converges in 18 iterations with C and D level at 0.21535. The Petersen preset shows the structural side: ten nodes, fifteen edges, diameter 2 and girth 5.
Privacy All graph editing and computation run in your browser; nothing is uploaded, and your last graph is remembered until site data is cleared.
References
Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein, Introduction to Algorithms , 4th ed., MIT Press, 2022, mitpress.mit.edu (访问日期:2026-10-01)— shortest paths, spanning trees, flow.
Wikipedia, Dijkstra's algorithm , en.wikipedia.org (访问日期:2026-10-01)— relaxation and negative weights.
Wikipedia, Maximum flow problem , en.wikipedia.org (访问日期:2026-10-01)— augmenting paths; max-flow min-cut.
Ulrik Brandes, A faster algorithm for betweenness centrality , Journal of Mathematical Sociology 25(2), 2001, doi.org (访问日期:2026-10-01)— betweenness dependence accumulation.
Wikipedia, PageRank , en.wikipedia.org (访问日期:2026-10-01)— damping and power iteration.
Calculators in this hub
Hand-picked tools, one click away. The mini versions compute live and carry your values into the full calculator.
Sources & review
Reviewed by CalcX Editorial Team
Updated 2026-10-01 Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein, Introduction to Algorithms, 4th ed., MIT Press, 2022 (accessed 2026-10-01) Wikipedia: Dijkstra's algorithm (accessed 2026-10-01) Wikipedia: Maximum flow problem (accessed 2026-10-01) Ulrik Brandes, A faster algorithm for betweenness centrality, Journal of Mathematical Sociology 25(2), 2001 (accessed 2026-10-01) Wikipedia: PageRank (accessed 2026-10-01)