Get the latest tech news

Biconnected components


Components There are many articles online about graphs and (1-)connected components, but not many about biconnected components (BCCs), even though these are way more interesting and can be used to solve many problems! Especially in competitive programming it is vital to know about this concept. I will outline what biconnected components are, how they work similar to/different from connected components, and how to find them algorithmically (with C++ code included).

In this example, we are definitely doing a lot of unnecessary work, and you might also notice that the final set of pairs has a specific pattern to it (whitespace to make this a bit more obvious). It can be modified to find the edge-biconnected components and even articulation points (which is a concept related to vertex-biconnectedness) in a single pass, but understanding and proving why this works is quite difficult. Tarjan's algorithm performs a standard DFS and computes the \( \mathit{low} \) value for each node, and puts an edge in the bridges set if it meets the condition given in the previous section.

Get the Android app

Or read this on Hacker News