# How to make a graph from an latin square matrix ?

As the question says I want to write a program that will make a graph from the given matrix ?

How can I do that in Sage?

How to make a graph from an latin square matrix ?

As the question says I want to write a program that will make a graph from the given matrix ?

How can I do that in Sage?

add a comment

0

I don't exactly know how a Latin square leads to a graph. But here is the graph documentation regarding *adjacency* matrices.

```
sage: M = Matrix([(0,1,0,0,1,1,0,0,0,0),(1,0,1,0,0,0,1,0,0,0), \
(0,1,0,1,0,0,0,1,0,0), (0,0,1,0,1,0,0,0,1,0),(1,0,0,1,0,0,0,0,0,1), \
(1,0,0,0,0,0,0,1,1,0), (0,1,0,0,0,0,0,0,1,1),(0,0,1,0,0,1,0,0,0,1), \
(0,0,0,1,0,1,1,0,0,0), (0,0,0,0,1,0,1,1,0,0)])
sage: M
[0 1 0 0 1 1 0 0 0 0]
[1 0 1 0 0 0 1 0 0 0]
[0 1 0 1 0 0 0 1 0 0]
[0 0 1 0 1 0 0 0 1 0]
[1 0 0 1 0 0 0 0 0 1]
[1 0 0 0 0 0 0 1 1 0]
[0 1 0 0 0 0 0 0 1 1]
[0 0 1 0 0 1 0 0 0 1]
[0 0 0 1 0 1 1 0 0 0]
[0 0 0 0 1 0 1 1 0 0]
sage: G = Graph(M); G
Graph on 10 vertices
```

1

Asked: **
2015-12-14 13:20:10 -0500
**

Seen: **137 times**

Last updated: **Dec 15 '15**

Constructing graphs using permutation or symmetric groups

How do I write function to test if a graph is apex?

How to generate random graphs free of certain structures?

Combinatorial data for planar graph

How to plot a colored graph from a latin square?

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.