I a trying to extract nodes from a network model as shown in the attached diagram.
The algorithm I am using is to select a node eg 8 and move along the lines to the nodes 9, 31, 30, 26, 15 to get the loop.
During this I am checking that if in a loop like 8, 9, 10, 16, 32, 31, 30, 26, 15 any two of the nodes 31,9 are connected then the loop is discarded.
But now I have a problem in 8, 9, 10, 16, 32, 35, 34, 33, 30, 26, 15 no two nodes are directly connected so the loop is not discarded.
How do I incorporate the exclusion of this last loop in my algorighm? Or is my algorithm not good for this type of work? In which case, what should be the approach?