Sage notebook on relations

Applied Discrete Structures 2013-03-15

I filled in for Al Doerr in his class this morning and he asked me to cover some material on relations. So I took that opportunity to figure out how to implement some relations in Sage. It went pretty well. 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. http://www.sagenb.org/home/pub/4715