Undirected graph (GraphViz)

An undirected graph uses double dashes instead of arrows. Use it when the relationship genuinely goes both ways, such as network peering or shared ownership.


#What this example shows

  • graph rather than digraph, and -- rather than ->.

  • A layout engine chosen for the shape of the graph.

  • Edge labels carrying capacity.


#A worked example

Open it, edit it, or copy the source below.

Undirected graph (GraphViz)

The source, which you can paste into a new diagram and edit:

graph sites {
  layout=circo;
  node [shape=box, fontname="Helvetica", style=rounded];
  edge [fontname="Helvetica", fontsize=10];

  london -- frankfurt [label="10G"];
  london -- dublin [label="10G"];
  london -- newyork [label="10G"];
  frankfurt -- dublin [label="1G"];
  frankfurt -- newyork [label="10G"];
  dublin -- newyork [label="1G backup", style=dashed];
}

#Making it your own

  • Use graph with -- for undirected; mixing the two forms in one file is an error.

  • circo suits rings and meshes; neato suits general undirected graphs.

  • Draw redundant links differently, or the diagram implies they are equal.



Give it the edges. It does the rest.