| 2359 | |
| 2360 | def DurerGraph(self): |
| 2361 | r""" |
| 2362 | Returns the Dürer graph. |
| 2363 | |
| 2364 | For more information, see this |
| 2365 | `Wikipedia article on the Dürer graph <http://en.wikipedia.org/wiki/D%C3%BCrer_graph>`_. |
| 2366 | |
| 2367 | EXAMPLES: |
| 2368 | |
| 2369 | The Dürer graph is named after Albrecht Dürer. It is a planar graph |
| 2370 | with 12 vertices and 18 edges. :: |
| 2371 | |
| 2372 | sage: G = graphs.DurerGraph(); G |
| 2373 | Durer graph: Graph on 12 vertices |
| 2374 | sage: G.is_planar() |
| 2375 | True |
| 2376 | sage: G.order() |
| 2377 | 12 |
| 2378 | sage: G.size() |
| 2379 | 18 |
| 2380 | |
| 2381 | The Dürer graph has chromatic number 3, diameter 4, and girth 3. :: |
| 2382 | |
| 2383 | sage: G.chromatic_number() |
| 2384 | 3 |
| 2385 | sage: G.diameter() |
| 2386 | 4 |
| 2387 | sage: G.girth() |
| 2388 | 3 |
| 2389 | """ |
| 2390 | edge_dict = { |
| 2391 | 0: [1,5,6], |
| 2392 | 1: [2,7], |
| 2393 | 2: [3,8], |
| 2394 | 3: [4,9], |
| 2395 | 4: [5,10], |
| 2396 | 5: [11], |
| 2397 | 6: [8,10], |
| 2398 | 7: [9,11], |
| 2399 | 8: [10], |
| 2400 | 9: [11]} |
| 2401 | pos_dict = { |
| 2402 | 0: [2, 0], |
| 2403 | 1: [1, 1.73205080756888], |
| 2404 | 2: [-1, 1.73205080756888], |
| 2405 | 3: [-2, 0], |
| 2406 | 4: [-1, -1.73205080756888], |
| 2407 | 5: [1, -1.73205080756888], |
| 2408 | 6: [1, 0], |
| 2409 | 7: [0.5, 0.866025403784439], |
| 2410 | 8: [-0.5, 0.866025403784439], |
| 2411 | 9: [-1, 0], |
| 2412 | 10: [-0.5, -0.866025403784439], |
| 2413 | 11: [0.5, -0.866025403784439]} |
| 2414 | return graph.Graph(edge_dict, pos=pos_dict, name="Durer graph") |