public int getNode(int i, int j) {
        try {
            int x = adj[i].get(j);
            return x;
        }
        catch (ArrayIndexOutOfBoundsException n) {
            Main.errorLabel.setText("Circuit is incomplete");
            return -1;
        }

    }