0

我想按如下方式绘制图形(梯形轨迹表示): 梯形轨道 即没有节点形状和两个边缘标签:在边缘的头部和尾部。我应该怎么做才能实现这一目标?(14, 15 — 各有两条边的节点)

4

1 回答 1

0

几乎丑陋的解决方案(如果可以提高正确性,请进行编辑):

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"];
} 

这导致

在此处输入图像描述

于 2013-01-24T14:51:04.520 回答