Hard tree problem

Revision en1, by Tempe5t, 2022-12-24 11:22:00

Hey, I've been trying to solve the following problem and I have no idea how to go further.

You are given 2 weighted undirected trees $$$T_1$$$ and $$$T_2$$$ such that both trees have $$$n$$$ vertices. You have to find the pair of vertices $$$(v, u)$$$ such that the value of $$$f_1(v, u)+f_2(v, u)$$$ is minimal where $$$f_i(v, u)$$$ is the maximum weight on edge on the path from $$$v$$$ to $$$u$$$ in $$$i$$$-th tree (only output the minimal value, no need to output vertices).

$$$n \leq 10^6$$$ and $$$w_i \leq 10^9$$$ (where $$$w_i$$$ is weight on $$$i$$$-th edge)

I thought about converting those trees to Line trees and then doing some D&C but it doesn't seem to work and I have no idea how to go further. I'm rather looking for some hints than a whole solution. Thanks in advance!

Tags graphs, tree

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Tempe5t 2022-12-24 11:22:00 804 Initial revision (published)