help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Optimization problem


From: Oliver Heimlich
Subject: Re: Optimization problem
Date: Fri, 21 Apr 2017 09:33:36 +0200
User-agent: K-9 Mail for Android

Am 21. April 2017 06:45:09 MESZ schrieb Avinoam <address@hidden>:
>Hi,
>
>Given a real matrix, size N X N, I want to find set of n<N indices
>1 < i_1 < i_2 < ... < i_n < N
>
>such that M(1, i_1) + M(i_1, i_2) + ... + N(i_n, N) is maximal.
>
>How do I do it in Octave?
>
>Thanks, 
>
>Avinoam
>
>
>
>
>--
>View this message in context:
>http://octave.1599824.n4.nabble.com/Optimization-problem-tp4682950.html
>Sent from the Octave - General mailing list archive at Nabble.com.
>
>_______________________________________________
>Help-octave mailing list
>address@hidden
>https://lists.gnu.org/mailman/listinfo/help-octave

Hi Avinoam,

in Octave you'd solve it like in any other programming language. First, you 
need an algorithm. I guess you can use something similar to the Dijkstra 
algorithm, since you are looking for an optimal path through the entries of the 
matrix. That is, you iterate k=1...N and compute for all entries A(:, k) and 
A(k, :) what their optimal sum of weight and path is. Finally the optimal path 
can be found for entry A(N, N). I don't want to spoil the complete lesson, so 
you may find out the details yourself ;-)

Oliver



reply via email to

[Prev in Thread] Current Thread [Next in Thread]