Search code examples
graphvizdot

Is there a way to draw B-Trees on Graphviz?


I am trying to generate something similar to this:

https://upload.wikimedia.org/wikipedia/commons/6/65/B-tree.svg

From a btree in memory... is there any way to generate a graph like that on Graphviz, so that I can generate the *.dot file?

Thanks.


Solution

  • Go to http://ysangkok.github.io/js-clrs-btree/btree.html and press "init simple". In the textarea you see Graphviz code for the tree shown above. The algorithm is simple, as you can see.