All pastes #439001 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-04-13 23:56 UTC
rendered paste body
		/* read file, instantiate Graph with twice the nodes */
			Scanner in = new Scanner(new File(args[0])).useDelimiter("\\s?#\\s?");
			Graph G = new Graph(2*Integer.parseInt(in.next().trim()));
			
			/* Pi of died before Pj */
			for (String p : in.next().trim().split("\\n"))
			{
				String[] n = _insertNodePair(G, p);
				System.out.println(n[0] + d + " --> " + n[1] + b + "\r\n");
				G.insertEdge(n[0] + d, n[1] + b);
			}
			
			System.out.println("done");