Link to home
Start Free TrialLog in
Avatar of List244
List244

asked on

C++ Graphs (Logic)

Please do not post links, code, algorithms, or copy another reference unless directly related to my question. I am looking to understand a certain aspect, and this aspect only.

I am trying to fully understand graphs in C++. I am trying to understand how to get the shortest distance from point A in a graph to point B. However, let's say our graph is a graph of a city, or country, or bigger. Now if we want to get the shortest distance from point A to point B we have a problem. The problem is that there are billions of streets and different ways to go and the user wants a response quickly, what can we do?

Do graphs have to be created in a way that basic assumptions can be made? For example south-west to north-east, would you want to assume north over south west over east?

Can you ever get THE shortest way or do you have to settle?

I think from this you can understand where my confusion lies, I do not require specific answers to specific questions, simply see my confusion and guide me if you can, please.
ASKER CERTIFIED SOLUTION
Avatar of itsmeandnobodyelse
itsmeandnobodyelse
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of List244
List244

ASKER

So then, what is the most common usage for a graph and why?
The following is a link to "Graphs and their Uses", a book by Oystein Ore, on Amazon.com for $27.30 (used $9.94). It is well worth the reading and will provide answers to your questions much better than any dialog on this forum.

http://www.amazon.com/Graphs-their-Uses-Mathematical-Library/dp/0883856352#noop
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you google for "shortest path problem C++" you got a lot of solutions, e. g. at

http://ds4beginners.wordpress.com/2006/12/17/code-2-for-dijkstras-shortest-path-algorithm-in-c/