I am facing a problem that I can't seem to be able to solve, I have a digram of nodes, these node form the shape, as per picture.
The diagram contains 15 nodes. The diagram also has 2 rings. I need to find a solution on which I can find the elements that form a ring in the diagram, So from that diagram I'd get 2 lists of elements {A,Z,B,O,F}, {T,H,R,M,P,F}, each node will be considered a ringelement, while ignoring the rest of the elements that are not included in the rings{ Q,N,C,V }. Keep in mind that for my purposes the diagram will always contain multiple rings.
What I have available is a list of node objects, each node has a property called ConnectedNodes, which is a list containing the nodes connected to it not ordered or anything. Connector nodes {F,P} are connected to 3 nodes. They are sort of shared, they connect to the ring nodes and non ring nodes, while the rest of the nodes are strickly connected to 2 nodes. Can someone please give me ideas, or perhaps suggest alogrithms that might be applied to this problem.
Update:- This is aso valid where you can have more than one ring element as a connector node{V,P,D}. For the updated diagram I now have 4 rings instead of 2 and 4 connector nodes.