TITLE: Number of even spanning subgraphs
QUESTION [7 upvotes]: An even graph is a graph all of whose vertices have even degree. 
A spanning subgraph $H$ of $G$, denoted by $H \subseteq_{sp} G$, is a graph obtained by $G$ by deleting only edges of $G$.
I want to show that if $G$ is a connected graph, then
$\big|\{H \subseteq_{sp} G | H$ $is$ $even\}\big| = 2^{e-n+1}$, where $e$ is the number of edges and $n$ the number of vertices of $G$.
Can anyone give me a solution or a hint? Thanks in advance!

REPLY [5 votes]: Pick a base vertex $v$.  For any other vertex $w$, pick a path $P(v,w)$ from $v$ to $w$.  $P(v,w)$ exists because $G$ is connected.  
For a spanning subgraph $H\subseteq_{sp} G$, we speak of "flipping an edge $e$" to mean removing $e$ from $H$ if $e\in H$, and adding $e$ to $H$ if $e$ is not in $H$.  This transformation yields another spanning subgraph.  Note that flipping all edges along a path changes the degree of the end vertices of the path by one (provided the path is not a loop), but not any other vertices.
Define an equivalence relation $\sim$ on the set of all spanning subgraphs of $G$ as follows: $H_1\sim H_2$ if $H_2$ is obtained from $H_1$ by flipping all the edges along the path $P(v,w)$ for some $w$.  Thus each equivalence class contains $2^{n-1}$ spanning subgraphs, as we have $n-1$ paths $P(v,w)$ to flip. 
For any spanning subgraph $H$, there is a unique equivalent graph with even degree for all vertices $w\neq v$ (just flip all paths $P(v,w)$ for which $w$ has odd degree).  Call this equivalent subgraph $H'$.  In $H'$, $v$ must also have even degree, because the sum of degrees for all vertices is even (being equal to $2\times\text{number of edges}$), and the sum of degrees of all vertices $w\neq v$ is also even by hypothesis.  Hence, each equivalence class has a unique even spanning subgraph.
There are $2^e$ spanning subgraphs, and thus $2^{e-n+1}$ equivalence classes, and thus $2^{e-n+1}$ even spanning subgraphs.