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

Last updated: **Dec 15 '15**

networkx can't compute algebraic connectivity

The interval I(u,v) between a pair of vertices u,v in graph

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

Is there a bug with using chromatic_number together with Gurobi? [closed]

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

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.