Double Clique
Time limit2sMemory limit512 MB
Count the subsets S that are cliques in G while the remaining vertices have no edges among them in G, modulo 1e9+7, for a graph with up to 2e5 nodes.
- Level
Medium7 of 10
- Topics
- Graph, Combinatorics, Implementation
- Solved
- No attempts yet
Problem
You are given an undirected graph with nodes and edges. The set of vertices is and the set of edges is .
Let the complement of be . The complement has all the same nodes, but if there is no edge between nodes and in , then has an edge between and . If has an edge between and , then has no edge between them.
A clique is a subset of nodes where every pair has an edge. A subset of nodes is a double clique if is a clique in and is a clique in . The empty set counts as a clique.
Given the graph, count the double cliques modulo .
Input
The first line has two integers and (). Each of the next lines has two integers and (), meaning there is an edge between nodes and . All edges are unique.
Output
Print a single integer, the number of double cliques modulo .