Graph find all vertices that are part of a cycle
There is a duplicate question in StackOverflow. I quote the highest voted answer from Craig Gidney here.


  What you want to do is remove all of the Bridges (i.e. edges that disconnect a component when removed). The Wikipedia article gives a linear time algorithm for finding all of the bridges.
  
  Once all the bridges are gone, each node is either isolated (has degree 0) or is part of a cycle. Throw out the lonely nodes, and what's left is the nodes you want.