Given a connection table (that is, a list of atoms, their connectivities/bonds, and the type of bonds), how can I detect the presence of an aromatic ring?
For reference, the aromatic rings in the structure will always be depicted in Kekule form (alternating single and double bonds).
It is simple enough for me to use a cycle finding algorithm on the graph representing the bonds to find candidates. The problem is now recognizing which of those rings can be aromatic.
A naive approach for at least six-membered carbocyclic rings would be to check if the ring bonds alternate between single and double bonds. But, the structures below would be problematic:
where the center ring in phenanthrene and the six-membered ring in 2H-indene are decidedly aromatic, even if there is no complete alternation of single and double bonds. If you try to check exocyclic double bonds, the leftmost structure could be a false positive.
Pointers to algorithms would be very much appreciated. I am ignoring heterocyclics like thiophene or imidazole, or cations like tropylium for now, but if you know how to handle them too, it would be a nice bonus.
I haven't gotten an adequate explanation of why people thought the question was "too broad"; thus, to restrict the question, here is a drastically short reformulation:
Given a connection table for a molecule that contains any number of six-membered rings (possibly fused, spiro, etc.) and is represented in Kekule form, can one write an algorithm to determine which rings are aromatic and which are not? Atomic coordinates are available if necessary.