Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I had to tackle a problem much like this one when analysing the polygons in planar graphs (analysis of planar chemical networks). A fun approach I found was to use a Delaunay triangulation (the dual of a Voronoi diagram; draw the Voronoi polygons and join their centres if they share an edge). Then join the triangles into larger polygons by removing edges that are in the Delaunay triangulation but not in your original planar graph. Once you've got no more edges to remove you've got all the polygons in the graph and convenient triangles for rendering / analysis.

For planar graphs on the surface of a torus, like they faced here, I just ended up adding extra images of the central unit cell, and then removing the excess. Not elegant (lots of weird corner cases) but convenient for visualisation.



Chemistry does ring finding in various ways. I've always liked the SSSR (smallest set of smallest rings) just for the name :)

https://depth-first.com/articles/2020/08/31/a-smallest-set-o...


Unfortunately, as noted in your link, the SSSR solution is not unique. Also unfortunate, Daylight (the inventor of SMILES) added SSSR as an optional atom identifier in their SMARTS query specification without realizing this. Because OpenEye doesn't like SSSR, they actually leave out this feature in their implement of SMARTS, breaking from standard.

https://daylight.com/dayhtml/doc/theory/theory.smarts.html

BTW, there is a very clever algorithm for finding SSSR

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2765087/


Can you expand on what you wanted to analyze? Why didn't you just output the polygons immediately?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: