/* Rohan Puttagunta August 5, 2009 HOW TO USE: Create a file called "format" (or if you have a different file name, change the file name in the first line of the main) that has your grid. The gird has to be 17 lines long, 17 characters per line and with a "." representing the empty spaces (doesn't matter what the other character are). The program will look at the set of the points marked by a "." and look for large rfree sets withing these points. It will print out all rfree sets it finds larger than "threshhold" which is set near the beginning of the program. The program works by counting the number of rectangles each point is a part of and then removing the point that is in the most rectangles. If there is a tie, it chooses one randomly. It keeps removing points until there are no more rectangles. This process is repeated 100,000 times (takes about 6 minutes to run on my computer). */ import java.io.*; import java.util.*; public class greedy { public static int threshhold=72; public static char[][] rep; public static int size; public static boolean flag; public static void main (String[] args) throws IOException{ BufferedReader in=new BufferedReader(new FileReader("format")); String[] read=new String[17]; for (int i=0; imax){ max=num[i][j]; count=1; } else if (num[i][j]==max) count++; int l=(int)Math.floor(Math.random()*count); boolean flag=true; for (int i=0; i0) end=false; int mult=1; for (int k=0; kthreshhold){ System.out.println(size); for (int i=0; i