4341 | | |
| 4345 | |
| 4346 | def McGeeGraph(self, embedding = 2): |
| 4347 | r""" |
| 4348 | Returns the McGee Graph. |
| 4349 | |
| 4350 | See the :wikipedia:`Wikipedia page on the McGee Graph <McGee_graph>`. |
| 4351 | |
| 4352 | INPUT: |
| 4353 | |
| 4354 | - ``embedding`` -- two embeddings are available, and can be selected by |
| 4355 | setting ``embedding`` to 1 or 2. |
| 4356 | |
| 4357 | EXAMPLES:: |
| 4358 | |
| 4359 | sage: g = graphs.McGeeGraph() |
| 4360 | sage: g.order() |
| 4361 | 24 |
| 4362 | sage: g.size() |
| 4363 | 36 |
| 4364 | sage: g.girth() |
| 4365 | 7 |
| 4366 | sage: g.diameter() |
| 4367 | 4 |
| 4368 | sage: g.show() |
| 4369 | sage: graphs.McGeeGraph(embedding=2).show() |
| 4370 | |
| 4371 | TESTS:: |
| 4372 | |
| 4373 | sage: graphs.McGeeGraph(embedding=3) |
| 4374 | Traceback (most recent call last): |
| 4375 | ... |
| 4376 | ValueError: The value of embedding must be 1 or 2. |
| 4377 | """ |
| 4378 | |
| 4379 | L = [47, -23, -31, 39, 25, -21, -31, -41, 25, 15, 29, -41, -19, 15, |
| 4380 | -49, 33, 39, -35, -21, 17, -33, 49, 41, 31, -15, -29, 41, 31, |
| 4381 | -15, -25, 21, 31, -51, -25, 23, 9, -17, 51, 35, -29, 21, -51, |
| 4382 | -39, 33, -9, -51, 51, -47, -33, 19, 51, -21, 29, 21, -31, -39] |
| 4383 | |
| 4384 | g = graphs.LCFGraph(24, [12,7,-7], 8) |
| 4385 | g.name('McGee graph') |
| 4386 | |
| 4387 | if embedding == 1: |
| 4388 | return g |
| 4389 | |
| 4390 | elif embedding == 2: |
| 4391 | |
| 4392 | o = [[7, 2, 13, 8, 19, 14, 1, 20], |
| 4393 | [5, 4, 11, 10, 17, 16, 23, 22], |
| 4394 | [3, 12, 9, 18, 15, 0, 21, 6]] |
| 4395 | |
| 4396 | _circle_embedding(g,o[0], radius = 1.5) |
| 4397 | _circle_embedding(g,o[1], radius = 3, shift = -.5) |
| 4398 | _circle_embedding(g,o[2], radius = 2.25, shift = .5) |
| 4399 | |
| 4400 | return g |
| 4401 | else: |
| 4402 | raise ValueError("The value of embedding must be 1 or 2.") |
| 4403 | |
| 4404 | |
| 4609 | def NauruGraph(self, embedding = 2): |
| 4610 | """ |
| 4611 | Returns the Nauru Graph. |
| 4612 | |
| 4613 | See the :wikipedia:`Wikipedia page on the Nauru Graph <Nauru_graph>`. |
| 4614 | |
| 4615 | INPUT: |
| 4616 | |
| 4617 | - ``embedding`` -- two embeddings are available, and can be |
| 4618 | selected by setting ``embedding`` to 1 or 2. |
| 4619 | |
| 4620 | EXAMPLES:: |
| 4621 | |
| 4622 | sage: g = graphs.NauruGraph() |
| 4623 | sage: g.order() |
| 4624 | 24 |
| 4625 | sage: g.size() |
| 4626 | 36 |
| 4627 | sage: g.girth() |
| 4628 | 6 |
| 4629 | sage: g.diameter() |
| 4630 | 4 |
| 4631 | sage: g.show() |
| 4632 | sage: graphs.NauruGraph(embedding=2).show() |
| 4633 | |
| 4634 | TESTS:: |
| 4635 | |
| 4636 | sage: graphs.NauruGraph(embedding=3) |
| 4637 | Traceback (most recent call last): |
| 4638 | ... |
| 4639 | ValueError: The value of embedding must be 1 or 2. |
| 4640 | sage: graphs.NauruGraph(embedding=1).is_isomorphic(graphs.NauruGraph()) |
| 4641 | True |
| 4642 | """ |
| 4643 | |
| 4644 | if embedding == 1: |
| 4645 | g = graphs.LCFGraph(24, [5,-9,7,-7,9,-5], 4) |
| 4646 | g.name('Nauru Graph') |
| 4647 | return g |
| 4648 | elif embedding == 2: |
| 4649 | g = graphs.GeneralizedPetersenGraph(12,5) |
| 4650 | g.name("Nauru Graph") |
| 4651 | return g |
| 4652 | else: |
| 4653 | raise ValueError("The value of embedding must be 1 or 2.") |
| 4654 | |
4710 | | |
| 4819 | |
| 4820 | def Tutte12Cage(self): |
| 4821 | r""" |
| 4822 | Returns Tutte's 12-Cage |
| 4823 | |
| 4824 | See the :wikipedia:`Wikipedia page on the Tutte 12-Cage |
| 4825 | <Tutte_12-cage>`. |
| 4826 | |
| 4827 | EXAMPLES:: |
| 4828 | |
| 4829 | sage: g = graphs.Tutte12Cage() |
| 4830 | sage: g.order() |
| 4831 | 126 |
| 4832 | sage: g.size() |
| 4833 | 189 |
| 4834 | sage: g.girth() |
| 4835 | 12 |
| 4836 | sage: g.diameter() |
| 4837 | 6 |
| 4838 | sage: g.show() |
| 4839 | """ |
| 4840 | L = [17, 27, -13, -59, -35, 35, -11, 13, -53, 53, -27, 21, 57, 11, |
| 4841 | -21, -57, 59, -17] |
| 4842 | |
| 4843 | g = graphs.LCFGraph(126, L, 7) |
| 4844 | g.name("Tutte 12-Cage") |
| 4845 | return g |
| 4846 | |
| 4847 | def TutteCoxeterGraph(self, embedding=2): |
| 4848 | r""" |
| 4849 | Returns the Tutte-Coxeter graph. |
| 4850 | |
| 4851 | See the :wikipedia:`Wikipedia page on the Tutte-Coxeter Graph |
| 4852 | <Tutte-Coxeter_graph>`. |
| 4853 | |
| 4854 | INPUT: |
| 4855 | |
| 4856 | - ``embedding`` -- two embeddings are available, and can be |
| 4857 | selected by setting ``embedding`` to 1 or 2. |
| 4858 | |
| 4859 | EXAMPLES:: |
| 4860 | |
| 4861 | sage: g = graphs.TutteCoxeterGraph() |
| 4862 | sage: g.order() |
| 4863 | 30 |
| 4864 | sage: g.size() |
| 4865 | 45 |
| 4866 | sage: g.girth() |
| 4867 | 8 |
| 4868 | sage: g.diameter() |
| 4869 | 4 |
| 4870 | sage: g.show() |
| 4871 | sage: graphs.TutteCoxeterGraph(embedding = 1).show() |
| 4872 | |
| 4873 | TESTS:: |
| 4874 | |
| 4875 | sage: graphs.TutteCoxeterGraph(embedding = 3) |
| 4876 | Traceback (most recent call last): |
| 4877 | ... |
| 4878 | ValueError: The value of embedding must be 1 or 2. |
| 4879 | """ |
| 4880 | |
| 4881 | g = graphs.LCFGraph(30, [-13,-9,7,-7,9,13], 5) |
| 4882 | g.name("Tutte-Coxeter graph") |
| 4883 | |
| 4884 | if embedding == 1: |
| 4885 | d = { |
| 4886 | 0: [1, 3, 5, 7, 29], |
| 4887 | 1: [2, 4, 6, 28, 0], |
| 4888 | 2: [8, 18, 26, 22, 12], |
| 4889 | 3: [9, 13, 23, 27, 17], |
| 4890 | 4: [11, 15, 21, 25, 19], |
| 4891 | 5: [10, 14, 24, 20, 16] |
| 4892 | } |
| 4893 | |
| 4894 | _circle_embedding(g,d[0], center = (-1,1), radius = .25) |
| 4895 | _circle_embedding(g,d[1], center = (1,1), radius = .25) |
| 4896 | _circle_embedding(g,d[2], center = (-.8,0), radius = .25, shift = 2.5) |
| 4897 | _circle_embedding(g,d[3], center = (1.2,0), radius = .25) |
| 4898 | _circle_embedding(g,d[4], center = (-1,-1), radius = .25, shift = 2) |
| 4899 | _circle_embedding(g,d[5], center = (1,-1), radius = .25) |
| 4900 | |
| 4901 | return g |
| 4902 | |
| 4903 | elif embedding == 2: |
| 4904 | return g |
| 4905 | |
| 4906 | else: |
| 4907 | raise ValueError("The value of embedding must be 1 or 2.") |
| 4908 | |
| 4909 | |
| 4910 | |
| 4911 | |
| 4912 | def WagnerGraph(self): |
| 4913 | """ |
| 4914 | Returns the Wagner Graph. |
| 4915 | |
| 4916 | See the :wikipedia:`Wikipedia page on the Wagner Graph <Wagner_graph>`. |
| 4917 | |
| 4918 | EXAMPLES:: |
| 4919 | |
| 4920 | sage: g = graphs.WagnerGraph() |
| 4921 | sage: g.order() |
| 4922 | 8 |
| 4923 | sage: g.size() |
| 4924 | 12 |
| 4925 | sage: g.girth() |
| 4926 | 4 |
| 4927 | sage: g.diameter() |
| 4928 | 2 |
| 4929 | sage: g.show() |
| 4930 | """ |
| 4931 | g = graphs.LCFGraph(8, [4], 8) |
| 4932 | g.name("Wagner Graph") |
| 4933 | return g |
| 4934 | |