Date: May 12, 2013 2:31 PM
Author: Sergio
Subject: wxMaxima graph paths

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);

Matriz: adjacency_matrix(Grafo_1)$
for j:1 thru 6 do cont:cont+(Matriz^^j)[1,1];

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