TreeLayout is tolerant of non-tree structure graphs, but depending on the graph you might not like the results. If the graph is sufficiently like a tree, the TreeLayout could be adapted, as for example: Parallel Layout
Alternatively you could use other layouts: GoJS Layouts -- Northwoods Software
It is hard for me to recommend anything when I do not know precisely what you want and what kinds of graphs you will need to handle.