Harshdeep
Harshdeep

Reputation: 5824

Non-standard notations used for dot language

I was studying a research paper on Graph Grammar Modelling (Model checking). To get a better understanding I started exploring the experiments run by researchers.

They have used dot notation to specify the graph structures and have used attributes such as labelangle=-35 and type = "rt|re|node"

I cannot find any good reference on internet for dot language, none of them start from a perspective of a newbie. When I searched stackoverflow, I got a feeling that there is no standard way of specifying things in dot as several notations have gone obsolete but still exist in literature.

Can someone please explain to me what are the purpose of attributes type or labelangle at least in this context.

Note: Neither type nor labelangle seem to make a difference in graph generated by graphviz.

For example consider the following graph, which has been cited in the detailed description of topology formation on page 58 as bad pattern (do not worry about what bad pattern is, it is something researchers have defined in their paper), created using this dot file:

graph bad_pattern
{
    splines = true;
    node1 [shape=circle, style = filled, width=.15, label = "1", type = "rt"];
    node2 [shape=circle, style = filled, width=.15, label = "2", type = "re"];
    node3 [shape=circle, style = filled, width=.15, label = "3", type = "node"];
    node4 [shape=circle, style = filled, width=.15, label = "4", type = "rt"];
    node5 [shape=circle, style = filled, width=.15, label = "5", type = "node"];
    node6 [shape=doublecircle, style = filled, width=.15, label = "6", type = "re"];

    RouteEntry0 [shape = box, style = filled, label = RouteEntry]
    RouteEntry0 -- node1 [taillabel = 0, labelangle=-35, labeldistance=1];
    RouteEntry0 -- node2 [taillabel = 1, labelangle=-35, labeldistance=1];

    RouteAddress0 [shape = box, style = filled, label = RouteAddress]
    RouteAddress0 -- node2 [taillabel = 0, labelangle=-35, labeldistance=1];
    RouteAddress0 -- node5 [taillabel = 1, labelangle=-35, labeldistance=1];

    RouteNextHopAddress [shape = box, style = filled]
    RouteNextHopAddress -- node2 [taillabel = 0, labelangle=-35, labeldistance=1];
    RouteNextHopAddress -- node3 [taillabel = 1, labelangle=-35, labeldistance=1];

    RouteTable [shape = box, style = filled]
    RouteTable -- node3 [taillabel = 0, labelangle=-35, labeldistance=1];
    RouteTable -- node4 [taillabel = 1, labelangle=-35, labeldistance=1];

    RouteEntry1 [shape = doubleoctagon, style = filled, label = RouteEntry]
    RouteEntry1 -- node4 [taillabel = 0, labelangle=-35, labeldistance=1];
    RouteEntry1 -- node6 [taillabel = 1, labelangle=-35, labeldistance=1];

    RouteAddress1 [shape = doubleoctagon, style = filled, label = RouteAddress]
    RouteAddress1 -- node6 [taillabel = 0, labelangle=-35, labeldistance=1];
    RouteAddress1 -- node5 [taillabel = 1, labelangle=-35, labeldistance=1];

    label = ""
    fontsize=20;
}

Output graph from above dot file

From the understanding I have developed so far, I am not even sure that this graph should be the output of above dot file as edge and node mapping is not the same as specified in dot file and output graph.

Please help.

Upvotes: 1

Views: 352

Answers (1)

Pekka
Pekka

Reputation: 3654

An overview for Graphviz is available at Drawing graphs with dot. The reference to attributes is at Node, Edge and Graph Attributes - Graphviz.

type is not a regular attribute, but the language supports arbitrary user attributes that it carries through for further processing. Perhaps there is a subsequent step in the experiment that uses this - it is not used by the layout engine.

Upvotes: 0

Related Questions