{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# V8031l71122252 takenextthingonlist7movetovand

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ’s view” V = {8, 3, 7, 1, 2, 5} L = {4, 6} Take next thing on list (4), move to V, and put it’s neighbors on list if not in V or L yet V = {8, 3, 7, 1, 2, 5, 4} L = {6} Take next thing on list (6), move to V, and put it’s neighbors on list if not in V or L yet V = {8, 3, 7, 1, 2, 5, 4, 6} L = { } DONE Possible to keep track of “level” Li information as you go: Let’s see how. 1: 2,3 2: 1,3,4,5 3: 1,2,5,7,8 4: 2,5 5: 2,3,4,6 6: 5 7: 3,8 8: 3,7 9: 10 10: 9 11: 12 12: 11,13 13: 12 “Computer’s view” Mark 8 as “visited”; put 3 and 7 on the list V={80} L = {31,71} Take next thing on list (3), move to V, and put it’s neighbors on list if not in V or L yet. V = {80, 31} L = {71, 12, 22, 52} Take next thing on list (7), move to V, and put it’s neighbors on list if not in V or L yet V = {80, 31, 71} L = {12, 22, 52} 1: 2,3 2: 1,3,4,5 3: 1,2,5,7,8 4: 2,5 5: 2,3,4,6 6: 5 7: 3,8 8: 3,7 9: 10 10: 9 11: 12 12: 11,13 13: 12 “Computer’s view” V = {80, 31, 71} L = {12, 22, 52} Mark 1 as “visited”; no new neighbors V={80, 31, 71, 12} L = {22, 52} Take next thing on list (2), move to V, and put it’s neighbors on list if not in V or L yet. V = {80, 31, 71, 12, 22} L = {52, 43} Take next thing on list (5), move to V, and put it’s neighbors on list if not in V or L yet V = {80, 31, 71, 12, 22, 52} L = {43, 63} 1: 2,3 2: 1,3,4,5 3: 1,2,5,7,8 4: 2,5 5: 2,3,4,6 6: 5 7: 3,8 8: 3,7 9: 10 10: 9 11: 12 12: 11,13 13: 12 “Computer’s view” V = {80, 31, 71, 12, 22, 52} L = {43, 63} Take next thing on list (4), move to V, and put it’s neighbors on list if not in V or L yet V = {80, 31, 71, 12, 22, 52, 43} L = {63} Take next thing on list (6), move to V, and put it’s neighbors on list if not in V or L yet V = {80, 31, 71, 12, 22, 52, 43, 63} L = { } DONE Shortest paths to each vertex are shown 1: 2,3 2: 1,3,4,5 3: 1,2,5,7,8 4: 2,5 5: 2,3,4,6 6: 5 7: 3,8 8: 3,7 9: 10 10: 9 11: 12 12: 11,13 13: 12 Shortest Path Problem Shortest Path Problem Shortest path ne...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern