<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265249</link>
    <title>MATLAB Central Newsreader - Computational complexity of fmincon algorithm</title>
    <description>Feed for thread: Computational complexity of fmincon algorithm</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sat, 07 Nov 2009 17:35:04 -0500</pubDate>
      <title>Computational complexity of fmincon algorithm</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265249#692909</link>
      <author>Lior Vernia</author>
      <description>Hello,&lt;br&gt;
&lt;br&gt;
I've wondered what the computational complexity of the fmincon algorithm is (the medium scale one, I think it's a line search). I'd especially like to know how it depends on the number of variables; is it exponential? I thought it'd be easier to ask here than to look at the m-file and try to figure out the exact algorithm myself.&lt;br&gt;
&lt;br&gt;
Thanks, Lior.</description>
    </item>
    <item>
      <pubDate>Sat, 07 Nov 2009 19:20:03 -0500</pubDate>
      <title>Re: Computational complexity of fmincon algorithm</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265249#692922</link>
      <author>Matt </author>
      <description>&quot;Lior Vernia&quot; &amp;lt;liorvern@post.tau.ac.il&amp;gt; wrote in message &amp;lt;hd4b47$mq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hello,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I've wondered what the computational complexity of the fmincon algorithm is (the medium scale one, I think it's a line search). I'd especially like to know how it depends on the number of variables; is it exponential? I thought it'd be easier to ask here than to look at the m-file and try to figure out the exact algorithm myself.&lt;br&gt;
======&lt;br&gt;
&lt;br&gt;
That would really depend on your objective function. For example&lt;br&gt;
&lt;br&gt;
f(x)=norm(x)^2 &lt;br&gt;
&lt;br&gt;
is obviously linear in the number of variables, while for a dense square matrix A&lt;br&gt;
&lt;br&gt;
f(x)=norm(A*x)^2&lt;br&gt;
&lt;br&gt;
is obviously quadratic in the the number of variables, because computing A*x is O(N^2)</description>
    </item>
    <item>
      <pubDate>Sat, 07 Nov 2009 20:06:02 -0500</pubDate>
      <title>Re: Computational complexity of fmincon algorithm</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265249#692924</link>
      <author>Lior Vernia</author>
      <description>Hi Matt,&lt;br&gt;
&lt;br&gt;
Thanks for the speedy reply. You are correct, of course. However, let's assume that since the objective function is written by me, its complexity is known to us. We can call it T(n), n being the number of variables. Let's also say that f(x) is analytical and that I'm supplying the gradients and the Hessian matrix, and thus we know their complexity as well. What should the complexity of the entire call to fmincon be? Obviously fmincon is the one who decides how many times to compute f(x), and its gradients and Hessian, so how does that depend on n?&lt;br&gt;
&lt;br&gt;
Thanks, Lior.</description>
    </item>
    <item>
      <pubDate>Sun, 08 Nov 2009 16:05:19 -0500</pubDate>
      <title>Re: Computational complexity of fmincon algorithm</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265249#693022</link>
      <author>Matt </author>
      <description>&quot;Lior Vernia&quot; &amp;lt;liorvern@post.tau.ac.il&amp;gt; wrote in message &amp;lt;hd4jva$gd$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
Obviously fmincon is the one who decides how many times to compute f(x), and its gradients and Hessian, so how does that depend on n?&lt;br&gt;
=====&lt;br&gt;
&lt;br&gt;
Well, the number of times it computes f() and its derivatives depends on how many iterations it needs to reach some stopping/convergence criterion. So, the complexity I guess is O(N*T(n)) where N is the number of iterations it ends up running.&lt;br&gt;
&lt;br&gt;
The number of iterations though is influenced in part by you, since you choose the stopping/convergence criteria through optional arguments passed to fmincon. It obviously also depends on the shape of the graph of f(), e.g. the condition number of the Hessian at the solution. Some functions just take more iterations to minimize than others.</description>
    </item>
    <item>
      <pubDate>Sun, 08 Nov 2009 17:02:02 -0500</pubDate>
      <title>Re: Computational complexity of fmincon algorithm</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265249#693033</link>
      <author>Matt </author>
      <description>&quot;Matt &quot; &amp;lt;xys@whatever.com&amp;gt; wrote in message &amp;lt;hd6q7v$2sk$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Lior Vernia&quot; &amp;lt;liorvern@post.tau.ac.il&amp;gt; wrote in message &amp;lt;hd4jva$gd$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Obviously fmincon is the one who decides how many times to compute f(x), and its gradients and Hessian, so how does that depend on n?&lt;br&gt;
&amp;gt; =====&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Well, the number of times it computes f() and its derivatives depends on how many iterations it needs to reach some stopping/convergence criterion. So, the complexity I guess is O(N*T(n)) where N is the number of iterations it ends up running.&lt;br&gt;
====&lt;br&gt;
&lt;br&gt;
It occurs to me there would also be an n-dependence on the complexity of fmincon solving, at each iteration&lt;br&gt;
&lt;br&gt;
H*x=-g;   %H=Hessian, g=gradient&lt;br&gt;
&lt;br&gt;
This would in general be O(n^3), but could be less depending on the sparsity structure of H.</description>
    </item>
    <item>
      <pubDate>Sun, 08 Nov 2009 19:16:02 -0500</pubDate>
      <title>Re: Computational complexity of fmincon algorithm</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265249#693058</link>
      <author>Lior Vernia</author>
      <description>&amp;gt; It occurs to me there would also be an n-dependence on the complexity of fmincon solving, at each iteration&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; H*x=-g;   %H=Hessian, g=gradient&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; This would in general be O(n^3), but could be less depending on the sparsity structure of H.&lt;br&gt;
&lt;br&gt;
Is this this the only dependence on n of each iteration? Because I'm running fmincon on increasingly larger inputs, and its runtime grows dramatically with each increase. I don't have enough data to say for sure that it grows exponentially, but that's how it seems.&lt;br&gt;
&lt;br&gt;
The function I'm minimizing is the same function, it's smooth and convex, and its complexity is O(n). Each gradient computation complexity is also O(n), so if all of them have to be computed during an iteration that adds O(n^2). The number of iterations doesn't grow significantly with n. So really, I'm looking to blame whatever happens inside each iteration.</description>
    </item>
    <item>
      <pubDate>Sun, 08 Nov 2009 20:23:01 -0500</pubDate>
      <title>Re: Computational complexity of fmincon algorithm</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265249#693069</link>
      <author>Matt </author>
      <description>&quot;Lior Vernia&quot; &amp;lt;liorvern@post.tau.ac.il&amp;gt; wrote in message &amp;lt;hd75di$nm5$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; It occurs to me there would also be an n-dependence on the complexity of fmincon solving, at each iteration&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; H*x=-g;   %H=Hessian, g=gradient&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; This would in general be O(n^3), but could be less depending on the sparsity structure of H.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Is this this the only dependence on n of each iteration? Because I'm running fmincon on increasingly larger inputs, and its runtime grows dramatically with each increase. I don't have enough data to say for sure that it grows exponentially, but that's how it seems.&lt;br&gt;
=====&lt;br&gt;
&lt;br&gt;
All I can say is  O(n^3) could be enough to give you a dramatic increase. If n increases by a factor of 10, the computations would increase by a factor of 1000.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt; The function I'm minimizing is the same function, it's smooth and convex, and its complexity is O(n). Each gradient computation complexity is also O(n), so if all of them have to be computed during an iteration that adds O(n^2). &lt;br&gt;
=====&lt;br&gt;
&lt;br&gt;
And what about the Hessian?</description>
    </item>
  </channel>
</rss>

