Are GraphViz dot files deterministic?

ぃ、小莉子 提交于 2019-12-09 11:54:40

问题


I am making some GraphViz dot graphs within my source code using Doxygen.

Question: Are the graphs produced by a specific dot file guaranteed to always produce the same output?

Is this the case for different computers, at different times of day, on different architectures, etc?

I am considering using compass points to refine my graph and make it look nicer.

I am wondering if there is any "randomness" to the initial seeding of the graph layout, or any "implementation-defined" portions to the layout engine. I don't want to go to a lot of effort to optimize output for my system, if it won't look the same on others systems. This will be used by both Windows and Mac users. TIA


回答1:


I 've experimenting a lot with different rendering environment like online / cli.

You have a good chance to get different results if you use different graphviz versions. Within a same version I never have had problems of non-deterministics in dot graphs.

Another topic could be, if you use special utf-fonts, which could be rendered on different system different. For e.g. emoji-Flags rendering on windows vs. mac/unix.

Perhaps the wrapper / calling tools like doxygen / understand / pygraph / jgraph / gograph etc. pp. could be a source for different dot-files on different system.

I would state the dot-graph itself is very deterministic within the same version.




回答2:


I believe, by default the graphs produced from graphviz are deterministic because the initial node placement and the solver are such. To generate a different image, The graph attribute 'start' is set to rand.

Ref: https://www.graphviz.org/pdf/neatoguide.pdf



来源:https://stackoverflow.com/questions/15018569/are-graphviz-dot-files-deterministic

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!