public String validateMatrix(){
        ArrayList<String> messages = new ArrayList<>();
        int [] inputs = new int [transitions.length];
        int [] outputs = new int [transitions.length];
        
        for (int i = 0; i < transitions.length; i++) {
            for (int j = 0; j < transitions[i].length; j++) {
                if (transitions[i][j] != 0){
                    inputs[i]++;
                    outputs[j]++;
                }
                
            }
        }
        
        for (int i = 0; i < transitions.length; i++) {
            if(ids[i].charAt(0) != 'E' && inputs[i] == 0) {
                messages.add("Hanging  vertex: "+ i);
            }
            if(ids[i].charAt(0) != 'S' && outputs[i] == 0 ){
                messages.add("Unreachable vertex: "+ i);
            }
        }
        String result = "";
        for(String m : messages){
            result += m + "\n";
        }

        return result;
    }