While not an algorithm (which is what you asked for) you might want to check out NDepend which performs similar analysis and generates similar diagrams to the one you're after:
(I have no affiliation with NDepend)
While not an algorithm (which is what you asked for) you might want to check out NDepend which performs similar analysis and generates similar diagrams to the one you're after:
(I have no affiliation with NDepend)
It's not always going to be possible to make such a diagram. The (acyclic) dependency relationship:
A depends on X, Y, Z
B depends on X, Y, Z
C depends on X, Y, Z
describes the complete bipartite graph on six vertices, which is non-planar. The consequence of this for the type of diagram you show is that at least one of the areas in your graph must be either split into two separate pieces, and/or at least one of the areas must not connect directly to its dependent.
This problem is avoided by graph-based visualisation (such as graphvis), where edges can cross each other.
The outline of a heuristic algorithm to produce the sort of diagrams you're looking for is as follows:
This won't produce the best graph every time (if such a concept is even well-defined...) but should do a reasonable job for problems like your example.