On 4/18/12 12:21 PM, Ken Levasseur wrote:
I taught a class for colleague this morning and he asked me to cover
some material on relations. So I took that opportunity to figure out how
to implement relations in Sage. It went pretty well, but one exception
is that in squaring an adjacency matrix of a relation, I'd like to get a
simple adjacency matrix with just 0's and 1's. The way I did the
calculations, I got the numbers of different paths of length 2
connecting the vertices. That's fine except that the graphs of the
squared relations become messy. If anyone knows how to fix this, I'd
appreciate the help.

I've published my notebook at
http://www.sagenb.org/home/pub/4715

Nice; you're using an open-source textbook?

Use multiedges=False when you create the DiGraph:

DiGraph(H,multiedges=False)

See http://aleph.sagemath.org/?q=a5b9d087-bbc0-4062-b8c4-2d73e72f231b

Thanks,

Jason

--
You received this message because you are subscribed to the Google Groups 
"sage-edu" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-edu?hl=en.

Reply via email to