private static boolean parseGraphLine_v2(String s, int lineNumber) {

        if (lineNumber == 0) {
            numOfNodes = Integer.valueOf(s);

            graphMatrix = new int[numOfNodes + 1][numOfNodes + 1];

            // Initialize graph matrix structures
            for (int i = 0; i < numOfNodes; i++) {
                for (int j = 0; j < numOfNodes; j++) {
                    graphMatrix[i][j] = INFINITY;
                }
            }
            return false;
        }

        // return true for end of file
        if (s.equals("0")) {
            return true;
        }

        String[] stringArray = s.split("\\s+");
        for (int i = 0; i < stringArray.length; i = i + 2) {
            if (stringArray[i].equalsIgnoreCase("FF")) {
                return false;
            }
            else {
                int daughter = Integer.valueOf(stringArray[i]);
                int weight = Integer.valueOf(stringArray[i + 1]);

                // Create Adjacent Nodes here
                if ((daughter != currentNode) && (weight == 0)) {
                    graphMatrix[currentNode][daughter] = INFINITY;
                }
                else {
                    graphMatrix[currentNode][daughter] = weight;
                }

                // If condition is true, then it has reached the last pair, so we can
                // increment the currentNode counter
                if (daughter == numOfNodes) {
                    currentNode++;
                }
            }
        }
        return false;
    }