# Connecting a vertex to middle of an edge with GraphPlot?

using GraphPlot I'd like to make directed arrow connecting a vertex (node) to the middle of an edge but couldn't find a way. Is this even possible using GraphPlot or other graphics-related commands in Mathematica.

Basically I'd like to plot enzyme-substrate network and so like to connect node E (enzyme) to an edge connecting substrate S to product P, and scale-up for all Enzyme-Substrate-Product combination.

Any help greatly appreciated!!

-
Sounds like you will need to add a new vertex to the graph and connect it to the two nodes of the edge of interest (and to the additional node you mentioned). – DavidC Feb 6 '14 at 16:20
Thanks David, this is exactly what I was doing and it does work but the network looks a bit messy since the new node doesn't line up with S and P on a straight line. Is there a way to force the new node to line up with S and P? – user11898 Feb 6 '14 at 16:56
Normally you can address this through GraphLayout. But for fine control, as I believe you want in the present example, you'll need to also examine the documentation for VertexCoordinates, and VertexCoordinateRules. – DavidC Feb 6 '14 at 17:05
And SetProperties – DavidC Feb 6 '14 at 17:24

This should work.

The initial graph

g = Graph[{"S", "P", "E"}, {"S" \[UndirectedEdge] "P"}, VertexLabels -> "Name",


1. Add the new node.

g1 = VertexAdd[g, "NewNode"]


2. Add 3 new edges.

g2 = EdgeAdd[ g1, {"S" \[UndirectedEdge] "NewNode",
"NewNode" \[UndirectedEdge] "P", "NewNode" \[UndirectedEdge] "E"}]


3. Remove SP edge.

g3 = EdgeDelete[g2, {"S" \[UndirectedEdge] "P"}]


4. Tidy up the graph layout

g4=SetProperty[g3, VertexCoordinates -> {{0, 2}, {2, 2}, {1, 1}, {1, 2}}]


-