Convert CSV to GraphML with ease

You will get beautiful graphs in just 3 steps!

Step 1. Define an adjacency matrix
  1. Create an adjacency matrix in Microsoft Excel for example.
  2. In the first column you have to describe your node labels.
  3. For readability it is a good practice to have matched the labels in the first row with your first column. Nevertheless they will be omitted internally during conversion process because they are assumed to be the same. This is shown in our example. Instead of writing 1, 2, 3, ... you should repeate the node labels of your first column.
  4. Always the column count has to match the row count.
  5. We create directed graphs (or undirected, see later), so each inner cell will represent an edge between two nodes. If it's empty, no edge will be created. You can insert the text true to create an unlabeled edge, or use any text that will be used as the edge label.

In the presented image next to this description we gave you an example.

Step 2. Export the adjacency matrix to CSV

In this step, you should export the adjacency matrix into a 'comma separated values' (CSV) file you created in the previous step.

Keep care of the characters encoding, which should be 'Unicode UTF-8' at best. This is especially the case, when you use open document editing software like OpenOffice. If you are using Microsoft Excel, or have some bad characters you would probably go with 'ASCII' encoding. The proper encoding needs to be selected above the covnerter drag zone. By selecting 'ASCII', which only supports fixed 128 characters, special characters will be lost.

The generated CSV file can be then dragged into the import section of our converter tool below.
You should not exceed a file size larger than 1 MB, because you will result in an empty graph.

If everything went fine, you will result in a converted GraphML file which you will be offered to download.
The whole converting process is taking place 'in memory' and no external data is stored on our servers.

Step 3. Adjust the converted graph in yEd

Our converted GraphML file is as small as possible, where no styling is applied. So this step is up to you! Layout the components to fit your needs.

  1. When you open the GraphML file in yEd, you will start with a graph, where all nodes are centered and overlapping each other.
  2. At first, you have to make sure, that the nodes' boundaries fit the labels. Do this by clicking on 'Tools' in the menu and selecting 'Fit Node To Labels'. Confirm the dialog with 'OK'.
  3. Lastly you can start with one of the defined layout presets, to align the nodes in a readable way. You can find these presets under the 'Layout' menu. Select one and confirm the application.

You can see the result for our example above in the attached image, where we used the preset 'FlowChart'.

Additionally merge edges (undirected edges)

Sometimes, instead of two you only want one undirected edge (with no arrows).

To do so you have to take care about two things.

  1. For the label from nodes A→B and from B→A, you'll have to enter the same text or true in both cases for an unlabeled edge.
  2. Check the "Merge edges?" checkbox above the converter zone to turn on edge merging functionality.

Advertisement

Convert now

Make sure you read the description above.

Merge edges?
Select encoding: