#P12371. Maximum Clique and Independent Set in an Undirected Graph
Maximum Clique and Independent Set in an Undirected Graph
Maximum Clique and Independent Set in an Undirected Graph
Given an undirected graph \(G\), you are required to compute the following:
- One maximum clique of \(G\).
- The number of maximum cliques in \(G\).
- One maximum independent set of \(G\).
- The number of maximum independent sets in \(G\).
A maximum clique is defined as a largest complete subgraph of \(G\), where a complete graph is one in which every pair of vertices is connected by an edge. A maximum independent set is defined as a largest set of vertices in \(G\) such that no two vertices in the set share an edge.
inputFormat
The first line contains two integers \(n\) and \(m\) \( (1 \leq n \leq 20)\) representing the number of vertices and edges, respectively. The vertices are numbered from 1 to \(n\).
Each of the next \(m\) lines contains two integers \(u\) and \(v\) which indicate that there is an undirected edge between vertex \(u\) and vertex \(v\).
outputFormat
Output four lines:
- The vertices (in increasing order) of one maximum clique of \(G\), separated by a single space.
- The number of maximum cliques in \(G\).
- The vertices (in increasing order) of one maximum independent set of \(G\), separated by a single space.
- The number of maximum independent sets in \(G\).
sample
3 3
1 2
2 3
1 3
1 2 3
1
1
3
</p>