最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Algorithm for converting a planar graph represented by a list of faces to a list of points - Stack Overflow

programmeradmin2浏览0评论

The code I am writing is in C#, but pseudocode is also appreciated.

I have a function that generates a list of faces (which is an ordered list of nodes) of a planar graph. So the function signature looks like this

List<List<Node>> GetFaces()

I also have a list of edges (List<Tuple<Node,Node>>) if that help simplify the algorithm.

I need to convert this into a list of Points that is also a planar representation. I don't need the graph to be pretty, just that there is no overlapping edges. I can handle adjusting the graph to have a prettier representation.

Note: I found this question which is nearly a duplicate, but they technically didn't specify that the drawing has to be planar, so the only answer just gives a general algorithm for drawing a graph, which is not helpful for me.

发布评论

评论列表(0)

  1. 暂无评论