该题目的目的是运用Graphs的概念原题如下:
Your task is to implement Dijkstra's algorithm for a graph structure.
为Graph结构 implementDijkstra‘s算法 
The idea is that you create a graph from an input file and then find the length of the shortest paths from a given vertex to all the other vertices. 
从input file中创建一个graph 然后找出已知顶点到其他顶点的长度和最短路径
Your program should then print out the path lengths.
Print出路径长度
Here, the vertices will be integers (int), for simplicity's sake. 
为简化的目的 顶点以整数型给出
You don't need to use a Node or Vertex class (these are just names for the same thing, remember).
不需要实用Node或者Vertex class
 
Dijkstra(G, source) 
for each v in V(G)
   set dist[v] to ∞ (infinity)
   set previous[v] to undefined
dist[source] ← 0
let Q ← V(G)
while Q is not empty
   u ← vertex v in Q with smallest dist[] value
   if dist[u] = ∞
      break
   remove u from Q
   for each neighbour v of u
      let alt ← dist[u] + edge length(u,v)
      if alt < dist[v]
         dist[v] ← alt
         previous[v] = u
return dist[]
For the input graph attached in the file "weightedgraph.png", which could be expressed by the adjacency matrix (assuming 0 means " no edge")  //这儿有张图 可以+我QQ我再传一下~!谢谢!!!
  a b c d e f g h
a 0 2 1 3 5 7 0 0
b 2 0 3 0 0 0 0 0
c 1 3 0 0 0 0 0 0
d 3 0 0 0 0 0 9 0
e 5 0 0 0 0 1 4 0
f 7 0 0 0 1 0 0 3
g 0 0 0 9 4 0 0 0
h 0 0 0 0 0 3 0 0The output should be 
dist[] = [ 0 2 1 3 5 6 9 9 ]就不翻译啦~要是有人愿意帮忙就+我QQ好啦~
QQ 792345273
邮箱就是QQ邮箱555···还有一张图片只有好心人加我我再发给你了~!