[Math] How many spanning subgraph of a graph G

graph theory

If I have a graph $\mathbb G$ with $n$ vertices, $m$ edges and $c$ components, how can I count how many spanning subgraphs it has?

Thanks!

Best Answer

The subgraph has to contain all of the vertices. Then decide for each edge whether it belongs to the subgraph or not, giving $2^m$ possibilities.