How to Create a Graph Online and Find the Shortest Path
Updated
You can build a graph in the browser at graphonline.top, run a shortest-path search on it, and export the result as an image — without installing anything. The site supports three input methods (adjacency matrix, incidence matrix, edge list) plus manual drawing, and also runs minimum spanning tree, connected-component, and Eulerian cycle algorithms on the same graph. This walkthrough covers the full path from data entry to reading the shortest-path result, and the errors you are most likely to hit.
Choosing how to enter your graph
The site offers four ways in, and the right one depends on what you already have:
| Input method | Use it when | Format rule |
|---|---|---|
| Adjacency matrix | You have a table of edge weights between vertices | Square matrix, values separated by commas |
| Incidence matrix | You have a vertex-to-edge table | Values separated by commas |
| Edge list | You have a list of connections | One edge per entry |
| Manual drawing | You want to build the graph visually | Add vertex / Connect vertices tools |
If you paste a matrix, it must be square — the site rejects non-square input with "Matrix should be square." For a multigraph, the adjacency matrix holds the weight of the minimum edge between each pair of vertices, so parallel edges collapse to one value in that view.
Building the graph step by step
- Open the graph editor. From the home page, choose "Create Graph," then pick your input method (adjacency matrix, incidence matrix, edge list) or start drawing on the canvas.
- Enter or draw the vertices. On the canvas, use "Add vertex" to place nodes. If you are pasting data, list each vertex on its own line where the interface asks for vertex text.
- Connect the edges. Use "Connect vertices" to link two nodes. For each edge you can set a weight — the edge dialog offers "no weight," a weight of 1, or a custom value, and you can replace the current weight or add a parallel edge (multigraph).
- Label if needed. You can add text above an edge and rename vertices, which helps when the graph is dense.
- Verify the structure. Check the adjacency matrix, incidence matrix, or distance matrix views to confirm the graph matches what you intended before running an algorithm.
Expected result: a rendered graph on the canvas with the vertices, edges, and weights you entered, ready for an algorithm.
Running the shortest path
- Open the Algorithms menu and select the shortest-path option (the site's "Find shortest path" heading points here).
- Choose the start and end vertices for the path.
- Run the algorithm and read the result: the site returns the path and its total distance.
The same graph can then be reused for other algorithms without rebuilding it — minimum spanning tree, connected-component search, and Eulerian cycle are all available from the same menu. That is the main reason to keep one clean graph rather than re-entering data per task.
Saving and exporting
- Save the graph so you can reopen it later; the site confirms with "Graph was saved" and gives you a link.
- Export as an image — either a workspace screenshot or a black-and-white printed image.
- Export to SVG for a scalable vector version.
- Export to / import from a file if you want to move the graph between sessions or machines.
Common errors and how to fix them
"Matrix is incorrect. Use comma as separator." Your values are not comma-separated. Re-paste using commas only.
"Matrix should be square." Your adjacency matrix has a different number of rows and columns. Count the vertices and make the grid match.
"Adjacency Matrix has wrong format." The site offers a "fix matrix" button to repair it, or a "help" button explaining the expected format. Try fix first, then compare against the help example.
"Incidence Matrix has wrong format" / "Edge list has wrong format." Same pattern — use the fix button or the format help.
"The graph is too large for this algorithm." The algorithm has a vertex/edge ceiling. The error message states the limit and your current size. Split the graph or use a smaller subgraph.
"Your browser is not supported." The editor needs a modern browser; switch to an up-to-date version of a mainstream browser.
"Cannot create graph." Usually a downstream effect of one of the format errors above — fix the input format first and retry.
Practical notes
- The site is open source and has a Help page with a tutorial video if the text instructions are not enough.
- There is a "Create algorithm" option where you can paste your own algorithm and run it, and submitted algorithms are sent for review before being added to the site.
- Undo is available with Ctrl+Z, which matters when you are placing many vertices by hand.
- If something breaks, the site lists a contact address ([email protected]) for reporting problems.
For a quick task — say, finding the shortest route between two nodes in a weighted network — the fastest path is: paste an adjacency matrix, confirm it renders, open Algorithms, pick shortest path, choose endpoints, and export the result as SVG.