pub fn pathwidth_upper_bound(adj: &[Vec<usize>]) -> usize
Pathwidth computation (exact for trees, upper bound for general graphs).