I have a Python program that receives a 2D square grid-based data, converts it to a graph, does some transformations and then it should embed the resulting graph back on a grid and output it. Any spatial data (node coordinates, angle between two nodes) except for the edge length is removed. The length of each edge is fixed and equal to 1, meaning that two connected nodes must be neighbour cells. The question is, how to convert the graph, consisting of nodes with some data (those can be easily converted to equivalent cells) and edges, representing the correlation between different nodes, back to a grid, supposing it is planar?
$\begingroup$ $\endgroup$
2 - $\begingroup$ Are you looking for unit-length embedding of rectilinear graphs? I.e. each vertex has degree at most four and the graph can be embedded in the grid with each edge taking length 1? What happens if you just start with any planar drawing? $\endgroup$Ainsley H.– Ainsley H.2025-04-28 21:08:25 +00:00Commented Apr 28 at 21:08
- $\begingroup$ Yes, that's the case. I'm just wondering if there's any special, more optimized solution for my problem that I've missed. $\endgroup$GulgDev– GulgDev2025-04-28 21:13:00 +00:00Commented Apr 28 at 21:13
Add a comment |