# Thread: Hello everyone......Hope you can help

1. ## Hello everyone......Hope you can help

Hi to everyone....i heard about this site and how helpful it is! I am taking a contemporary mathematics class. I will admit my math skills are extremely week ( my 8yr old is smarter than me in this subject). Its been a downfall of mine for over 20years. Any ways i have to create a nearest neighbor algorithm using 5 cities within NYS. I have graphed out the distances and started with a vertex and was able to get 2 distances after that. I just cant seem to do it. My instructor used a decision tree to figure out all his tours. It is not working for me. Any other way in doing this? Please help!
Amityville

250
211
268
30
Canandaigua
250

54
20
224
Corning
211
54

74
183
East Rochester
268
20
74

243
New York City
30
224
183
243

Hi to everyone....i heard about this site and how helpful it is! I am taking a contemporary mathematics class. I will admit my math skills are extremely week ( my 8yr old is smarter than me in this subject). Its been a downfall of mine for over 20years. Any ways i have to create a nearest neighbor algorithm using 5 cities within NYS. I have graphed out the distances and started with a vertex and was able to get 2 distances after that. I just cant seem to do it. My instructor used a decision tree to figure out all his tours. It is not working for me. Any other way in doing this? Please help!
Amityville

250
211
268
30
Canandaigua
250

54
20
224
Corning
211
54

74
183
East Rochester
268
20
74

243
New York City
30
224
183
243

RonL

3. ## Thanks for responding

Amityville

250
211
268
30
Canandaigua
250

54
20
224
Corning
211
54

74
183
East Rochester
268
20
74

243
New York City
30
224
183
243

He used his own destinations
I can plan my tour starting at any vertex, even though I will actually start the trip in Hamden. However, let's begin with Hamden.

Step 4: First I pick the nearest location: Stoughton at 106 miles.

Step 5: Then I pick the location closest to Stoughton without re-visiting a vertex or closing a circuit: Portsmouth at 459 miles.

Repeat Step 5, Steps 6, 7 & 8: Next, I pick Portsmouth's nearest neighbor. That would be Hamden which closes the circuit before I visit Columbus, so I reject that choice. That only leaves Portsmouth to Columbus (421 miles) and
then Columbus to Hamden (536). My tour is: Hamden; Stoughton; Portsmouth; Columbus; Hamden.

Step 9: The total cost for the trip is: 106+459+421+536 = 1522 miles.
Repeat starting at other vertices

This is how my instructor explained how to do it.
[IMG]file:///C:/DOCUME%7E1/Dina/LOCALS%7E1/Temp/moz-screenshot.jpg[/IMG][IMG]file:///C:/DOCUME%7E1/Dina/LOCALS%7E1/Temp/moz-screenshot-1.jpg[/IMG]