| 1044 | def BrouwerHaemersGraph(): |
| 1045 | r""" |
| 1046 | Returns the Brouwer-Haemers Graph. |
| 1047 | |
| 1048 | The Brouwer-Haemers is the only strongly regular graph of parameters |
| 1049 | `(81,20,1,6)`. It is build in Sage as the Affine Orthogonal graph |
| 1050 | `VO^-(6,3)`. For more information on this graph, see its `corresponding page |
| 1051 | on Andries Brouwer's website |
| 1052 | <http://www.win.tue.nl/~aeb/graphs/Brouwer-Haemers.html>`_. |
| 1053 | |
| 1054 | EXAMPLE:: |
| 1055 | |
| 1056 | sage: g = graphs.BrouwerHaemersGraph() |
| 1057 | sage: g |
| 1058 | Brouwer-Haemers: Graph on 81 vertices |
| 1059 | |
| 1060 | It is indeed strongly regular with parameters `(81,20,1,6)`:: |
| 1061 | |
| 1062 | sage: g.is_strongly_regular(parameters = True) # long time |
| 1063 | (81, 20, 1, 6) |
| 1064 | |
| 1065 | Its has as eigenvalues `20,2` and `-7`:: |
| 1066 | |
| 1067 | sage: set(g.spectrum()) == {20,2,-7} |
| 1068 | True |
| 1069 | """ |
| 1070 | from sage.rings.finite_rings.constructor import FiniteField |
| 1071 | from sage.modules.free_module import VectorSpace |
| 1072 | from sage.matrix.constructor import Matrix |
| 1073 | from sage.matrix.constructor import identity_matrix |
| 1074 | |
| 1075 | d = 4 |
| 1076 | q = 3 |
| 1077 | F = FiniteField(q,"x") |
| 1078 | V = VectorSpace(F,d) |
| 1079 | M = Matrix(F,identity_matrix(d)) |
| 1080 | M[1,1]=-1 |
| 1081 | G = Graph([map(tuple,V), lambda x,y:(V(x)-V(y))*(M*(V(x)-V(y))) == 0], loops = False) |
| 1082 | G.relabel() |
| 1083 | ordering = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, |
| 1084 | 18, 19, 20, 21, 22, 23, 24, 25, 26, 48, 49, 50, 51, 52, 53, |
| 1085 | 45, 46, 47, 30, 31, 32, 33, 34, 35, 27, 28, 29, 39, 40, 41, |
| 1086 | 42, 43, 44, 36, 37, 38, 69, 70, 71, 63, 64, 65, 66, 67, 68, |
| 1087 | 78, 79, 80, 72, 73, 74, 75, 76, 77, 60, 61, 62, 54, 55, 56, |
| 1088 | 57, 58, 59] |
| 1089 | _circle_embedding(G, ordering) |
| 1090 | G.name("Brouwer-Haemers") |
| 1091 | return G |
| 1092 | |