Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » sci.math.* » sci.math.symbolic.independent

Topic: wxMaxima graph paths
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Sergio

Posts: 1
Registered: 5/12/13
wxMaxima graph paths
Posted: May 12, 2013 2:31 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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:

load(graphs);
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)$
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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.