The Kevin Bacon problem, only grosser.