From: Kestas Balsys on
Hello,
I have some questions about Dijsktra algorithm. First question is
about this example( Dijkstra Shortest Path Routing):

<http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=5550&objectType=file>.

I can not start this example. In main window I only wiew this
message:??? Undefined command/function 'dijkstra'.
Error in ==> dijkstra1 at 43
[path, totalCost, farthestPreviousHop, farthestNextHop] =
dijkstra(noOfNodes, matrix, 1, 15, farthestPreviousHop,
farthestNextHop);

Second question is about this example(Dijkstra's Greedy Routing
Algorithm):
<http://www.mathworks.com/matlabcentral/files/5543/dijkstra.m>
This example is very useful for me, but I found, that shortest path
in this example was realized only searching min weights from first
node to second from cecond to third. And if I have 20 nodes and
different weights, I can not found shortest way from one node to
another. Maybe some of you can help for me? Maybe some of you can
reccomend how I can change this example?
From: Marcus M. Edvall on
Hi Kestas,

Try the following code in Matlab with TOMLAB installed:

clear all
obj = [2 5 2 5];
ub = ones(4,1);
lb = zeros(4,1);
% Start connection or tails.
tail = [1;1;2;3];
% End connections or heads.
head = [2;3;1;1];
supply = [0;1;-1];
[x, slack, v, rc, f_k, Inform, Iter] = cplexnet(obj, ub, lb ,tail,
head, supply, [], 2);

You will be able to solve extremely large problems using TOMLAB
/CPLEX like this.

Best wishes, Marcus
Tomlab Optimization Inc.
<http://tomlab.biz>

Kestas Balsys wrote:
>
>
> Hello,
> I have some questions about Dijsktra algorithm. First question is
> about this example( Dijkstra Shortest Path Routing):
>
> <http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=5550&objectType=file>.
>
> I can not start this example. In main window I only wiew this
> message:??? Undefined command/function 'dijkstra'.
> Error in ==> dijkstra1 at 43
> [path, totalCost, farthestPreviousHop, farthestNextHop] =
> dijkstra(noOfNodes, matrix, 1, 15, farthestPreviousHop,
> farthestNextHop);
>
> Second question is about this example(Dijkstra's Greedy Routing
> Algorithm):
> <http://www.mathworks.com/matlabcentral/files/5543/dijkstra.m>
> This example is very useful for me, but I found, that shortest path
> in this example was realized only searching min weights from first
> node to second from cecond to third. And if I have 20 nodes and
> different weights, I can not found shortest way from one node to
> another. Maybe some of you can help for me? Maybe some of you can
> reccomend how I can change this example?