Nodes which have only one predecessor and only one successor can not always be hidden, even if all states are the same.
An additional condition is needed: the predecessor may have only one successor.
This can be seen on this example:
A / \ B C \ / D
Nodes B and C can not be hidden even if all nodes in the graph have the same state.