问题
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