NFA to DFA Graph conversation with PHP