The following is a OO implementation of Dijkstra's algorithm with a basic UI as well.
Everything is fully documented so I don't really need to go into details. See the attachments which shows the algorithm determining the fastest route between cities. The UI isn't great but helps provide a quick way of making a Graph. Implementation is contained in the namespace System.Algorithms.Dijkstra.
Underline = It's a member of the object. Bold = It's a type in the namespace.
Graph:
Graph object can Save itself as Xml to a file, and Load from a file as well.
AddVertex - Creates, and adds a Vertex to the Graph.
AddEdge - Creates, and adds an Edge to the Graph.
Calculate - Runs the algorithm on the Graph.
GetPath - Returns the a string that represents the order to take for the shortest path. See the second line of the MessageBox screenshot.
GetDistance - Returns the calculated total distance between the two specified verticies. See the third line of the MessageBox screenshot.
GetVerticies - Returns an array of Vertex objects that form the shortest path.
The other members have documentation so you understand what they do as well.
Vertex:
Can only be created within the Graph object, keeps it clean.
Vertex is basically a location in the Graph.
Key - The string identifier for the Vertex.
Neighbors - Gets the verticies that connect with the instance via an Edge.
Distance - Gets the distance from the initial node. Once the Graph has been calculated this member is populated.
Edge:
Can only be created within the Graph object, keeps it clean.
Edge is basically a definition of distance between two verticies.
Distance - The distance between the two verticies of the Edge object. Not to be confused with the Distance member in the Vertex object.