Any one working on pset11? I wrote some code for "bruteForceSearch",but get error in the idle. p11_src(Details are described between line 38 and 54): http://pastebin.com/iQXPjWfd and for graph.py(include some class def by myself): http://pastebin.com/UGG6fsqC ----------------------------------------------------- I do some test on my code but get even more confused results, addtional info has been added between line 56 and 80.Sorry to bump aggain,this one can really got a rookie like me crazy...
so the traceback tells you exactly what the problem is (lines 47 and 48 of your first paste). that looks like a 'custom' error. you need to find the line of code that says raise ValueError... "Start or end not in graph." and determine what causes it. then work backward from there - that's what make raising errors nice, especially if you put descriptive info in their arguments
Thanks.I'm still trying..
looks like the digraph is missing a start or end node - line 112,113 of the first paste
I print the whole campus map in IDLE.Now i am sure that the 'rode' "32->56"is in my graph,but somehow it looks like the node 32 and 56 is not there. A pretty confusing one,huh? .... I am trying to trace the real problem from line 112 and 113...Maybe the error was raised in the addNode()?
well i didn't try to run it, but it stopped executing because of a ValueError("Start or end not in graph."). How many places in the code can this happen? did you search for the following? raise ValueError("Start or end not in graph.") i think it had to get to that line and then digraph was deficient - maybe add some more info to the exception ... http://dpaste.com/811827/
Join our real-time social learning platform and learn together with your friends!