Point Decomposition for Path Counting in Trees

Point decomposition, also known as centroid decomposition, is a powerful technique for efficiently solving path-related problems on trees. By recursively splitting the tree around its centroid, it ensures logarithmic depth of recursion, leading to optimal time complexity for many tree queries. The algorithm follows three core steps: Find the c ...

Posted on Tue, 07 Jul 2026 16:30:43 +0000 by glassroof

Algorithmic Problem Solutions from Competitive Programming Training

Shortest Path DAG and Convex Hull Optimization This problem involves processing a transportation network where we need to compute both the shortest travel time and the maximum possible delay while still arriving on time. Solution Approach First, we construct the shortest path DAG by running Dijkstra's algorithm from the source node. Any edge no ...

Posted on Fri, 19 Jun 2026 17:23:03 +0000 by mamoman