title: BCNF decomposition algorithm explanation
body: <p>I looked in <a href="https://stackoverflow.com/questions/15102485/decomposing-a-relation-into-bcnf">Decomposing a relation into BCNF</a> answers and tried it on my homework, but i don't get the correct answers, so  i ask for help in BCNF decomposition </p>
  
  <p>Consider <code>R=(ABCDEG)</code> &amp; <code>F={BG-&gt;CD, G-&gt;A, CD-&gt;AE, C-&gt;AG, A-&gt;D}</code>.<br>
  I start pick <code>A-&gt;D</code>.<br>
  Now i got <code>S=(AD), R'=(ABCEG).</code><br>
   I pick <code>G-&gt;A</code>.<br>
  Now i got <code>S=(AD,AG) R'=(BCEG)</code>.<br>
   I pick <code>C-&gt;G</code>.
  Now i think i need to get <code>S=(AD,AG,CG)</code> and <code>R'=(BCE)</code>, But the answer in the end is <code>(AD,AG,CGE,BC)</code> .what went wrong? or perhaps, a better algorithm? </p>