How to find minimal cover when attributes have equal chance to be not necessary?
In a functional dependency, both the left part and the right part are sets, so the order of the attributes does not matter.

To find the canonical (or minimal) cover of a set of functional dependencies, the classical algorithm (presented in almost all books on databases) consists of three steps: 


First, rewrite the dependencies so that they have a single attribute on the right part (for instance, t,w,g -&gt; r,e is replaced by t,w,g -&gt; r and t,w,g -&gt; e).
Then, for each attribute on the left part, see if the closure of the remaining attributes includes the right attribute. In this case the attribute is not necessary and should be eliminated. 
Finally, eliminate the superfluous dependencies, if present. A dependency is superfluous if its right part is contained in the closure of the left part, calculated with respect to all the other dependencies. 


For instance, in your example, a possible minimal cover can be computed in this way.

At the end of the first step, we have:

{ e → w
  e r w → s
  g t w → e
  g t w → r
  g → s
  g → t
  r s → g
  r s → t
  s w → r }


At the end of the second step:

{ e r → s
  e → w
  g → t
  g → s
  g w → r
  g w → e
  r s → t
  r s → g
  s w → r }


Finally, a minimal cover is:

{ e → w
  e r → s
  g w → e
  g → s
  g → t
  r s → g
  s w → r }