I have a question. In my homework I was assigned the following question:
Given a connected graph in which the degree of all vertices is 2, prove that this graph is a cycle. (Prove that there is a cycle in the graph that passes through all the vertices and edges).
My question is - isn't that obvious? I mean, I can't think of an example in which an Euler circuit doesn't pass through all vertices.
What am I missing? Could someone give me an example of an Eulerian graph that is not a cycle?
EDIT: The question itself was answered, I would appreciate an example of an Eulerian graph that is not a cycle
If a graph has 1 vertex with degree 2, the vertex has a self-loop edge back to itself. So the graph is a cycle graph.
Assume any connected graph with $k$ vertices, each vertex having degree 2, is a cycle graph, for some $k\ge 1$.
Consider connected graph $G$ with $k+1$ vertices, each vertex having degree 2.
Form graph $G'$ by removing a vertex $v$ and its neighbouring edges $e_1(v, v_1)$ and $e_2(v,v_2)$ from $G$.
The removed vertex and edge does not loop back into itself, i.e. $e_1\ne e_2$, because there are $k$ more vertices and the original graph is connected.
Join the original neighbour(s) of $v$ together with a new edge $e'(v_1,v_2)$; the graph $G'\cup \{e'\}$ is still connected, has $k$ vertices and each vertex now has degree 2. By assumption, this graph is a cycle graph.
In particular, in this cycle graph there are exactly two paths (each with distinct intermediate vertices and edges) from $v_1$ to $v_2$: one such path is obviously just $v_1, e', v_2$, and the other path goes through all vertices and edges of $G'$.
Breaking $e'$ and putting $v, e_1$ and $e_2$ back, there are still exactly two paths from $v_1$ to $v_2$, one being $v_1,e_1,v,e_2,v_2$, and one going through all vertices and edges of $G'$.
So the original graph $G = (G'\cup \{e_1,v,e_2\})$ with $k+1$ vertices is also a cycle graph.