Ask your own question, for FREE!
Computer Science 23 Online
OpenStudy (joachim):

I need help to implement a naive solution in Java to the (in)famous travelling sales person problem. For the naive solution I need to: A) Consider city A as the starting point. B) Generate all possible paths from A through all the nodes in the graph and back to A. C) Calculate the cost of the paths and keep track of the minimum cost path. D) Return the minimum cost path.

OpenStudy (joachim):

regarding B: how does one calculate all different paths and store the total cost associated? Such as ABCDA, ABDCA, etc

OpenStudy (woodrow73):

Don't post a file download... try a normal picture

OpenStudy (mathmate):

@joachim @woodrow73 Agree! Personally I don't open downloads.

OpenStudy (joachim):

@mathmate how do I attach a picture? I don't see that option, except "attach file"...

OpenStudy (mathmate):

Indeed, use "attach file" option. A file can have a .jpg or .png suffix, in which case it will show up as a link to a picture.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!