The Math Forum

Search All of the Math Forum:

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

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

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

Topic: wxMaxima graph paths
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  

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:

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

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.