title: matrix expression calculation
body: <p>Could anybody, please, point me on the algorithm of how matrix multiplication can be done (Identifying the order of multiplying). I tried really different way which I could design, but nothing works as expected, unfortunately :( For example I have one of the following matrix chains to multiply:  </p>
  
  <pre><code>((((0(((((((((((((((1 2)3)4)5)6)7)8)9)10)11)12)13)14)15)16))17)18)19 
  
  ((((((((((((0 1)2)3)4)5)6)7)8)9)10)(11(12(13(14(15(16(1718))))))))19
  
  (((((0 1)(2(((3 4)(5 6))(((7 8)(9(10 11)))((((12 13)14)15)16)))))17)18)19  
  
  (((((((0 1)2)3)4)5)(6(7(8(9(10(11(12 13))))))))(((((14 15)16)17)18)19)  
  </code></pre>
  
  <p>Can somebody share a universal algorithm for all the cases?  </p>
  
  <p>NOTE:<br>
  1.I need multiplication only.<br>
  2.Matrices have different dimension, so they are not square. (Naturally, Matrices' dimensions agree)
  3.Maybe <a href="https://stackoverflow.com/questions/2245962/is-there-an-alternative-for-flex-bison-that-is-usable-on-8-bit-embedded-systems/2336769#2336769">this topic</a> can be helpful, but I really have no idea how it can be applied here.</p>
  
  <p>Thanks in advance to everybody who is trying to help!</p>