Hint 4.2.3.1.

Careful: the graphs might not be connected.

in-context