I am a beginner of Java and I would like to import the data of a map with different nodes into java. The data is in a txt file the sample is in below. The first line of graph data is the number of node. Each of following lines contains two integers (a, b) which represent an edge from node $a$
to node $b$
.
Which function or scanner should I use?