如何在Graphviz中用大圆点装饰边缘?

如何在Graphviz中用大圆点装饰边缘?,graphviz,Graphviz,我想在一些边的中心有一个大点(或类似的东西)。 下面的代码是我能产生的最好的代码 digraph BDD { ordering = out; splines = true; edge [arrowhead="none"]; node [shape = none, label = "SUM"] 0; node [shape = circle, label = "x"] 1; node [shape = circle, label = "y"] 2; node [shap

我想在一些边的中心有一个大点(或类似的东西)。 下面的代码是我能产生的最好的代码

digraph BDD {
  ordering = out;
  splines = true;
  edge [arrowhead="none"];
  node [shape = none, label = "SUM"] 0;
  node [shape = circle, label = "x"] 1;
  node [shape = circle, label = "y"] 2;
  node [shape = circle, label = "w"] 3;
  node [shape = none, label = "1"] 4;
  node [shape = circle, label = "z"] 5;
  node [shape = none, label = "1"] 6;
  node [shape = circle, label = "y"] 7;
  node [shape = circle, label = "w"] 8;
  node [shape = none, label = "1"] 9;
  0 -> 1;
  1 -> 2;
  1 -> 7 [arrowhead="dot"]; 
  2 -> 3;
  2 -> 5 [arrowhead="dot"];
  3 -> 4 [arrowhead="dot"]; 
  3 -> 4;
  5 -> 6 [arrowhead="dot"]; 
  5 -> 6;
  7 -> 5;
  7 -> 8;
  8 -> 9;
  8 -> 5;
}
这将产生下面的图像,这是不完全正确的,因为点位于边的末端

有谁能为我提供一个解决方案:

编辑1:使用额外节点作为点会产生不可接受的输出

digraph BDD {
  ordering = out;
  splines = true;
  edge [arrowhead="none"];
  node [shape = none, label = "SUM"] 0;
  node [shape = circle, label = "x"] 1;
  node [shape = circle, label = "y"] 2;
  node [shape = circle, label = "w"] 3;
  node [shape = none, label = "1"] 4;
  node [shape = circle, label = "z"] 5;
  node [shape = none, label = "1"] 6;
  node [shape = circle, label = "y"] 7;
  node [shape = circle, label = "w"] 8;
  node [shape = none, label = "1"] 9;
  0 -> 1;
  1 -> 2;
  node [shape = point width=0.1] p1p7;
  1 -> p1p7 -> 7; 
  2 -> 3;
  node [shape = point width=0.1] p2p5;
  2 -> p2p5 -> 5;
  node [shape = point width=0.1] p3p4;
  3 -> p3p4 -> 4; 
  3 -> 4;
  node [shape = point width=0.1] p5p6;
  5 -> p5p6 -> 6; 
  5 -> 6;
  7 -> 5;
  7 -> 8;
  8 -> 9;
  8 -> 5;
}


编辑2:我也可以接受点不完全在中心的图形。它们只能不接触节点,也就是说,如果我可以设置/制作箭头和节点之间的距离,可能就可以了。

您可以制作一个额外的节点(和一条额外的边)来实现这一点

digraph {
    node [shape = circle]
    A
    C
    node [shape = point width=0.2]
    B
    edge [arrowhead=none]
    A -> B -> C
}
产生


编辑:

您可以将图形布局为一个*.dot文件,其中放置了所有节点和边。然后您可以使用您最喜欢的编程语言来读取和修改该文件。还有一些内置的脚本语言我还没有尝试过。最后,使用nop2引擎将修改后的点文件转换为您选择的图像格式。您必须了解如何在贝塞尔样条曲线上放置点。根据文件

splineType
    spline ( ';' spline )*
    where spline    =   (endp)? (startp)? point (triple)+
    and triple  =   point point point
    and endp    =   "e,%f,%f"
    and startp  =   "s,%f,%f"

我们总是有4+3n(0)这在普通示例中有效,但不幸的是,对于真实示例,它会产生不可接受的输出。如编辑问题中所示,有两个非常糟糕的属性。首先,节点之间的线现在由两部分组成,例如y-z不是直的,第二,额外的点会极大地改变节点的秩。在这种情况下,您必须处理wi亲自操作样条曲线。请参阅我的编辑。在我的回答中,有效的4元组定义错误。我修复了这一问题,并添加了直接使用样条曲线切换点的可能性。同样,这是一个可行的解决方案,但在我的方法中不可用。调用graphviz/dot后,我无法操作图形。但是,我接受这一点wer如果没有人提出更合适的解决方案-我将假设使用graphviz/dot不可能做得更好。
x = (x1 + 3*x2 + 3*x3 + x4)/8
digraph { rankdir = LR ranksep=1 nodesep=1 pad=0.5
    node [shape = circle]
    edge [arrowhead=none]
    { rank=same
        A -> B
        B -> C
        A -> C
    }
}
digraph {
    graph [bb="0,0,74.575,252",
        nodesep=1,
        pad=0.5,
        rankdir=LR,
        ranksep=1
    ];
    node [label="\N",
        shape=circle
    ];
    edge [arrowhead=none];
    {
        graph [rank=same];
        A        [height=0.5,
            pos="56.575,234",
            width=0.5];
        B        [height=0.5,
            pos="56.575,126",
            width=0.5];
        A -> B       [pos="56.575,215.75 56.575,191.88 56.575,168.01 56.575,144.14"];
        C        [height=0.5,
            pos="56.575,18",
            width=0.5];
        A -> C       [pos="44.02,220.46 24.619,197.84 -9.2417,150.66 2.5745,108 10.795,78.323 31.695,48.606 44.952,31.836"];
        B -> C       [pos="56.575,107.75 56.575,83.878 56.575,60.01 56.575,36.141"];
    }
}
        A -> C       [pos="44.02,220.46 24.619,197.84 -9.2417,150.66 2.5745,108 10.795,78.323 31.695,48.606 44.952,31.836"];
U1 [shape=point width=0.2 color=red pos="2.5745,108"]
X1 [shape=point width=0.2 pos="11.59,171.75"]
X2 [shape=point width=0.2 pos="21.87,65.08"]
digraph {
    graph [bb="0,0,74.575,252",
        nodesep=1,
        pad=0.5,
        rankdir=LR,
        ranksep=1
    ];
    node [label="\N",
        shape=circle
    ];
    edge [arrowhead=none];
    {
        graph [rank=same];
        A        [height=0.5,
            pos="56.575,234",
            width=0.5];
        B        [height=0.5,
            pos="56.575,126",
            width=0.5];
        A -> B       [pos="56.575,215.75 56.575,191.88 56.575,168.01 56.575,144.14"];
        C        [height=0.5,
            pos="56.575,18",
            width=0.5];
        A -> C       [pos="44.02,220.46 24.619,197.84 -9.2417,150.66 2.5745,108 10.795,78.323 31.695,48.606 44.952,31.836"];
        B -> C       [pos="56.575,107.75 56.575,83.878 56.575,60.01 56.575,36.141"];

        U1 [shape=point width=0.2 color=red pos="2.5745,108"]
        X1 [shape=point width=0.2 pos="11.59,171.75"]
        X2 [shape=point width=0.2 pos="21.87,65.08"]
    }
}