Here it says that “patchwork” output has always a square shape: patchwork | Graphviz But to me at least it strongly seems that rectangular shapes with other aspect ratios would be way more general. So I wonder if there are any known workarounds to achive this?
This is an interesting and apparently difficult problem.
Someone asked a similar question in StackOverflow in 2011: algorithm - Treemapping with a given aspect ratio - Stack Overflow
in which it is claimed a general solution does not exist. But we’re just interested in good results, not necessarily optimal or “perfect.”
Behroozi, Mohammadi and Dunne 2022 did some interesting work and might even have code that can be grafted into Graphviz if someone wants to do the work. https://arxiv.org/pdf/2308.16855.pdf. They state, “Our optimization model is able to generate superior treemaps that could serve as a benchmark for comparing the quality of more computationally efficient algorithms” which suggests maybe their approach is not that fast, but maybe it’s fast enough. The abstract says they propose 5 algorithms. They all seem to be $O(N log N)$ so not sure if the constants are large, or what.