You are given an undirected graph (social network) in which each edge $e = (v, v')$ has an interval $I_e = [l_e, u_e]$ on it. The meaning is that you know that $v$ and $v'$ met at some point during the interval $I_e$, but have no idea when exactly. You also know that some source node $s$ started with some infectious disease, and that a set $P \subseteq V$ ended up with the disease, while a disjoint set $N \subseteq V$ definitely did not catch the disease. (There may be nodes that are neither in P nor in N.) The disease has the property that when two nodes $v, v'$ meet, one of whom has the disease, it is instantaneously transmitted to the other, who is also immediately infectious. I want a polynomial-time algorithm which when given $G, P, N$ and the $I_e$, either outputs meeting times $t_e ∈ I_e$ for each edge that explain the observations, or correctly concludes that it is impossible that all of $P$ got the disease while no one in $N$ did.
I feel like a way to approach this problem is to start with the subset of P, and check the edges with the latest times in the intervals greedily and relax the time intervals if we need to reach other vertices in P. We then try to tighten the constraints if we are about to hit vertices not in P. What would be an algorithm to tackle this problem?
Source: last problem https://david-kempe.com/CS670/HW1.pdf