private void RunLayoutSubgraph(GraphLayout.Graph graph, bool isGroupLayout)
{
// Select relevant nodes
graph.Nodes.ToList().ForEach(x => x.IsSelected = true);
// Save subgraph position before running the layout
graph.RecordInitialPosition();
// Sugiyama algorithm steps
graph.RemoveCycles();
graph.AssignLayers();
graph.OrderNodes();
// Node and graph positioning
graph.DistributeNodePosition();
graph.SetGraphPosition(isGroupLayout);
// Reset layer information and deselect nodes
graph.ResetLayers();
graph.Nodes.ToList().ForEach(x => x.IsSelected = false);
}