layout helper for edge case in subgraph cycles