| 2829 | def HerschelGraph(self): |
| 2830 | r""" |
| 2831 | Returns the Herschel graph. |
| 2832 | |
| 2833 | For more information, see this |
| 2834 | `Wikipedia article on the Herschel graph <http://en.wikipedia.org/wiki/Herschel_graph>`_. |
| 2835 | |
| 2836 | EXAMPLES: |
| 2837 | |
| 2838 | The Herschel graph is named after Alexander Stewart Herschel. It is |
| 2839 | a planar, bipartite graph with 11 vertices and 18 edges. :: |
| 2840 | |
| 2841 | sage: G = graphs.HerschelGraph(); G |
| 2842 | Herschel graph: Graph on 11 vertices |
| 2843 | sage: G.is_planar() |
| 2844 | True |
| 2845 | sage: G.is_bipartite() |
| 2846 | True |
| 2847 | sage: G.order() |
| 2848 | 11 |
| 2849 | sage: G.size() |
| 2850 | 18 |
| 2851 | |
| 2852 | The Herschel graph is a perfect graph with radius 3, diameter 4, and |
| 2853 | girth 4. :: |
| 2854 | |
| 2855 | sage: G.is_perfect() |
| 2856 | True |
| 2857 | sage: G.radius() |
| 2858 | 3 |
| 2859 | sage: G.diameter() |
| 2860 | 4 |
| 2861 | sage: G.girth() |
| 2862 | 4 |
| 2863 | |
| 2864 | Its chromatic number is 2 and its automorphism group is |
| 2865 | isomorphic to the dihedral group `D_6`. :: |
| 2866 | |
| 2867 | sage: G.chromatic_number() |
| 2868 | 2 |
| 2869 | sage: ag = G.automorphism_group() |
| 2870 | sage: ag.is_isomorphic(DihedralGroup(6)) |
| 2871 | True |
| 2872 | """ |
| 2873 | edge_dict = { |
| 2874 | 0: [1,3,4], |
| 2875 | 1: [2,5,6], |
| 2876 | 2: [3,7], |
| 2877 | 3: [8,9], |
| 2878 | 4: [5,9], |
| 2879 | 5: [10], |
| 2880 | 6: [7,10], |
| 2881 | 7: [8], |
| 2882 | 8: [10], |
| 2883 | 9: [10]} |
| 2884 | pos_dict = { |
| 2885 | 0: [2, 0], |
| 2886 | 1: [0, 2], |
| 2887 | 2: [-2, 0], |
| 2888 | 3: [0, -2], |
| 2889 | 4: [1, 0], |
| 2890 | 5: [0.5, 0.866025403784439], |
| 2891 | 6: [-0.5, 0.866025403784439], |
| 2892 | 7: [-1, 0], |
| 2893 | 8: [-0.5, -0.866025403784439], |
| 2894 | 9: [0.5, -0.866025403784439], |
| 2895 | 10: [0, 0]} |
| 2896 | return graph.Graph(edge_dict, pos=pos_dict, name="Herschel graph") |
| 2897 | |