BufferedReader in = new BufferedReader(new FileReader(file));
String line = "";
while ((line = in.readLine()) != null) {
StringTokenizer t = new StringTokenizer(line," ");
graph.addEdge(t.nextToken(),t.nextToken(),1);
}
in.close();
} catch (Exception io) {
io.printStackTrace();