import java.util.*; import java.io.*; public class AnalyseGraphs { static void readDIMACS(String fname) throws IOException { int[] degree; // degree of vertices int[][] A; // 0/1 adjacency matrix int n; String s = ""; Scanner sc = new Scanner(new File(fname)); while (sc.hasNext() && !s.equals("p")) s = sc.next(); sc.next(); n = sc.nextInt(); int m = sc.nextInt(); degree = new int[n]; A = new int[n][n]; while (sc.hasNext()){ s = sc.next(); // skip "edge" int i = sc.nextInt() - 1; int j = sc.nextInt() - 1; degree[i]++; degree[j]++; A[i][j] = A[j][i] = 1; } sc.close(); int edges = 0; for (int i=0;i