Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Sergio
Posts:
1
Registered:
5/12/13


wxMaxima graph paths
Posted:
May 12, 2013 2:31 PM


Good evening, I am learning how to use wxMaxima so I am trying to solve some exercises, but the answers given and the ones that I think they should be are different in two of them. Would you be so kind as to help me?
Graph G has 15 vertex, u & v are adjacent if remainder(abs(ij),3)=0 How many closed paths with a length <= 6 which begin at the first vertex are?
The answer given is 3255 but i get 1092. This is my code:
load(graphs); Bool_2(u,v):= if remainder(abs(ij),3)=0 then true else false$ Grafo_1: make_graph(15,Bool_2);
Matriz: adjacency_matrix(Grafo_1)$ cont:0; for j:1 thru 6 do cont:cont+(Matriz^^j)[1,1]; cont;
cont is like a counter, it is supposed to increase by every path it finds.
Thank you very much.
Message was edited by: Sergio
Message was edited by: Sergio



