Skip to content

Dijkstra’s algorithm in C#

I had the pleasure of working with this algorithm one year ago during a project on route planning. Recently I encountered this algorithm again during a course, and decided to do a small implementation of this algorithm along with a graphical interface to use it. Use it for anything you want.

It finds the shortest path from a starting point to all nodes in a graph, but keeps track of how to get there, so if you want to use it for the shortest path between 2 points, simply follow the previous node located in path from the destination point.

http://www.nocture.dk/data/Dijkstra.zip

Categories: Code.

Tags: , ,

Comment Feed

7 Responses

  1. thank you,thank you
    i am working on my thesis for transportation engineering MS degree.
    I am not very good at programming and finding even a small part of my long and troublesome code makes me very happy!
    i require to find shortest path approximately 2000 times in a part of my program to solve my whole network.
    it is ready here!
    thank you…….
    I Love Denmark:)

    shidehJanuary 5, 2010 @ 8:54 AM
  2. Im glad you found it useful! :-)

    - Jeppe

    Jeppe AndersenJanuary 5, 2010 @ 12:44 PM
  3. Thanks, It was useful;)

    MehriMay 10, 2010 @ 6:22 PM
  4. Very nice implemention, clean and effective.

    PedroMay 6, 2011 @ 4:13 PM
  5. Very useful thanks.

  6. hi…

    i am new to c#….i want to ask you what to do after i run the program…i donk know where to put the input data…could you tell me how to run a small example please…

  7. First of all, thank you so much! It’s the most simple implemenation that I’ve seen for C#. But I just didn’t understand how to obtain the shortest path between 2 nodes, could anybody explain me in details? I’m new on programming and need it to do a college work. Thanks in advance.



Some HTML is OK

or, reply to this post via trackback.