# Ticket #10329: trac-10329_goldner-harary.patch

File trac-10329_goldner-harary.patch, 2.6 KB (added by mvngu, 11 years ago)
• ## sage/graphs/graph_generators.py

```# HG changeset patch
# User Minh Van Nguyen <nguyenminh2@gmail.com>
# Date 1290706209 28800
# Node ID c8e2da57206307549bd8b2eb4b2978ab376e3767
# Parent  e975f3c1e10421ca653434343f7cf71b9d823edb
#10329: add Goldner-Harary graph to common graphs database

diff --git a/sage/graphs/graph_generators.py b/sage/graphs/graph_generators.py```
 a - :meth:`FlowerSnark ` - :meth:`FranklinGraph ` - :meth:`FruchtGraph ` - :meth:`GoldnerHararyGraph ` - :meth:`GrotzschGraph ` - :meth:`HeawoodGraph ` - :meth:`HigmanSimsGraph ` G = networkx.frucht_graph() return graph.Graph(G, pos=pos_dict, name="Frucht graph") def GoldnerHararyGraph(self): r""" Return the Goldner-Harary graph. For more information, see this `Wikipedia article on the Goldner-Harary graph `_. EXAMPLES: The Goldner-Harary graph is named after A. Goldner and Frank Harary. It is a planar graph having 11 vertices and 27 edges. :: sage: G = graphs.GoldnerHararyGraph(); G Goldner-Harary graph: Graph on 11 vertices sage: G.is_planar() True sage: G.order() 11 sage: G.size() 27 The Goldner-Harary graph is chordal with radius 2, diameter 2, and girth 3. :: sage: G.is_chordal() True sage: G.radius() 2 sage: G.diameter() 2 sage: G.girth() 3 Its chromatic number is 4 and its automorphism group is isomorphic to the dihedral group `D_6`. :: sage: G.chromatic_number() 4 sage: ag = G.automorphism_group() sage: ag.is_isomorphic(DihedralGroup(6)) True """ edge_dict = { 0: [1,3,4], 1: [2,3,4,5,6,7,10], 2: [3,7], 3: [7,8,9,10], 4: [3,5,9,10], 5: [10], 6: [7,10], 7: [8,10], 8: [10], 9: [10]} return graph.Graph(edge_dict, name="Goldner-Harary graph") def GrotzschGraph(self): r""" Creates the Grotzsch graph.