4327 | | |
| 4331 | |
| 4332 | def McGeeGraph(self, embedding = 2): |
| 4333 | r""" |
| 4334 | Returns the McGee Graph. |
| 4335 | |
| 4336 | See the :wikipedia:`Wikipedia page on the McGee Graph <McGee_graph>`. |
| 4337 | |
| 4338 | INPUT: |
| 4339 | |
| 4340 | - ``embedding`` -- two embeddings are available, and can be selected by |
| 4341 | setting ``embedding`` to 1 or 2. |
| 4342 | |
| 4343 | EXAMPLES:: |
| 4344 | |
| 4345 | sage: g = graphs.McGeeGraph() |
| 4346 | sage: g.order() |
| 4347 | 24 |
| 4348 | sage: g.size() |
| 4349 | 36 |
| 4350 | sage: g.girth() |
| 4351 | 7 |
| 4352 | sage: g.diameter() |
| 4353 | 4 |
| 4354 | sage: g.show() |
| 4355 | sage: graphs.McGeeGraph(embedding=2).show() |
| 4356 | |
| 4357 | TESTS:: |
| 4358 | |
| 4359 | sage: graphs.McGeeGraph(embedding=3) |
| 4360 | Traceback (most recent call last): |
| 4361 | ... |
| 4362 | ValueError: The value of embedding must be 1 or 2. |
| 4363 | """ |
| 4364 | |
| 4365 | L = [47, -23, -31, 39, 25, -21, -31, -41, 25, 15, 29, -41, -19, 15, |
| 4366 | -49, 33, 39, -35, -21, 17, -33, 49, 41, 31, -15, -29, 41, 31, |
| 4367 | -15, -25, 21, 31, -51, -25, 23, 9, -17, 51, 35, -29, 21, -51, |
| 4368 | -39, 33, -9, -51, 51, -47, -33, 19, 51, -21, 29, 21, -31, -39] |
| 4369 | |
| 4370 | g = graphs.LCFGraph(24, [12,7,-7], 8) |
| 4371 | g.name('McGee graph') |
| 4372 | |
| 4373 | if embedding == 1: |
| 4374 | return g |
| 4375 | |
| 4376 | elif embedding == 2: |
| 4377 | |
| 4378 | o = [[7, 2, 13, 8, 19, 14, 1, 20], |
| 4379 | [5, 4, 11, 10, 17, 16, 23, 22], |
| 4380 | [3, 12, 9, 18, 15, 0, 21, 6]] |
| 4381 | |
| 4382 | _circle_embedding(g,o[0], radius = 1.5) |
| 4383 | _circle_embedding(g,o[1], radius = 3, shift = -.5) |
| 4384 | _circle_embedding(g,o[2], radius = 2.25, shift = .5) |
| 4385 | |
| 4386 | return g |
| 4387 | else: |
| 4388 | raise ValueError("The value of embedding must be 1 or 2.") |
| 4389 | |
| 4390 | |
| 4595 | def NauruGraph(self, embedding = 2): |
| 4596 | """ |
| 4597 | Returns the Nauru Graph. |
| 4598 | |
| 4599 | See the :wikipedia:`Wikipedia page on the Nauru Graph <Nauru_graph>`. |
| 4600 | |
| 4601 | INPUT: |
| 4602 | |
| 4603 | - ``embedding`` -- two embeddings are available, and can be |
| 4604 | selected by setting ``embedding`` to 1 or 2. |
| 4605 | |
| 4606 | EXAMPLES:: |
| 4607 | |
| 4608 | sage: g = graphs.NauruGraph() |
| 4609 | sage: g.order() |
| 4610 | 24 |
| 4611 | sage: g.size() |
| 4612 | 36 |
| 4613 | sage: g.girth() |
| 4614 | 6 |
| 4615 | sage: g.diameter() |
| 4616 | 4 |
| 4617 | sage: g.show() |
| 4618 | sage: graphs.NauruGraph(embedding=2).show() |
| 4619 | |
| 4620 | TESTS:: |
| 4621 | |
| 4622 | sage: graphs.NauruGraph(embedding=3) |
| 4623 | Traceback (most recent call last): |
| 4624 | ... |
| 4625 | ValueError: The value of embedding must be 1 or 2. |
| 4626 | sage: graphs.NauruGraph(embedding=1).is_isomorphic(graphs.NauruGraph()) |
| 4627 | True |
| 4628 | """ |
| 4629 | |
| 4630 | if embedding == 1: |
| 4631 | g = graphs.LCFGraph(24, [5,-9,7,-7,9,-5], 4) |
| 4632 | g.name('Nauru Graph') |
| 4633 | return g |
| 4634 | elif embedding == 2: |
| 4635 | g = graphs.GeneralizedPetersenGraph(12,5) |
| 4636 | g.name("Nauru Graph") |
| 4637 | return g |
| 4638 | else: |
| 4639 | raise ValueError("The value of embedding must be 1 or 2.") |
| 4640 | |
4696 | | |
| 4805 | |
| 4806 | def Tutte12Cage(self): |
| 4807 | r""" |
| 4808 | Returns Tutte's 12-Cage |
| 4809 | |
| 4810 | See the :wikipedia:`Wikipedia page on the Tutte 12-Cage |
| 4811 | <Tutte_12-cage>`. |
| 4812 | |
| 4813 | EXAMPLES:: |
| 4814 | |
| 4815 | sage: g = graphs.Tutte12Cage() |
| 4816 | sage: g.order() |
| 4817 | 126 |
| 4818 | sage: g.size() |
| 4819 | 189 |
| 4820 | sage: g.girth() |
| 4821 | 12 |
| 4822 | sage: g.diameter() |
| 4823 | 6 |
| 4824 | sage: g.show() |
| 4825 | """ |
| 4826 | L = [17, 27, -13, -59, -35, 35, -11, 13, -53, 53, -27, 21, 57, 11, |
| 4827 | -21, -57, 59, -17] |
| 4828 | |
| 4829 | g = graphs.LCFGraph(126, L, 7) |
| 4830 | g.name("Tutte 12-Cage") |
| 4831 | return g |
| 4832 | |
| 4833 | def TutteCoxeterGraph(self, embedding=2): |
| 4834 | r""" |
| 4835 | Returns the Tutte-Coxeter graph. |
| 4836 | |
| 4837 | See the :wikipedia:`Wikipedia page on the Tutte-Coxeter Graph |
| 4838 | <Tutte-Coxeter_graph>`. |
| 4839 | |
| 4840 | INPUT: |
| 4841 | |
| 4842 | - ``embedding`` -- two embeddings are available, and can be |
| 4843 | selected by setting ``embedding`` to 1 or 2. |
| 4844 | |
| 4845 | EXAMPLES:: |
| 4846 | |
| 4847 | sage: g = graphs.TutteCoxeterGraph() |
| 4848 | sage: g.order() |
| 4849 | 30 |
| 4850 | sage: g.size() |
| 4851 | 45 |
| 4852 | sage: g.girth() |
| 4853 | 8 |
| 4854 | sage: g.diameter() |
| 4855 | 4 |
| 4856 | sage: g.show() |
| 4857 | sage: graphs.TutteCoxeterGraph(embedding = 1).show() |
| 4858 | |
| 4859 | TESTS:: |
| 4860 | |
| 4861 | sage: graphs.TutteCoxeterGraph(embedding = 3) |
| 4862 | Traceback (most recent call last): |
| 4863 | ... |
| 4864 | ValueError: The value of embedding must be 1 or 2. |
| 4865 | """ |
| 4866 | |
| 4867 | g = graphs.LCFGraph(30, [-13,-9,7,-7,9,13], 5) |
| 4868 | g.name("Tutte-Coxeter graph") |
| 4869 | |
| 4870 | if embedding == 1: |
| 4871 | d = { |
| 4872 | 0: [1, 3, 5, 7, 29], |
| 4873 | 1: [2, 4, 6, 28, 0], |
| 4874 | 2: [8, 18, 26, 22, 12], |
| 4875 | 3: [9, 13, 23, 27, 17], |
| 4876 | 4: [11, 15, 21, 25, 19], |
| 4877 | 5: [10, 14, 24, 20, 16] |
| 4878 | } |
| 4879 | |
| 4880 | _circle_embedding(g,d[0], center = (-1,1), radius = .25) |
| 4881 | _circle_embedding(g,d[1], center = (1,1), radius = .25) |
| 4882 | _circle_embedding(g,d[2], center = (-.8,0), radius = .25, shift = 2.5) |
| 4883 | _circle_embedding(g,d[3], center = (1.2,0), radius = .25) |
| 4884 | _circle_embedding(g,d[4], center = (-1,-1), radius = .25, shift = 2) |
| 4885 | _circle_embedding(g,d[5], center = (1,-1), radius = .25) |
| 4886 | |
| 4887 | return g |
| 4888 | |
| 4889 | elif embedding == 2: |
| 4890 | return g |
| 4891 | |
| 4892 | else: |
| 4893 | raise ValueError("The value of embedding must be 1 or 2.") |
| 4894 | |
| 4895 | |
| 4896 | |
| 4897 | |
| 4898 | def WagnerGraph(self): |
| 4899 | """ |
| 4900 | Returns the Wagner Graph. |
| 4901 | |
| 4902 | See the :wikipedia:`Wikipedia page on the Wagner Graph <Wagner_graph>`. |
| 4903 | |
| 4904 | EXAMPLES:: |
| 4905 | |
| 4906 | sage: g = graphs.WagnerGraph() |
| 4907 | sage: g.order() |
| 4908 | 8 |
| 4909 | sage: g.size() |
| 4910 | 12 |
| 4911 | sage: g.girth() |
| 4912 | 4 |
| 4913 | sage: g.diameter() |
| 4914 | 2 |
| 4915 | sage: g.show() |
| 4916 | """ |
| 4917 | g = graphs.LCFGraph(8, [4], 8) |
| 4918 | g.name("Wagner Graph") |
| 4919 | return g |
| 4920 | |