Search code examples
graphvizdotneato

Graphviz egde addition conundrum


I am trying to make images with Graphviz that will illustrate some process that involves adding a few edges to an existing graph. It is crucial that the vertices and edges of the base graph remain in place.

I've tried to add my new edges with [constraint=false] but keep getting different layouts for the base and the new graph, wherever I add more than one edge. Another method I tried with little to show for it was running dot for the graph with all the extra edges and then manually removing the extra lines - still no dice.

The graph I am trying to draw is this:

graph G{
overlap=scale;
node [weight=.2,height=.1];
edge [len=2.1];
3--2 [constraint=false];
4--1 [constraint=false];
5--3 [constraint=false];
6--1 ;
6--2 ;
6--3 ;
6--4 ;
6--5 ;
7--1 ;
7--2 ;
7--3 ;
7--4 ;
7--5 ;
8--1 ;
8--2 ;
8--3 ;
8--4 ;
8--5 ;
} 

Any help will be greatly appreciated.

Solution

  • I think you can try with :

    3--2 [style="invis"];
    4--1 [style="invis"];
    5--3 [style="invis"];
    

    and then :

    3--2 [style="bold"];
    4--1 [style="bold"];
    5--3 [style="bold"];
    

    to show - and emphasis - the new edges.

    The nodes and edges that are invis are not shown but still used to compute the layout.