I'll assume you are talking about debugging a PG problem (as opposed to something with the webwork2 engine or the pg engine).
This helps a lot:
http://webwork.maa.org/pod/pg_TRUNK/macros/PGinfo.pl.html
In your example, I don't know what kind of thing $graph is, or what GR_isHamiltonianCircuit_graph_vertices is, but
\{pp( $graph ) \}
or
\{pp( GR_isHamiltonianCircuit_graph_vertices( $graph, ) ) \}
might be revealing.
WeBWorK Main Forum
Favorite debugging techniques
This forum has a limit to the number of forum postings you can make in a given time period - this is currently set at 10 posting(s) in 1 day