Graphviz如何控制边缘

Graphviz how to control the edges

screenshot。我正在寻找右侧的图表,但我得到的是左侧的图表。我是 Graphviz 的新手。我还必须制作节点 1 和 2,因为我无法模仿右侧的图像。我的终端形状也不完全相同。有人帮我这个。到目前为止我的代码:

digraph M
{
  style=filled;
  graph [splines = headport];

  START->1
  1->"Is COUNT\nan even\nnumber?"
  "Is COUNT\nan even\nnumber?"->"SUM = SUM +\nCOUNT" [label=TRUE]
  "SUM = SUM +\nCOUNT"->2
  "Is COUNT\nan even\nnumber?"->2 [label=FALSE]
  2->"COUNT = COUNT+1"
  "COUNT = COUNT+1"->"IS COUNT >\n20"
  "IS COUNT >\n20"->1 [label=FALSE]
  "IS COUNT >\n20"->STOP[label=TRUE]


  "Is COUNT\nan even\nnumber?"[shape=diamond]
  "SUM = SUM +\nCOUNT"[shape=rectangle]
  "IS COUNT >\n20"[shape=diamond]
  "COUNT = COUNT+1"[shape=rectangle]
  1[shape=circle]
  2[shape=circle]
  START[shape=record, style="rounded"]
  STOP[shape=record, style="rounded"]
}

我对你的图表做了一些修改,让你更接近。 Polylines for splines 并更改了 1 和 2 节点的属性,使其更接近您的目标。显然不完美,但希望能更好地帮助和建议您可以在不进行重大重新设计的情况下进一步改进它的其他方法。

digraph M
{
  style=filled;
  graph [splines = headport splines=polyline];

  START->1
  1->"Is COUNT\nan even\nnumber?"
  "Is COUNT\nan even\nnumber?"->"SUM = SUM +\nCOUNT" [label=TRUE]
  "SUM = SUM +\nCOUNT"->2
  "Is COUNT\nan even\nnumber?"->2 [label=FALSE]
  2->"COUNT = COUNT+1" 
  "COUNT = COUNT+1"->"IS COUNT >\n20"
  "IS COUNT >\n20"->1 [label=FALSE tailport=e]
  "IS COUNT >\n20"->STOP[label=TRUE ]


  "Is COUNT\nan even\nnumber?"[shape=diamond]
  "SUM = SUM +\nCOUNT"[shape=rectangle]
  "IS COUNT >\n20"[shape=diamond]
  "COUNT = COUNT+1"[shape=rectangle headport=n]
  1[shape=point size="0,0" label=""]
  2[shape=point size="0,0" label=""]
  START[shape=record, style="rounded"]
  STOP[shape=record, style="rounded"]
}