Minimize pairwise connectivity after removal of a node

Revision en3, by tahuruzzoha, 2023-11-11 15:27:34

Problem: You are given an undirected connected graph and a set of Q queries. Each query involves removing a vertex 'v' from the graph. After removing vertex 'v', the subtree of 'v's child is disconnected from the rest of the graph and is treated as a separate component. For each such component, calculate the value v(v-1)/2, where v is the count of vertices in that component.

The goal is to minimize the pairwise connectivity after removing each node. The pairwise connectivity is the sum of v(v-1)/2 for all components resulting from the removal of the node 'v'.

Input: A connected undirected graph with nodes (vertices) and edges. Q queries, each specifying a vertex 'v' to be removed.

Output: For each query, output the minimum pairwise connectivity after removing the specified vertex 'v' according to the rules defined above.

Constraints: The number of nodes (vertices) in the graph is less than or equal to 20^5. The number of queries is less than or equal to 20^5. Queries are independent of each other.

Example: Input: Graph: {1-2, 1-3, 2-4, 2-5, 3-6} Queries: Q1(1), Q2(2), Q3(3)

Output: After removing vertex 1: Pairwise connectivity = 4 After removing vertex 2: Pairwise connectivity = 4 After removing vertex 3: Pairwise connectivity = 2

Note: The provided example is for illustration purposes only and may not represent the actual solution to the problem. The actual solution depends on the specific structure of the given graph and queries.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English tahuruzzoha 2023-11-11 15:27:34 10
en2 English tahuruzzoha 2023-11-11 15:24:29 1271
en1 English tahuruzzoha 2023-11-01 21:00:19 725 Initial revision (published)