# 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 -0600
**

Seen: **81 times**

Last updated: **Dec 15 '15**

How to generate random graphs free of certain structures?

How to get an arbitrary orientation of a graph.

plot digraph use adjacency matrix

Generate Maximal subsets based on mutual/subset property

Edges associated to the variables in G.kirchhoff_symanzik_polynomial()

How to get a list of graphs whose independence number equals to chromatic number?

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.