I'm not sure of the terminology. I define a list to be a path where every vertex along the path has precisely two edges, except possibly the starting and ending vertex. In the language of electric circuits, I'm interested in finding all components that are in series for a given circuit. Is there an efficient way of doing this?
My thoughts are something that seems too complex - start at an arbitrary vertex that has not yet been visited. If its degree is 2, then it lies on a list. Move along this list until you find a vertex that has degree 1 or degree > 2 (you've found the end of the list). Move back along the list, marking all vertices along it as visited, and writing down the nodes you've visited until you find the other end. Repeat until you're out of non-visited vertices.
On the other hand, if your initial vertex does not lie on a list, then it is potentially an end point of one. Check the degree of all vertices connected to it. For any of them that have degree 2, continue as above.
This seems drastically inefficient. Is there:
a) A term for such a thing? b) An efficient algorithm for finding them?