public void run(String input){
        try{
            String inFileName = input; //first argument on command line (input file)
            File inFile = new File(inFileName);
            Scanner in = new Scanner(inFile);
            RAG rag = new RAG();
            int process = 0;
            int resource = 0;
            String NorR = " ";
            boolean cycleDetected = false;
            boolean errorDetected = false;
            int i = 0;
            while(cycleDetected == false && errorDetected == false && in.hasNext()){
                process = Integer.parseInt(in.next().trim());
                NorR = in.next();
                resource = -1*(Integer.parseInt(in.next().trim()));
                if(NorR.equalsIgnoreCase("N")){
                    rag.needsResource(resource, process);
                    if(i != 0 || i != 2)//Only 2 lines of input cannot have deadlock no need to check
                        cycleDetected = rag.checkForCycleDFS();
                }
                else if(NorR.equalsIgnoreCase("R")){
                    rag.releaseResource(resource, process);
                    //no need to check for cycle
                }
                else{
                    rag.errorOccuredInFormatting();
                    errorDetected = true;
                }
                i++;
            }

            //If no cycle detected 
            if(cycleDetected == false){
                rag.noDeadlock();
            }

        }catch (Exception e){
            e.printStackTrace();
        }
    }