# 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: **152 times**

Last updated: **Dec 15 '15**

Check SDR in a bipartite graph by Hall's theorem.

How to obtain the graph having highest algebraic connectivity?

Graph theory exporting problems

Why can't I find the spectral radius of a tree?

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

How to plot a colored graph from a latin square?

Graph.subgraph_search() obtaining the indices?

Finding all shortest paths between given (specific) pair of vertices

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.