Let Gn be the number of graphs with n vertices let Gn be the
Let G(n) be the number of graphs with n vertices, let G+(n) be the number of connected graphs with n vertices, and let G#(n) be the number of cartesian prime graphs with n vertices. Prove that (G,+,#) is a commutative unital semiring
Solution
The degree condition is clearly necessary: a vertex appearing k times in an Euler tour (or k + 1 times, if it is the starting and finishing vertex and as such counted twice) must have degree 2k. Conversely, let G be a connected graph with all degrees even, and let W = v0e0...el1vl be a longest walk in G using no edge more than once. Since W cannot be extended, it already contains all the edges at v. By assumption, the number of such edges is even. Hence , so W is a closed walk. Suppose W is not an Euler tour. Then G has an edge e outside W but incident with a vertex of W, say e = uvi . Then the walk ueviv0e0...el1vl is longer than W, a contradiction.
