Shortest route.

Joined
May 12, 2019
Messages
189
Two questions. What's the shortest route starting at C to visit seven other places? 180+243+222+560+53+(60+60)+224+361 = 1963km
332+222+243+180+361+224+53+196+227=2038km These are the only two that made sense to me so the first one is the shortest am I, right?

and secondly, what's the least amount of distance (close down roads that are not needed) you need for all places being connected.
60+53+196+227+180+243+222+224= 1405km IS this correct?

I'd like to know if my answer are wrong so I no for next time where I went wrong!

Screenshot 2019-11-14 at 8.59.10 AM.png
 
Are you just trying to do this for those seven points, or for any points provided?
Check out Dijkstra's Algorithm and see if that seems to be your problem/challenge. That algorithm might be a higher level than you are going for, but it is a procedure for finding the shortest path from one point to every other.
Edit: Sorry, I realize that is a computer science approach, while common sense will probably work for this problem. Going through it I didn't see any better options than the routes you specified, other than that you probably don't need to go back to C after visiting 7 other points, so you can remove that last 361 from 1963 I think.
 
Last edited:
Are you just trying to do this for those seven points, or for any points provided?
Check out Dijkstra's Algorithm and see if that seems to be your problem/challenge. That algorithm might be a higher level than you are going for, but it is a procedure for finding the shortest path from one point to every other.
Edit: Sorry, I realize that is a computer science approach, while common sense will probably work for this problem. Going through it I didn't see any better options than the routes you specified, other than that you probably don't need to go back to C after visiting 7 other points, so you can remove that last 361 from 1963 I think.
Cheers! The only reason I went back to C was that I had to start there and return.
 
Two questions. What's the shortest route starting at C to visit seven other places? 180+243+222+560+53+(60+60)+224+361 = 1963km
332+222+243+180+361+224+53+196+227=2038km These are the only two that made sense to me so the first one is the shortest am I, right?

and secondly, what's the least amount of distance (close down roads that are not needed) you need for all places being connected.
60+53+196+227+180+243+222+224= 1405km IS this correct?
What have you been taught about solving these problems? Were you taught any particular methods? How are you expected to be sure that your answer is correct?

Also, please state the entire original problem, as we ask you to. You didn't mention in the OP that you were told to return!
 
Floyd

basically you create an adjacency matrix and then you loop through it keeping a running tally of distances . It pretty easy to implement in code
 
No. I guess the most reliable way is to check every route. What would you suggest?
I would suggest something based on your context, if I knew anything about it.

Are you saying you've learned nothing relevant to the question, or was your "no" an answer to something else? Please tell us (even if you've said it in another thread) what you are learning, and how the question is related to that.
 
Top