I want to draw the graph (ladder track representation) as follows:
i.e. without node shapes and with two edge labels: at head and at tail of edge.
What should I do to achieve this?
(14, 15 — nodes with two edges each)
Asked
Active
Viewed 191 times
0

Tomilov Anatoliy
- 15,657
- 10
- 64
- 169
-
could be impossible to do with Graphviz, but so easy in (for instance) SVG. Why do you require DOT? – CapelliC Jan 24 '13 at 13:58
-
I want to be able to draw graphs from under the `C++` code directly (by means of `boost::graph` library). – Tomilov Anatoliy Jan 24 '13 at 14:22
-
AFAIK boost::graph *doesn't* draw anything. It delegates rendering to Graphviz, *if* you define the appropriate import/export binding. To draw in C++, take a look to (for instance) [CImg](http://cimg.sourceforge.net/). – CapelliC Jan 24 '13 at 14:26
1 Answers
0
Almost ugly solution (do edit if you can improve correctness):
graph G {
rankdir = LR;
node [shape = point];
edge [minlen = 2, fontsize = 8]
a -- b [taillabel = "1", headlabel = "2"];
b -- c [taillabel = "4", headlabel = "15"];
b -- e [taillabel = "3", headlabel = "5"];
e -- d [taillabel = "6", headlabel = "8"];
e -- f [taillabel = "7", headlabel = "14"];
c -- d [taillabel = "15", headlabel = "9"];
f -- g [taillabel = "14", headlabel = "13"];
d -- g [taillabel = "10", headlabel = "11"];
g -- h [taillabel = "12", headlabel = "16"];
}
which leads to

Tomilov Anatoliy
- 15,657
- 10
- 64
- 169