# Grid graph embedding not being kept after Vertex deletion

I have a grid, and I delete a vertex, while keeping the embedding:

g = GridGraph[{15, 15}];
g = SetProperty[g, VertexCoordinates -> GraphEmbedding[g]];
g = VertexDelete[g, {50}];


Before deleting the vertices, I check their graph embedding:

I check the graph embedding before and after vertex deletion, via the code:

GraphEmbedding[g][[49]]
GraphEmbedding[g][[64]]


The result is that beforehand, the output was "{4., 4.}" and "{5., 4.}". After vertex deletion it is "{4., 4.}" and "{5., 5.}".

For some reason however the embedding is visually the same. Then why is this an issue? I use the following code to draw directed edges of a given graph path:

graphArrow[edge_] :=
Arrow[{GraphEmbedding[g][[edge[[1]]]],
GraphEmbedding[g][[edge[[2]]]]}]
HighlightGraph[g, someData, VertexSize -> Medium,
Epilog -> {Black, Arrowheads[.03],
graphArrow /@ someData}];


The result is that some of the arrows drawn in Epilog look "diagonal", due to this graph embedding artefact. Example:

HighlightGraph[g, 49 -> 64, VertexSize -> Medium,
Epilog -> {Black, Arrowheads[.03], graphArrow /@ {49 -> 64}}]


How can I fix this and correctly draw directed edges?

• I see, you can use PropertyValue[{g, (*vertex*)}, VertexCoordinates] instead of GraphEmbedding[g][[edge[[1]]]] – Kuba Jun 9 '17 at 12:36
• or GraphEmbedding[g][[VertexIndex[g, edge[[1]]]]] – halmir Jun 12 '17 at 14:50