Optimal Leaf Ordering

Does anyone have a script or component to perform optimal leaf ordering in pipeline pilot?

Thanks! ^_^