Trac #34952: sage.graphs: Replace imports from sage.*.all for namespace packages
Using `./sage -fiximports` from #34945.
Also remove trailing whitespace in the affected files.
Part of Meta-ticket #32414
URL: https://trac.sagemath.org/34952
Reported by: mkoeppe
Ticket author(s): Alex Chandler
Reviewer(s): David Coudert