Shortest PathGiven a graph as an adjacency matrix, find the shortest path from the first to the last vertex.
InputN ≤ 100, the number of vertices.
The adjacency matrix - N rows of N numbers.
The first row represents the first vertex, and similarly the last row = the last vertex.
OutputThe distance from the first vertex to the last one.
3 0 1 0 0 0 1 0 0 0
Point Value: 5
Time Limit: 2.00s
Memory Limit: 16M
Added: Jun 28, 2013
- Graph Theory
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3