Network Vulnerability
Time limit3sMemory limit512 MB
Given an interval representation of an interval graph, compute for each k the maximum number of connected components left after deleting exactly k vertices.
- Level
Hard8 of 10
- Topics
- Dynamic programming, Intervals, Graph
- Solved
- No attempts yet
Problem
Network vulnerability describes how much network performance drops under disruptions such as natural disasters, element failures, or adversarial attacks. A network is often modeled as a graph, where vertices correspond to nodes and edges to links, so the two terms network and graph are used interchangeably. The connectivity is the minimum number of vertices whose deletion leaves a disconnected graph or a one-vertex graph. It is the most important measure of network vulnerability.
Connectivity captures only part of a graph's resistance to vertex deletion. Many other metrics have been proposed, and the toughness and the scattering number are the most popular. Both rest on the maximum number of connected components left after removing k vertices. Let denote the maximum number of connected components obtained by removing exactly vertices from a graph . Given a graph and a positive integer , computing is computationally intractable.
For some graph classes, such as interval graphs, can be computed in polynomial time. An interval graph is the intersection graph of a family of (closed) intervals on the real line. Two vertices are joined by an edge if and only if their intervals intersect. The family is called an interval representation of the graph. The figure shows an interval graph and its interval representation.
Given an interval representation of an interval graph with vertices, write an efficient program that computes for all . For the representation in figure (b), are 1, 1, 1, 2, 2, 3, 2, 1, respectively.
Input
The first line contains a positive integer , the number of intervals, where . Each of the next lines contains the left and right endpoints of one interval. All endpoints are integers between and , inclusive.
Output
Print one line with numbers , separated by single spaces.

