# Ticket #10322: trac-10322_franklin-graph.patch

File trac-10322_franklin-graph.patch, 3.0 KB (added by mvngu, 12 years ago)
• ## sage/graphs/graph_generators.py

```# HG changeset patch
# User Minh Van Nguyen <nguyenminh2@gmail.com>
# Date 1290628216 28800
# Node ID e975f3c1e10421ca653434343f7cf71b9d823edb
# Parent  660b96851fa082b50c9906980a47abac33747b9f
#10322: add Franklin graph to common graphs database

diff --git a/sage/graphs/graph_generators.py b/sage/graphs/graph_generators.py```
 a - :meth:`DurerGraph ` - :meth:`ErreraGraph ` - :meth:`FlowerSnark ` - :meth:`FranklinGraph ` - :meth:`FruchtGraph ` - :meth:`GrotzschGraph ` - :meth:`HeawoodGraph ` 12:[13,19],13:[14],15:[19],16:[15,17],18:[17,19]}, \ pos=pos_dict, name="Flower Snark") def FranklinGraph(self): r""" Returns the Franklin graph. For more information, see this `Wikipedia article on the Franklin graph `_. EXAMPLES: The Franklin graph is named after Philip Franklin. It is a 3-regular graph on 12 vertices and having 18 edges. :: sage: G = graphs.FranklinGraph(); G Franklin graph: Graph on 12 vertices sage: G.is_regular(3) True sage: G.order() 12 sage: G.size() 18 The Franklin graph is a Hamiltonian, bipartite graph with radius 3, diameter 3, and girth 4. :: sage: G.is_hamiltonian() True sage: G.is_bipartite() True sage: G.radius() 3 sage: G.diameter() 3 sage: G.girth() 4 It is a perfect, triangle-free graph having chromatic number 2. :: sage: G.is_perfect() True sage: G.is_triangle_free() True sage: G.chromatic_number() 2 """ edge_dict = { 0: [1,5,6], 1: [2,7], 2: [3,8], 3: [4,9], 4: [5,10], 5: [11], 6: [7,9], 7: [10], 8: [9,11], 10: [11]} pos_dict = { 0: [2, 0], 1: [1, 1.73205080756888], 2: [-1, 1.73205080756888], 3: [-2, 0], 4: [-1, -1.73205080756888], 5: [1, -1.73205080756888], 6: [1, 0], 7: [0.5, 0.866025403784439], 8: [-0.5, 0.866025403784439], 9: [-1, 0], 10: [-0.5, -0.866025403784439], 11: [0.5, -0.866025403784439]} return graph.Graph(edge_dict, pos=pos_dict, name="Franklin graph") def FruchtGraph(self): """ Returns a Frucht Graph.