# Ticket #10316: trac-10316_durer-graph.patch

File trac-10316_durer-graph.patch, 2.6 KB (added by mvngu, 3 years ago)
• ## sage/graphs/graph_generators.py

```# HG changeset patch
# User Minh Van Nguyen <nguyenminh2@gmail.com>
# Date 1290547935 28800
# Node ID 562e54d365376e34e60bda625cd2b1b88f26fafc
# Parent  f323375be0397a7c503a3332666c559abd9381dc
#10316: add Durer graph to common graph database

diff --git a/sage/graphs/graph_generators.py b/sage/graphs/graph_generators.py```
 a # -*- coding: utf-8 -*- r""" Common graphs - :meth:`BrinkmannGraph ` - :meth:`ChvatalGraph ` - :meth:`DesarguesGraph ` - :meth:`DurerGraph ` - :meth:`FlowerSnark ` - :meth:`FruchtGraph ` - :meth:`GrotzschGraph ` G=graphs.GeneralizedPetersenGraph(10,3) G.name("Desargues Graph") return G def DurerGraph(self): r""" Returns the DÃŒrer graph. For more information, see this `Wikipedia article on the DÃŒrer graph `_. EXAMPLES: The DÃŒrer graph is named after Albrecht DÃŒrer. It is a planar graph with 12 vertices and 18 edges. :: sage: G = graphs.DurerGraph(); G Durer graph: Graph on 12 vertices sage: G.is_planar() True sage: G.order() 12 sage: G.size() 18 The DÃŒrer graph has chromatic number 3, diameter 4, and girth 3. :: sage: G.chromatic_number() 3 sage: G.diameter() 4 sage: G.girth() 3 """ edge_dict = { 0: [1,5,6], 1: [2,7], 2: [3,8], 3: [4,9], 4: [5,10], 5: [11], 6: [8,10], 7: [9,11], 8: [10], 9: [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="Durer graph") def FlowerSnark(self): """