#P5827. Counting Biconnected Labeled Graphs
Counting Biconnected Labeled Graphs
Counting Biconnected Labeled Graphs
Given an integer \( n \), count the number of simple undirected graphs on \( n \) labeled vertices that are biconnected (i.e. the graph is connected and remains connected after the removal of any single vertex). Since the answer can be huge, output it modulo \(998244353\).
Note: A graph with fewer than 2 vertices is not considered biconnected. For \( n=2 \), the only possible connected graph (an edge) is considered biconnected.
Definition: A graph is said to be biconnected if it is connected and for every vertex \( v \), the graph obtained by removing \( v \) (and its incident edges) is still connected (if there are at least 2 vertices remaining).
Constraints: It is guaranteed that \( n \) is small (for example, \( n\le 6 \)) so that a brute force solution which enumerates all \(2^{\binom{n}{2}}\) graphs can run in time.
inputFormat
The input consists of a single integer \( n \) (\( 1 \le n \le 6 \)).
outputFormat
Output a single integer, the number of biconnected labeled graphs on \( n \) vertices modulo \(998244353\).
sample
1
0