Traversing the complement graph in linear/near-linear time in multiple ways

This post was originally written on Codeforces; relevant discussion can be found here. In this post, I will focus on the following problem: 920E. More generally, we will look at how to do efficiently traverse the complement graph of a given graph in both dfs and bfs orders. In particular, the bfs order also allows us to find a shortest-path tree of the complement graph. This is my first post, so please let me know of any errors/typos that might have crept in....

August 12, 2021 · 8 min · 1539 words · nor
>