https://123dok.net/document/zx5351dd-linear-time-algorithm-computing-longest-paths-cactus-graphs.html