which algo to use? graph theory...

This is a discussion on which algo to use? graph theory... within the C++ Programming forums, part of the General Programming Boards category; OK, so I have this assigment that I unfortunately have a late start on...the description could be found HERE
As ...

which algo to use? graph theory...

OK, so I have this assigment that I unfortunately have a late start on...the description could be found HERE

As you can see, the very last instruction says that we have to develop our own data structure.

I want to keep this within decent runtimes so I was thinking of using the Depth first search algo for most of the operations...I'm not sure, however, if that is the best option. Any thoughts? suggestions?

for your data structure, I would suggest a linked list of vertecies in the graph, each of which would also contain a linked list to all of its edges. I found that to be the best, especially if you're going to be adding and removing edges/vertices often. If you won't be doing that and you know every vertex has an edge to every other vertex, I'd say use a 2d array.

Doing that though would not let you do any fancy traversals, so using a BSTs instead of a linked lists might be handy for you.

Algorithms on how to find the shortest path's and such; I've blown blood vessels arguing this. It always came down to how often certain situations came to be, and personal preference. To avoid any of that, I'm going to say dabble around and see what you like.

yeah, thats pretty much what I did....I made an adjecencey list that keeps track of vertecies and the edges...the vertecies are ints, but in the file they are strings, so I have a map of string->int, and so far its working...