Given a topology and a certain node X, find the shortest path tree
with X as the root.
* Input: a topology file similar to the following (which is a three-node
ring)
--------------------------------------------
Nodes: (3) // there are three nodes (node 0, 1 and 2)
Edges: (3)
ID node node cost
0 0 1 100 // there is an bidirectional edge between
node 0 & 1, the edge ID is 0, and the cost is 100
1 1 2 50
2 2 0 100
--------------------------------------------
* Output: Description of the tree as following, the order should be
based on breadth-first search
0(0) 1(0) 2(0)
where A(B) means the parent of node A is node B
* Requirements:
- Use standard C++
- Use of Dijkstra's algorithm is required when finding shortest paths
- No GUI
- Platform independent (can be compile under both Windows and Linux)
- The code must be compilable
- Use of STL is recommended (but not required)
- Use of class is required