# Ortho splines between nodes in subgraphs

**URL:** <https://forum.graphviz.org/t/ortho-splines-between-nodes-in-subgraphs/2741>\
**Category:** Help\
**Created:** [February 17, 2025, 3:25pm UTC](https://forum.graphviz.org/t/ortho-splines-between-nodes-in-subgraphs/2741 "2025-02-17T15:25:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olumide](https://avatars.discourse-cdn.com/v4/letter/o/5fc32e/32.png) [@Olumide](https://forum.graphviz.org/u/Olumide)\
**Post date:** [February 17, 2025, 3:25pm UTC](https://forum.graphviz.org/t/ortho-splines-between-nodes-in-subgraphs/2741/1 "2025-02-17T15:25:10Z")

</div>

I am trying to connect the nodes C at the bottom of in the left cluster/subgraph to the node D at the top of the right cluster as shown in the code below:

```auto
digraph G {
    compound = true
	
	subgraph left_cluster
	{
		subgraph first_cluster{
			A[]
		}

		subgraph second_cluster{
			B[]
		}
		
		subgraph third_cluster{
			C[]
		}
		
		A -> B[style = invis]
		B -> C[style = invis]
	}

	subgraph left_cluster
	{
		subgraph first_cluster{
			D[]
		}

		subgraph second_cluster{
			E[]
		}
		
		subgraph third_cluster{
			F[]
		}
		
		D -> E[style = invis]
		E -> F[style = invis]
	}
	
	//C -> D[splines=ortho]
}

```

Prior to the connection the output looks like this

 ![example](https://global.discourse-cdn.com/graphviz/original/2X/2/2b9ae2d69472daf03b518634e1e41edb46d6334b.png)

Unfortunately the connection stacks both subgraphs as shown below instead of leaving them side-by-side

![example-1](https://global.discourse-cdn.com/graphviz/original/2X/5/5990c280a01cd1c634772b7e2edc30d441a5ba63.png)

The following edit shows what I would like to achieve

 ![example_goal](https://global.discourse-cdn.com/graphviz/original/2X/5/52e5f1092d7731215eb46bc6fdbb8caddf858740.png)

Please advise.

---

<div class="post-metadata">

**Author:** ![steveroush](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@steveroush](https://forum.graphviz.org/u/steveroush)\
**Post date:** [February 17, 2025, 4:06pm UTC](https://forum.graphviz.org/t/ortho-splines-between-nodes-in-subgraphs/2741/2 "2025-02-17T16:06:49Z")

</div>

It is not clear that this graphs _needs_ clusters, but they work. That said:

- cluster names _must_ start with the string _cluster_ (see below)
- the nested subgraphs/pseudo-clusters don’t accomplish anything. I removed
- the **splines** attribute has to apply to the entire graph, not individual edges
- clusters are normally enclosed in a rectangle, **peripheries=0** removes the rectangle

```auto
digraph G {
    //compound = true // not needed for this graph
    splines=ortho // must apply to entire graph
    nodesep=.55 // increase distance between the columns
	subgraph clusterL
	{
		peripheries=0 // do not draw rectangle around the cluster
		A -> B[style = invis]
		B -> C[style = invis]
	}

	subgraph clusterR
	{
		peripheries=0 // do not draw rectangle around the cluster
		D -> E[style = invis]
		E -> F[style = invis]
	}
	
	C -> D [constraint=false] // do not use this edge for ranking
}

```

Giving:

 ![forum2741_1](https://global.discourse-cdn.com/graphviz/original/2X/b/bfe18c6f79b9ea2aa5a17d70bf2ca6030aeed7f0.png)
