Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002535graphvizOutput Generationpublic2015-03-28 18:142015-03-30 13:54
Reportercleversokol 
Assigned Toerg 
PrioritynormalSeveritynormalReproducibilityalways
StatusresolvedResolutionnot fixable 
PlatformMacOSOS XOS Version10.10.2
Summary0002535: Planar graph is drawn with edges crossed
DescriptionTrying to draw
graph three
{
    subgraph A {
        node1; node2;
        {rank=same node1, node2}
    }
    subgraph B {
        node4; node3;
    }
    node1 -- node2 -- node3 -- node4 -- node1;
    node1 -- node3;
}
and it was quite good. But I wanted it to be square-like(4th node to be some way higher):
node1 -- node2
| \ |
| \ |
| \ |
node4 -- node3
so, I added one string:
graph four
{
    subgraph A {
        node1; node2;
        {rank=same node1, node2}
    }
    subgraph B {
        node4; node3;
        {rank=same node4, node3}
    }
    node1 -- node2 -- node3 -- node4 -- node1;
    node1 -- node3;
}
and I got square-like on four.png
TagsNo tags attached.
AUXILLARY-FILES
DATE-FIXED
FIX-COMMENT
FORMER-ID
INPUT-FILE
OUTPUT-FILE
STATUS-COMMENT
VERSION2.28
Attached Filespng file icon four.png (Attachment missing)
png file icon three.png (Attachment missing)

- Relationships

-  Notes
User avatar (0000917)
erg (administrator)
2015-03-30 13:54

Note that the dot layout does not guarantee you'll get a planar layout even if the graph is planar. One reason is that if there is an edge a -- b and nodes a and b are on the same rank, it will try to keep a to the left of b. In your case, your input specifies node1 to the left of node2 and node3 to the left of node4, so dot can remove the crossing. You can either use node4 -- node3, or remove the constraint:

graph four
{
  {rank=same node1, node2}
  {rank=same node4, node3}
  node1 -- node2 -- node3
  node3 -- node4 [constraint=false]
  node4 -- node1;
  node1 -- node3;
}

- Issue History
Date Modified Username Field Change
2015-03-28 18:14 cleversokol New Issue
2015-03-28 18:14 cleversokol File Added: four.png
2015-03-28 18:15 cleversokol File Added: three.png
2015-03-30 13:54 erg Note Added: 0000917
2015-03-30 13:54 erg Assigned To => erg
2015-03-30 13:54 erg Status new => resolved
2015-03-30 13:54 erg Resolution open => not fixable


MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker