Graphviz Issue Tracker - graphviz
View Issue Details
0002588graphvizOtherpublic2016-01-18 03:022016-02-09 14:16
Georacer 
 
normalimportantalways
newopen 
Ubuntu14.04
2.36.0
0002588: Mulitple duplicate node bug
I have programmatically generated the attached large .dot file.

I compile it under Linux with

dot -Tps mygraphmatched.dot -o mygraphmatched.ps

However, the last declared node gets duplicated multiple times in the resulting graph (white circles in the linked .ps image, with label "res_582").
(https://dl.dropboxusercontent.com/u/8286935/mygraphmatched.ps [^])

I have tried dot, sfdp, fdp, twopi.

I suspect a bug in the dot compiler, but a second opinion wouldn't hurt.

Thanks in advance!

P.S. I removed all the individual node descriptions regarding label and then merged node declarations into the resulting 5 different node type groups (regarding shape and fillcolor). This resolved the issue of duplicate nodes appearing, but I lose the individual label functionality, which was useful to me.
In an Ubuntu terminal:

dot -Tps mygraphmatched.dot -o mygraphmatched.ps
No tags attached.
dot mygraphmatched.dot (26,357) 2016-01-18 03:02
http://www.graphviz.org/mantisbt/file_download.php?file_id=497&type=bug
dot mygraphmatched3.dot (18,248) 2016-02-09 14:01
http://www.graphviz.org/mantisbt/file_download.php?file_id=500&type=bug
Issue History
2016-01-18 03:02GeoracerNew Issue
2016-01-18 03:02GeoracerFile Added: mygraphmatched.dot
2016-01-18 08:41northNote Added: 0001015
2016-01-18 09:16GeoracerNote Added: 0001016
2016-02-09 13:59ellsonNote Added: 0001028
2016-02-09 14:01ellsonFile Added: mygraphmatched3.dot
2016-02-09 14:16GeoracerNote Added: 0001029

Notes
(0001015)
north   
2016-01-18 08:41   
The sample graph has a long series of statements of the form:

    node [shape = box, fillcolor = cyan, style = filled, label="keq4
    34"]; keq4;
    node [shape = box, fillcolor = cyan, style = filled, label="keq5
    39"]; keq5;
ending in
    node [shape = circle, fillcolor = white, style = filled, label="res_582
    753"]; res_582;

Each statement sets the defaults for all new nodes, but only makes one node,
except the last one sets the defaults for all other nodes created afterward.
I think the intent was just to make one node and set its attributes, like this
    keq4 [shape = box, fillcolor = cyan, style = filled, label="keq4
    34"];
    keq5 [shape = box, fillcolor = cyan, style = filled, label="keq5
    39"];
....
    res_582 [shape = circle, fillcolor = white, style = filled, label="res_582
    753"];

I don't have time to investigate further but this is almost certainly what went wrong,
not a bug in the graph parser.
(0001016)
Georacer   
2016-01-18 09:16   
Thank you for your time, north.
Indeed, I may not have used the best coding. I have switched to your proposed notation and the problem does not occur anymore.

I don't understand the cause of the problem, i.e. if I used bad syntax. However, from my point of view, this ticket is solved.

If anyone else sees something more in this and wishes to investigate further, I'm willing to provide more info.
(0001028)
ellson   
2016-02-09 13:59   
Sounds like you have this solved. Just wanted to add that you can use "node" in "subgraphs" to set common attributes, and still use individual attributes. I'll attach a more concise version of your graph using this technique,
(0001029)
Georacer   
2016-02-09 14:16   
Thanks for the hint!