working code to reconstruct path and compute link contention