Hello, I have a problem to solve for my studies. Determining the shortest path of a spanning tree using the Jarnik-Prima algorithm.
I write in Java.
I already have some code, but my biggest problem is loading data from the file, because it is given in the following form:
13
2 1 5 2
1 1 3 1 13 2
2 1 4 2 11 3 12 1 13 2
3 2 5 3 11 2
1 2 4 3 6 1 8 2 11 1
5 1 7 4 11 4
6 4 8 3 12 3
5 2 7 3 10 1 11 1
11 1
8 1 11 2
3 3 4 2 5 1 6 4 8 1 9 1 10 2
3 1 7 3
2 2 3 2
- The first line of the In0304.txt file contains the number n ๏N+ denoting the number of vertices.
- The next n lines contain a description of subsequent lists of incidents (the notation "2 1, 5 2" in the second line means that vertex 1 is connected to vertices 2 and 5 by single edges with weights 1 and 2, respectively).
Any suggestions? Thanks!


