Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

syotos Group Title

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...

  • one year ago
  • one year ago

  • This Question is Closed
  1. bwCA Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    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

    • one year ago
  2. syotos Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Thanks.I'm still trying..

    • one year ago
  3. bwCA Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    looks like the digraph is missing a start or end node - line 112,113 of the first paste

    • one year ago
  4. syotos Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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()?

    • one year ago
  5. bwCA Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    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/

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.