"Small" performance improvement

Please bring croissants tomorrow :D

More seriously, don't copy graph in the heuristic, just take a const
reference on it.
[python] add more messages