Hello, I do not have much information to go on however, I’m assuming your directed graph will contain ONLY straight lines and circles.
Your problem is how do you detect a circle automatically right?
Well think of it like this. A circle is a just shape with a closed border. This lends itself a useful property, a property closely linked to the flood fill function used in any good paint utility.
If I draw the outline of a circle or for that matter any other closed polygon, I am able to apply the flood fill algorithm on that shape. If the user clicks on the inside of the shape the flood fill algorithm recursively fills that shape. So effectively, wherever the user clicks on the screen - and the flood fill algorithm has been successful, must mean the user has clicked on a circle. Of course no other bounded shapes exist other than the circle.
I’ve not had time to think about it but that would be my best guess. Good luck.