Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: wxMaxima graph paths
Replies: 0

 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(i-j),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:

Bool_2(u,v):= if remainder(abs(i-j),3)=0 then true else false\$
Grafo_1: make_graph(15,Bool_2);

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