使用点语言在 Graphviz 中压缩有向图
我正在尝试实现特定图(对称排列群的凯莱图)的可视化,就像此处所做的那样,但使用 Graphviz 2.28 和 Dot。
(来源:euclideanspace.com)
digraph cayley {
i -> x [color=red];
i -> y [color=blue];
x -> xx [color=red];
x -> xy [color=blue];
y -> yx [color=red];
y -> yy [color=blue];
xx -> xxx [color=red];
xx -> xxy [color=blue];
xy -> xyx [color=red];
xy -> xyy [color=blue];
yx -> yxx [color=red];
yx -> xyx [color=blue];
yy -> yyx [color=red];
yy -> yyy [color=blue];
xxx -> i [color=red];
xxx -> xxxy [color=blue];
xxy -> xxyx [color=red];
xxy -> xxyy [color=blue];
xyx -> xyxx [color=red];
xyx -> xxyx [color=blue];
xyy -> yy [color=red];
xyy -> xyyy [color=blue];
yxx -> yxxx [color=red];
yxx -> xx [color=blue];
yyx -> xxyy [color=red];
yyx -> xyxx [color=blue];
yyy -> yyyx [color=red];
yyy -> i [color=blue];
xxxy -> xxxyx [color=red];
xxxy -> yyx [color=blue];
xxyx -> yyy [color=red];
xxyx -> xxxyx [color=blue];
xxyy -> xyy [color=red];
xxyy -> yxx [color=blue];
xyxx -> xyxxx [color=red];
xyxx -> xxx [color=blue];
xyyy -> xyyyx [color=red];
xyyy -> x [color=blue];
yxxx -> y [color=red];
yxxx -> xyyyx [color=blue];
yyyx -> xxy [color=red];
yyyx -> xyxxx [color=blue];
xxxyx -> xyyy [color=red];
xxxyx -> yx [color=blue];
xyxxx -> xy [color=red];
xyxxx -> yxxx [color=blue];
xyyyx -> xxxy [color=red];
xyyyx -> yyyx [color=blue];
}
My Dot 生成以下布局: 这是一个相当大的布局与上一张图相比。是否有任何 属性 可以将图表压缩得尽可能接近第一个一 ?
I'm trying to achieve a visualization of a specific graph (a Cayley graph of a symmetric permutation group) as the one done here but using Graphviz 2.28 with Dot.
(source: euclideanspace.com)
digraph cayley {
i -> x [color=red];
i -> y [color=blue];
x -> xx [color=red];
x -> xy [color=blue];
y -> yx [color=red];
y -> yy [color=blue];
xx -> xxx [color=red];
xx -> xxy [color=blue];
xy -> xyx [color=red];
xy -> xyy [color=blue];
yx -> yxx [color=red];
yx -> xyx [color=blue];
yy -> yyx [color=red];
yy -> yyy [color=blue];
xxx -> i [color=red];
xxx -> xxxy [color=blue];
xxy -> xxyx [color=red];
xxy -> xxyy [color=blue];
xyx -> xyxx [color=red];
xyx -> xxyx [color=blue];
xyy -> yy [color=red];
xyy -> xyyy [color=blue];
yxx -> yxxx [color=red];
yxx -> xx [color=blue];
yyx -> xxyy [color=red];
yyx -> xyxx [color=blue];
yyy -> yyyx [color=red];
yyy -> i [color=blue];
xxxy -> xxxyx [color=red];
xxxy -> yyx [color=blue];
xxyx -> yyy [color=red];
xxyx -> xxxyx [color=blue];
xxyy -> xyy [color=red];
xxyy -> yxx [color=blue];
xyxx -> xyxxx [color=red];
xyxx -> xxx [color=blue];
xyyy -> xyyyx [color=red];
xyyy -> x [color=blue];
yxxx -> y [color=red];
yxxx -> xyyyx [color=blue];
yyyx -> xxy [color=red];
yyyx -> xyxxx [color=blue];
xxxyx -> xyyy [color=red];
xxxyx -> yx [color=blue];
xyxxx -> xy [color=red];
xyxxx -> yxxx [color=blue];
xyyyx -> xxxy [color=red];
xyyyx -> yyyx [color=blue];
}
My Dot generates the following layout: which is a pretty huge graph compared with the previous one. Is there any attribute that can compact the graph as close as possible to the first one ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我修改了图、节点和边默认属性等代码,使布局尽可能紧凑。也许还有更完美的方法。顺便说一句,节点
i
位于左侧而不是右侧。图像如下所示。
I modified the codes such as graph, node and edge default attributes to make the layout as compacted as possible. Maybe there is a more perfect approach. By the way, the node
i
is located at the left but not right.The image is shown as following.