I have a peace of a programm of finding the shortest way in graph! And I need to animate this way! Help please!
This is a code of programme:
> restart: with(networks):
> new(G): n:=6:
> addvertex(i$i=1..n,G);
1, 2, 3, 4, 5, 6
> addedge([seq([i,i+3],i=1..3),[1,2],[2,3],[4,5],
> [5,6],[1,5]],weights=[12,16,20,11,15,13,14,26],G):
> draw(Linear([1,4],[2,5],[3,6]),G);
> T:=shortpathtree(G,1):
> W:=vweight(T);
W := table(sparse, [1 = 0, 2 = 11, 3 = 26, 4 = 12, 5 = 25, 6 = 39])
> draw(T);
> MinPath:=W[6];
MinPath := 39
> allpairs(G)[1,6];
39