1. 程式人生 > >hdu5876 Sparse Graph(補圖最短路)

hdu5876 Sparse Graph(補圖最短路)

In graph theory, the complement of a graph G is a graph H on the same vertices such that two distinct vertices of H are adjacent if and only if they are not adjacent inG

Now you are given an undirected graph G of N nodes and M bidirectional edges of unit length. Consider the complement of G, i.e., H. For a given vertex S
 on H, you are required to compute the shortest distances from S to all N1 other vertices.