← All text tools

Graph algorithms calculator

Enter a graph as an edge list to get the shortest path, minimum spanning tree, Euler or Hamiltonian path, coloring, degrees, adjacency matrix, traversals and a travelling salesman route for small graphs.

  • Free
  • No sign-up
  • Works on any device

About Graph algorithms calculator

Describe a graph as an edge list, for example A B 4 for an edge of weight 4 between A and B, and choose an algorithm. The page finds the shortest path (Dijkstra, or Bellman-Ford when weights are negative), a minimum spanning tree by Kruskal, an Euler path or circuit, a Hamiltonian cycle, a vertex coloring with the chromatic number, degrees and the adjacency matrix, BFS, DFS and tree orders, and a travelling salesman tour for up to 12 vertices. In the default network the shortest route from A to F costs 13 via A, C, B, D, E, F.

How to use Graph algorithms calculator

  1. Type one edge per line: two vertex names and an optional weight.
  2. Tick Directed if the edges are one-way, and enter start and end vertices if the algorithm needs them.
  3. Pick the algorithm and read the answer, the route and the tables.

Why use this tool?

Also known as

Frequently asked questions

Which size limits apply to the graph?

Up to 60 vertices and 400 edges overall. The Hamiltonian search is limited to 15 vertices and the travelling salesman route to 12, because those problems grow very quickly with size.

When does an Euler path exist?

When the edges form one connected piece and either every vertex has even degree (a circuit) or exactly two have odd degree (a path between them). Directed graphs need balanced in and out degrees.

Is the coloring guaranteed to use the fewest colors?

For graphs up to 24 vertices the page searches until it proves the minimum, the chromatic number. For larger graphs it uses a greedy coloring and labels the result an upper bound.

Is Graph algorithms calculator free?

Yes. Graph algorithms calculator on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put Graph algorithms calculator on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.