# Graph Algorithm Visualizer > BFS, DFS, Dijkstra, Bellman–Ford, A*, MST, topological sort and SCCs on your edge list. Paste an edge list (weighted or not, directed or not) and run a classic graph algorithm: BFS, DFS, Dijkstra, Bellman–Ford (with negative-cycle detection), A* with node coordinates, Prim or Kruskal minimum spanning tree, Kahn topological sort or Tarjan strongly connected components. Shows every step, the distances and the highlighted path or tree. Part of usefulweb.site (https://usefulweb.site/). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://graphalgorithmvisualizer.usefulweb.site/ (interactive tool at https://graphalgorithmvisualizer.usefulweb.site/tool) - JSON API: POST https://graphalgorithmvisualizer.usefulweb.site/api/v1/calculate with a JSON object of inputs (schema: https://graphalgorithmvisualizer.usefulweb.site/api/v1/tool) - OpenAPI: https://graphalgorithmvisualizer.usefulweb.site/openapi.json - MCP (Streamable HTTP): https://graphalgorithmvisualizer.usefulweb.site/mcp - tool `graph_algorithm_visualizer` ## Inputs - edges (textarea, required): Edges (one per line: from to [weight]) - Formats: "A B 4", "A -> B 4", "A,B,4". A line with one name adds an isolated node. # starts a comment. Max 200 nodes, 2,000 edges. - directed (boolean): Directed edges - algorithm (select): Algorithm - source (text): Start node - Default: the first node. Used by BFS, DFS, Dijkstra, Bellman–Ford, A* and Prim. - target (text): Target node - Optional for searches; required for A*. - coordinates (textarea): Node coordinates (node x y), for A* and layout - A* uses the straight-line distance as heuristic; it is admissible only if no edge is shorter than the distance between its end points. ## Method - Neighbours are visited in the order nodes first appear in your edge list, so every run is deterministic. Undirected edges are usable in both directions. - BFS finds fewest-edge paths; DFS records discovery and finish times. Dijkstra settles nodes in order of distance with a binary heap and refuses negative weights; Bellman–Ford relaxes all edges up to n − 1 times and then checks for a negative cycle. - A* is Dijkstra ordered by g + h with h = straight-line distance between coordinates. It returns optimal paths when h never overestimates (admissible) and is consistent; the tool warns when an edge is shorter than its straight-line length. - Prim grows a tree from the start node (a forest if the graph is disconnected); Kruskal adds the cheapest edges that do not close a cycle (union–find). Kahn's algorithm outputs nodes without remaining incoming edges and detects cycles; Tarjan's algorithm finds strongly connected components in one DFS.