Sort Nodes in LayeredDigraph Layout

I have a LayeredDiagraph layout structure of my organizational chart, and each node can have multiple childs of different catergory. I want to sort the child nodes according to category or name. Is there any way to do so?

Thanks.

LayeredDigraphLayout is designed to reorder the nodes in each layer in order to reduce the number of link crossings.

If your graph is tree-structured – that is each node has at most one “parent” node – then you should use TreeLayout, which has explicit support for sorting each parent node’s children. Set TreeLayout.sorting and TreeLayout.comparer.