Render graph as svg instead of png
SVG is a vectorized format.
This allows a much better rendering of the picture when you zoom in it (needed on large graphs).
It's easy to get SVG files but when you render them in PDF an ugly black border is added. See this thread to get the details.
The issue comes from graphviz tool used to generate graph. See the following issue graphviz/graphviz#1863