A more general approach to solve minimisation of a DFA goes as follows:
- get rid of unreachable states. ($p \in Q$ is unreachable $\Leftrightarrow \forall s \in \Sigma^*: \delta^*(q_s, s) \neq p$)
- group all indistinguishable states and merge every group of mutually indistinguishable states to one new state. ($p$ and $q$ are indistinguishable if $\forall w \in \Sigma^*: \delta^*(p,w) \in F \Leftrightarrow \delta^*(q,w) \in F$)
To find indistinguishable states, algorithms of Hopcroft, Moore or Brzozowski could be used...