Click here to Skip to main content
15,922,155 members
Please Sign up or sign in to vote.
1.22/5 (2 votes)
See more: (untagged)
Hi,
I have to represent a (weighted,directed) graph with association-list with keys - vertices of the graph? How can I find the shortest and the "cheapest" path in the graph using BFS algorithm and Dijkstra's algorithm. Can someone help me?
Thank you
Posted
Updated 5-Jan-14 0:21am
v2
Comments
Nelek 4-Jan-14 13:11pm    
Yes... here there are a lot of people that can help. But first... You should explain a problem. As it is, your "question" would mean: Please do my work for me.

1 solution

As a start point: Google

Search BFS[^] bring among others following interesting links:
http://en.wikipedia.org/wiki/Breadth-first_search[^]
http://www.princeton.edu/~achaney/tmve/wiki100k/docs/Breadth-first_search.html[^]
http://www.ics.uci.edu/~eppstein/161/960215.html[^]
ans some videos in Youtube


Search Dijkstra's[^]
http://en.wikipedia.org/wiki/Dijkstra's_algorithm[^]
http://optlab-server.sce.carleton.ca/POAnimations2007/DijkstrasAlgo.html[^]
and some videos in youtube too


Now you have a start point, read the information, investigate a bit more and feel free to come back when you have questions or problems, but don't forget this is the Quick Answers section. It is better and you get faster help if you make 10 concrete questions about concrete problems, than a big question about a "how-to guide"
As addition and for more successfully questions in the future I recommend you to read:
What have you tried?[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900