passagemath-graphs 10.6.1rc1__cp310-cp310-musllinux_1_2_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- passagemath_graphs-10.6.1rc1.dist-info/METADATA +292 -0
- passagemath_graphs-10.6.1rc1.dist-info/RECORD +260 -0
- passagemath_graphs-10.6.1rc1.dist-info/WHEEL +5 -0
- passagemath_graphs-10.6.1rc1.dist-info/top_level.txt +2 -0
- passagemath_graphs.libs/libgcc_s-69c45f16.so.1 +0 -0
- passagemath_graphs.libs/libgmp-8e78bd9b.so.10.5.0 +0 -0
- passagemath_graphs.libs/libstdc++-1f1a71be.so.6.0.33 +0 -0
- sage/all__sagemath_graphs.py +39 -0
- sage/combinat/abstract_tree.py +2723 -0
- sage/combinat/all__sagemath_graphs.py +34 -0
- sage/combinat/binary_tree.py +5306 -0
- sage/combinat/cluster_algebra_quiver/all.py +22 -0
- sage/combinat/cluster_algebra_quiver/cluster_seed.py +5208 -0
- sage/combinat/cluster_algebra_quiver/interact.py +124 -0
- sage/combinat/cluster_algebra_quiver/mutation_class.py +625 -0
- sage/combinat/cluster_algebra_quiver/mutation_type.py +1555 -0
- sage/combinat/cluster_algebra_quiver/quiver.py +2290 -0
- sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py +2468 -0
- sage/combinat/designs/MOLS_handbook_data.py +570 -0
- sage/combinat/designs/all.py +58 -0
- sage/combinat/designs/bibd.py +1655 -0
- sage/combinat/designs/block_design.py +1071 -0
- sage/combinat/designs/covering_array.py +269 -0
- sage/combinat/designs/covering_design.py +530 -0
- sage/combinat/designs/database.py +5615 -0
- sage/combinat/designs/design_catalog.py +122 -0
- sage/combinat/designs/designs_pyx.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/designs/designs_pyx.pxd +21 -0
- sage/combinat/designs/designs_pyx.pyx +993 -0
- sage/combinat/designs/difference_family.py +3951 -0
- sage/combinat/designs/difference_matrices.py +279 -0
- sage/combinat/designs/evenly_distributed_sets.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/designs/evenly_distributed_sets.pyx +661 -0
- sage/combinat/designs/ext_rep.py +1064 -0
- sage/combinat/designs/gen_quadrangles_with_spread.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/designs/gen_quadrangles_with_spread.pyx +339 -0
- sage/combinat/designs/group_divisible_designs.py +361 -0
- sage/combinat/designs/incidence_structures.py +2357 -0
- sage/combinat/designs/latin_squares.py +581 -0
- sage/combinat/designs/orthogonal_arrays.py +2244 -0
- sage/combinat/designs/orthogonal_arrays_build_recursive.py +1780 -0
- sage/combinat/designs/orthogonal_arrays_find_recursive.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/designs/orthogonal_arrays_find_recursive.pyx +967 -0
- sage/combinat/designs/resolvable_bibd.py +815 -0
- sage/combinat/designs/steiner_quadruple_systems.py +1306 -0
- sage/combinat/designs/subhypergraph_search.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/designs/subhypergraph_search.pyx +530 -0
- sage/combinat/designs/twographs.py +306 -0
- sage/combinat/finite_state_machine.py +14874 -0
- sage/combinat/finite_state_machine_generators.py +2006 -0
- sage/combinat/graph_path.py +448 -0
- sage/combinat/interval_posets.py +3908 -0
- sage/combinat/nu_tamari_lattice.py +269 -0
- sage/combinat/ordered_tree.py +1446 -0
- sage/combinat/posets/all.py +46 -0
- sage/combinat/posets/bubble_shuffle.py +247 -0
- sage/combinat/posets/cartesian_product.py +493 -0
- sage/combinat/posets/d_complete.py +182 -0
- sage/combinat/posets/elements.py +273 -0
- sage/combinat/posets/forest.py +30 -0
- sage/combinat/posets/hasse_cython.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/posets/hasse_cython.pyx +174 -0
- sage/combinat/posets/hasse_diagram.py +3672 -0
- sage/combinat/posets/hochschild_lattice.py +158 -0
- sage/combinat/posets/incidence_algebras.py +794 -0
- sage/combinat/posets/lattices.py +5117 -0
- sage/combinat/posets/linear_extension_iterator.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/posets/linear_extension_iterator.pyx +292 -0
- sage/combinat/posets/linear_extensions.py +1037 -0
- sage/combinat/posets/mobile.py +275 -0
- sage/combinat/posets/moebius_algebra.py +776 -0
- sage/combinat/posets/poset_examples.py +2178 -0
- sage/combinat/posets/posets.py +9360 -0
- sage/combinat/rooted_tree.py +1070 -0
- sage/combinat/shard_order.py +239 -0
- sage/combinat/tamari_lattices.py +384 -0
- sage/combinat/yang_baxter_graph.py +923 -0
- sage/databases/all__sagemath_graphs.py +1 -0
- sage/databases/knotinfo_db.py +1231 -0
- sage/ext_data/all__sagemath_graphs.py +1 -0
- sage/ext_data/graphs/graph_plot_js.html +330 -0
- sage/ext_data/kenzo/CP2.txt +45 -0
- sage/ext_data/kenzo/CP3.txt +349 -0
- sage/ext_data/kenzo/CP4.txt +4774 -0
- sage/ext_data/kenzo/README.txt +49 -0
- sage/ext_data/kenzo/S4.txt +20 -0
- sage/graphs/all.py +42 -0
- sage/graphs/asteroidal_triples.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/asteroidal_triples.pyx +320 -0
- sage/graphs/base/all.py +1 -0
- sage/graphs/base/boost_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/boost_graph.pxd +106 -0
- sage/graphs/base/boost_graph.pyx +3045 -0
- sage/graphs/base/c_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/c_graph.pxd +106 -0
- sage/graphs/base/c_graph.pyx +5096 -0
- sage/graphs/base/dense_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/dense_graph.pxd +28 -0
- sage/graphs/base/dense_graph.pyx +801 -0
- sage/graphs/base/graph_backends.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/graph_backends.pxd +5 -0
- sage/graphs/base/graph_backends.pyx +797 -0
- sage/graphs/base/overview.py +85 -0
- sage/graphs/base/sparse_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/sparse_graph.pxd +90 -0
- sage/graphs/base/sparse_graph.pyx +1653 -0
- sage/graphs/base/static_dense_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/static_dense_graph.pxd +5 -0
- sage/graphs/base/static_dense_graph.pyx +1032 -0
- sage/graphs/base/static_sparse_backend.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/static_sparse_backend.pxd +27 -0
- sage/graphs/base/static_sparse_backend.pyx +1583 -0
- sage/graphs/base/static_sparse_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/static_sparse_graph.pxd +37 -0
- sage/graphs/base/static_sparse_graph.pyx +1375 -0
- sage/graphs/bipartite_graph.py +2732 -0
- sage/graphs/centrality.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/centrality.pyx +1038 -0
- sage/graphs/cographs.py +519 -0
- sage/graphs/comparability.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/comparability.pyx +851 -0
- sage/graphs/connectivity.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/connectivity.pxd +157 -0
- sage/graphs/connectivity.pyx +4813 -0
- sage/graphs/convexity_properties.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/convexity_properties.pxd +16 -0
- sage/graphs/convexity_properties.pyx +870 -0
- sage/graphs/digraph.py +4754 -0
- sage/graphs/digraph_generators.py +1993 -0
- sage/graphs/distances_all_pairs.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/distances_all_pairs.pxd +12 -0
- sage/graphs/distances_all_pairs.pyx +2938 -0
- sage/graphs/domination.py +1363 -0
- sage/graphs/dot2tex_utils.py +100 -0
- sage/graphs/edge_connectivity.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/edge_connectivity.pyx +1215 -0
- sage/graphs/generators/all.py +1 -0
- sage/graphs/generators/basic.py +1769 -0
- sage/graphs/generators/chessboard.py +538 -0
- sage/graphs/generators/classical_geometries.py +1611 -0
- sage/graphs/generators/degree_sequence.py +235 -0
- sage/graphs/generators/distance_regular.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/generators/distance_regular.pyx +2846 -0
- sage/graphs/generators/families.py +4759 -0
- sage/graphs/generators/intersection.py +565 -0
- sage/graphs/generators/platonic_solids.py +262 -0
- sage/graphs/generators/random.py +2623 -0
- sage/graphs/generators/smallgraphs.py +5741 -0
- sage/graphs/generators/world_map.py +724 -0
- sage/graphs/generic_graph.py +26867 -0
- sage/graphs/generic_graph_pyx.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/generic_graph_pyx.pxd +34 -0
- sage/graphs/generic_graph_pyx.pyx +1673 -0
- sage/graphs/genus.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/genus.pyx +622 -0
- sage/graphs/graph.py +9645 -0
- sage/graphs/graph_coloring.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_coloring.pyx +2284 -0
- sage/graphs/graph_database.py +1177 -0
- sage/graphs/graph_decompositions/all.py +1 -0
- sage/graphs/graph_decompositions/bandwidth.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/bandwidth.pyx +428 -0
- sage/graphs/graph_decompositions/clique_separators.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/clique_separators.pyx +616 -0
- sage/graphs/graph_decompositions/cutwidth.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/cutwidth.pyx +753 -0
- sage/graphs/graph_decompositions/fast_digraph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/fast_digraph.pxd +13 -0
- sage/graphs/graph_decompositions/fast_digraph.pyx +212 -0
- sage/graphs/graph_decompositions/graph_products.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/graph_products.pyx +508 -0
- sage/graphs/graph_decompositions/modular_decomposition.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/modular_decomposition.pxd +27 -0
- sage/graphs/graph_decompositions/modular_decomposition.pyx +1536 -0
- sage/graphs/graph_decompositions/slice_decomposition.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/slice_decomposition.pxd +18 -0
- sage/graphs/graph_decompositions/slice_decomposition.pyx +1106 -0
- sage/graphs/graph_decompositions/tree_decomposition.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/tree_decomposition.pxd +17 -0
- sage/graphs/graph_decompositions/tree_decomposition.pyx +1996 -0
- sage/graphs/graph_decompositions/vertex_separation.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/vertex_separation.pxd +5 -0
- sage/graphs/graph_decompositions/vertex_separation.pyx +1963 -0
- sage/graphs/graph_editor.py +82 -0
- sage/graphs/graph_generators.py +3314 -0
- sage/graphs/graph_generators_pyx.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_generators_pyx.pyx +95 -0
- sage/graphs/graph_input.py +812 -0
- sage/graphs/graph_latex.py +2064 -0
- sage/graphs/graph_list.py +410 -0
- sage/graphs/graph_plot.py +1756 -0
- sage/graphs/graph_plot_js.py +338 -0
- sage/graphs/hyperbolicity.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/hyperbolicity.pyx +1704 -0
- sage/graphs/hypergraph_generators.py +364 -0
- sage/graphs/independent_sets.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/independent_sets.pxd +13 -0
- sage/graphs/independent_sets.pyx +402 -0
- sage/graphs/isgci.py +1033 -0
- sage/graphs/isoperimetric_inequalities.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/isoperimetric_inequalities.pyx +489 -0
- sage/graphs/line_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/line_graph.pyx +743 -0
- sage/graphs/lovasz_theta.py +77 -0
- sage/graphs/matching.py +1633 -0
- sage/graphs/matching_covered_graph.py +3590 -0
- sage/graphs/orientations.py +1489 -0
- sage/graphs/partial_cube.py +459 -0
- sage/graphs/path_enumeration.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/path_enumeration.pyx +2040 -0
- sage/graphs/pq_trees.py +1129 -0
- sage/graphs/print_graphs.py +201 -0
- sage/graphs/schnyder.py +865 -0
- sage/graphs/spanning_tree.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/spanning_tree.pyx +1457 -0
- sage/graphs/strongly_regular_db.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/strongly_regular_db.pyx +3340 -0
- sage/graphs/traversals.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/traversals.pxd +9 -0
- sage/graphs/traversals.pyx +1872 -0
- sage/graphs/trees.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/trees.pxd +15 -0
- sage/graphs/trees.pyx +310 -0
- sage/graphs/tutte_polynomial.py +713 -0
- sage/graphs/views.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/views.pyx +794 -0
- sage/graphs/weakly_chordal.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/weakly_chordal.pyx +604 -0
- sage/groups/all__sagemath_graphs.py +1 -0
- sage/groups/perm_gps/all__sagemath_graphs.py +1 -0
- sage/groups/perm_gps/partn_ref/all__sagemath_graphs.py +1 -0
- sage/groups/perm_gps/partn_ref/refinement_graphs.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_graphs.pxd +38 -0
- sage/groups/perm_gps/partn_ref/refinement_graphs.pyx +1666 -0
- sage/knots/all.py +6 -0
- sage/knots/free_knotinfo_monoid.py +507 -0
- sage/knots/gauss_code.py +291 -0
- sage/knots/knot.py +682 -0
- sage/knots/knot_table.py +284 -0
- sage/knots/knotinfo.py +2900 -0
- sage/knots/link.py +4715 -0
- sage/sandpiles/all.py +13 -0
- sage/sandpiles/examples.py +225 -0
- sage/sandpiles/sandpile.py +6365 -0
- sage/topology/all.py +22 -0
- sage/topology/cell_complex.py +1214 -0
- sage/topology/cubical_complex.py +1976 -0
- sage/topology/delta_complex.py +1806 -0
- sage/topology/filtered_simplicial_complex.py +744 -0
- sage/topology/moment_angle_complex.py +823 -0
- sage/topology/simplicial_complex.py +5160 -0
- sage/topology/simplicial_complex_catalog.py +92 -0
- sage/topology/simplicial_complex_examples.py +1680 -0
- sage/topology/simplicial_complex_homset.py +205 -0
- sage/topology/simplicial_complex_morphism.py +836 -0
- sage/topology/simplicial_set.py +4102 -0
- sage/topology/simplicial_set_catalog.py +55 -0
- sage/topology/simplicial_set_constructions.py +2954 -0
- sage/topology/simplicial_set_examples.py +865 -0
- sage/topology/simplicial_set_morphism.py +1464 -0
@@ -0,0 +1,262 @@
|
|
1
|
+
# sage_setup: distribution = sagemath-graphs
|
2
|
+
r"""
|
3
|
+
1-skeletons of Platonic solids
|
4
|
+
|
5
|
+
The methods defined here appear in :mod:`sage.graphs.graph_generators`.
|
6
|
+
"""
|
7
|
+
# ****************************************************************************
|
8
|
+
#
|
9
|
+
# Copyright (C) 2006 Robert L. Miller <rlmillster@gmail.com>
|
10
|
+
# and Emily A. Kirkman
|
11
|
+
# Copyright (C) 2009 Michael C. Yurko <myurko@gmail.com>
|
12
|
+
#
|
13
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
14
|
+
# http://www.gnu.org/licenses/
|
15
|
+
# ****************************************************************************
|
16
|
+
|
17
|
+
# import from Sage library
|
18
|
+
from sage.graphs.graph import Graph
|
19
|
+
from math import sin, cos, pi
|
20
|
+
|
21
|
+
|
22
|
+
def TetrahedralGraph():
|
23
|
+
"""
|
24
|
+
Return a tetrahedral graph (with 4 nodes).
|
25
|
+
|
26
|
+
A tetrahedron is a 4-sided triangular pyramid. The tetrahedral graph
|
27
|
+
corresponds to the connectivity of the vertices of the tetrahedron. This
|
28
|
+
graph is equivalent to a wheel graph with 4 nodes and also a complete graph
|
29
|
+
on four nodes. (See examples below).
|
30
|
+
|
31
|
+
PLOTTING: The Tetrahedral graph should be viewed in 3 dimensions. We choose
|
32
|
+
to use a planar embedding of the graph. We hope to add rotatable,
|
33
|
+
3-dimensional viewing in the future. In such a case, a argument will be
|
34
|
+
added to select the desired layout.
|
35
|
+
|
36
|
+
EXAMPLES:
|
37
|
+
|
38
|
+
Construct and show a Tetrahedral graph::
|
39
|
+
|
40
|
+
sage: g = graphs.TetrahedralGraph()
|
41
|
+
sage: g.show() # long time # needs sage.plot
|
42
|
+
|
43
|
+
The following example requires networkx::
|
44
|
+
|
45
|
+
sage: import networkx as NX # needs networkx
|
46
|
+
|
47
|
+
Compare this Tetrahedral, Wheel(4), Complete(4), and the Tetrahedral plotted
|
48
|
+
with the spring-layout algorithm below in a Sage graphics array::
|
49
|
+
|
50
|
+
sage: # needs networkx sage.plot
|
51
|
+
sage: tetra_pos = graphs.TetrahedralGraph()
|
52
|
+
sage: tetra_spring = Graph(NX.tetrahedral_graph())
|
53
|
+
sage: wheel = graphs.WheelGraph(4)
|
54
|
+
sage: complete = graphs.CompleteGraph(4)
|
55
|
+
sage: g = [tetra_pos, tetra_spring, wheel, complete]
|
56
|
+
sage: j = []
|
57
|
+
sage: for i in range(2):
|
58
|
+
....: n = []
|
59
|
+
....: for m in range(2):
|
60
|
+
....: n.append(g[i + m].plot(vertex_size=50, vertex_labels=False))
|
61
|
+
....: j.append(n)
|
62
|
+
sage: G = graphics_array(j)
|
63
|
+
sage: G.show() # long time
|
64
|
+
"""
|
65
|
+
edges = [(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)]
|
66
|
+
pos = {0: (0, 0),
|
67
|
+
1: (0, 1),
|
68
|
+
2: (cos(3.5*pi/3), sin(3.5*pi/3)),
|
69
|
+
3: (cos(5.5*pi/3), sin(5.5*pi/3))}
|
70
|
+
return Graph(edges, name='Tetrahedron', pos=pos)
|
71
|
+
|
72
|
+
|
73
|
+
def HexahedralGraph():
|
74
|
+
"""
|
75
|
+
Return a hexahedral graph (with 8 nodes).
|
76
|
+
|
77
|
+
A regular hexahedron is a 6-sided cube. The hexahedral graph corresponds to
|
78
|
+
the connectivity of the vertices of the hexahedron. This graph is
|
79
|
+
equivalent to a 3-cube.
|
80
|
+
|
81
|
+
PLOTTING: The Hexahedral graph should be viewed in 3 dimensions. We choose
|
82
|
+
to use a planar embedding of the graph. We hope to add rotatable,
|
83
|
+
3-dimensional viewing in the future. In such a case, a argument will be
|
84
|
+
added to select the desired layout.
|
85
|
+
|
86
|
+
EXAMPLES:
|
87
|
+
|
88
|
+
Construct and show a Hexahedral graph::
|
89
|
+
|
90
|
+
sage: g = graphs.HexahedralGraph()
|
91
|
+
sage: g.show() # long time # needs sage.plot
|
92
|
+
|
93
|
+
Create several hexahedral graphs in a Sage graphics array. They will be
|
94
|
+
drawn differently due to the use of the spring-layout algorithm::
|
95
|
+
|
96
|
+
sage: # needs sage.plot
|
97
|
+
sage: g = []
|
98
|
+
sage: j = []
|
99
|
+
sage: for i in range(9):
|
100
|
+
....: k = graphs.HexahedralGraph()
|
101
|
+
....: g.append(k)
|
102
|
+
sage: for i in range(3):
|
103
|
+
....: n = []
|
104
|
+
....: for m in range(3):
|
105
|
+
....: n.append(g[3*i + m].plot(vertex_size=50, vertex_labels=False))
|
106
|
+
....: j.append(n)
|
107
|
+
sage: G = graphics_array(j)
|
108
|
+
sage: G.show() # long time
|
109
|
+
"""
|
110
|
+
adj = {0: [1, 3, 4], 1: [2, 5], 2: [3, 6], 3: [7], 4: [5, 7], 5: [6], 6: [7]}
|
111
|
+
pos = {
|
112
|
+
0: (0, 0),
|
113
|
+
1: (1, 0),
|
114
|
+
3: (0, 1),
|
115
|
+
2: (1, 1),
|
116
|
+
4: (.5, .5),
|
117
|
+
5: (1.5, .5),
|
118
|
+
7: (.5, 1.5),
|
119
|
+
6: (1.5, 1.5)
|
120
|
+
}
|
121
|
+
return Graph(adj, name='Hexahedron', pos=pos)
|
122
|
+
|
123
|
+
|
124
|
+
def OctahedralGraph():
|
125
|
+
"""
|
126
|
+
Return an Octahedral graph (with 6 nodes).
|
127
|
+
|
128
|
+
The regular octahedron is an 8-sided polyhedron with triangular faces. The
|
129
|
+
octahedral graph corresponds to the connectivity of the vertices of the
|
130
|
+
octahedron. It is the line graph of the tetrahedral graph. The octahedral is
|
131
|
+
symmetric, so the spring-layout algorithm will be very effective for
|
132
|
+
display.
|
133
|
+
|
134
|
+
PLOTTING: The Octahedral graph should be viewed in 3 dimensions. We choose
|
135
|
+
to use a planar embedding of the graph. We hope to add rotatable,
|
136
|
+
3-dimensional viewing in the future. In such a case, a argument will be
|
137
|
+
added to select the desired layout.
|
138
|
+
|
139
|
+
EXAMPLES:
|
140
|
+
|
141
|
+
Construct and show an Octahedral graph::
|
142
|
+
|
143
|
+
sage: g = graphs.OctahedralGraph()
|
144
|
+
sage: g.show() # long time # needs sage.plot
|
145
|
+
|
146
|
+
Create several octahedral graphs in a Sage graphics array They will be drawn
|
147
|
+
differently due to the use of the spring-layout algorithm::
|
148
|
+
|
149
|
+
sage: # needs sage.plot
|
150
|
+
sage: g = []
|
151
|
+
sage: j = []
|
152
|
+
sage: for i in range(9):
|
153
|
+
....: k = graphs.OctahedralGraph()
|
154
|
+
....: g.append(k)
|
155
|
+
sage: for i in range(3):
|
156
|
+
....: n = []
|
157
|
+
....: for m in range(3):
|
158
|
+
....: n.append(g[3*i + m].plot(vertex_size=50, vertex_labels=False))
|
159
|
+
....: j.append(n)
|
160
|
+
sage: G = graphics_array(j)
|
161
|
+
sage: G.show() # long time
|
162
|
+
"""
|
163
|
+
adj = {0: [1, 2, 3, 4], 1: [2, 3, 5], 2: [4, 5], 3: [4, 5], 4: [5]}
|
164
|
+
G = Graph(adj, format='dict_of_lists', name='Octahedron')
|
165
|
+
G._circle_embedding([0, 1, 2], radius=5, angle=pi/2)
|
166
|
+
G._circle_embedding([4, 3, 5], radius=1, angle=pi/6)
|
167
|
+
return G
|
168
|
+
|
169
|
+
|
170
|
+
def IcosahedralGraph():
|
171
|
+
"""
|
172
|
+
Return an Icosahedral graph (with 12 nodes).
|
173
|
+
|
174
|
+
The regular icosahedron is a 20-sided triangular polyhedron. The icosahedral
|
175
|
+
graph corresponds to the connectivity of the vertices of the icosahedron. It
|
176
|
+
is dual to the dodecahedral graph. The icosahedron is symmetric, so the
|
177
|
+
spring-layout algorithm will be very effective for display.
|
178
|
+
|
179
|
+
PLOTTING: The Icosahedral graph should be viewed in 3 dimensions. We choose
|
180
|
+
to use a planar embedding of the graph. We hope to add rotatable,
|
181
|
+
3-dimensional viewing in the future. In such a case, a argument will be
|
182
|
+
added to select the desired layout.
|
183
|
+
|
184
|
+
EXAMPLES:
|
185
|
+
|
186
|
+
Construct and show an Octahedral graph::
|
187
|
+
|
188
|
+
sage: g = graphs.IcosahedralGraph()
|
189
|
+
sage: g.show() # long time # needs sage.plot
|
190
|
+
|
191
|
+
Create several icosahedral graphs in a Sage graphics array. They will be
|
192
|
+
drawn differently due to the use of the spring-layout algorithm::
|
193
|
+
|
194
|
+
sage: # needs sage.plot
|
195
|
+
sage: g = []
|
196
|
+
sage: j = []
|
197
|
+
sage: for i in range(9):
|
198
|
+
....: k = graphs.IcosahedralGraph()
|
199
|
+
....: g.append(k)
|
200
|
+
sage: for i in range(3):
|
201
|
+
....: n = []
|
202
|
+
....: for m in range(3):
|
203
|
+
....: n.append(g[3*i + m].plot(vertex_size=50, vertex_labels=False))
|
204
|
+
....: j.append(n)
|
205
|
+
sage: G = graphics_array(j)
|
206
|
+
sage: G.show() # long time
|
207
|
+
"""
|
208
|
+
adj = {0: [1, 5, 7, 8, 11], 1: [2, 5, 6, 8], 2: [3, 6, 8, 9],
|
209
|
+
3: [4, 6, 9, 10], 4: [5, 6, 10, 11], 5: [6, 11],
|
210
|
+
7: [8, 9, 10, 11], 8: [9], 9: [10], 10: [11]}
|
211
|
+
G = Graph(adj, format='dict_of_lists', name='Icosahedron')
|
212
|
+
G._circle_embedding([2, 8, 7, 11, 4, 6], radius=5, angle=pi/6)
|
213
|
+
G._circle_embedding([1, 9, 0, 10, 5, 3], radius=2, angle=pi/6)
|
214
|
+
return G
|
215
|
+
|
216
|
+
|
217
|
+
def DodecahedralGraph():
|
218
|
+
"""
|
219
|
+
Return a Dodecahedral graph (with 20 nodes).
|
220
|
+
|
221
|
+
The dodecahedral graph is cubic symmetric, so the spring-layout algorithm
|
222
|
+
will be very effective for display. It is dual to the icosahedral graph.
|
223
|
+
|
224
|
+
PLOTTING: The Dodecahedral graph should be viewed in 3 dimensions. We
|
225
|
+
choose to use a planar embedding of the graph. We hope to add rotatable,
|
226
|
+
3-dimensional viewing in the future. In such a case, a argument will be
|
227
|
+
added to select the desired layout.
|
228
|
+
|
229
|
+
EXAMPLES:
|
230
|
+
|
231
|
+
Construct and show a Dodecahedral graph::
|
232
|
+
|
233
|
+
sage: g = graphs.DodecahedralGraph()
|
234
|
+
sage: g.show() # long time # needs sage.plot
|
235
|
+
|
236
|
+
Create several dodecahedral graphs in a Sage graphics array They will be
|
237
|
+
drawn differently due to the use of the spring-layout algorithm::
|
238
|
+
|
239
|
+
sage: # needs sage.plot
|
240
|
+
sage: g = []
|
241
|
+
sage: j = []
|
242
|
+
sage: for i in range(9):
|
243
|
+
....: k = graphs.DodecahedralGraph()
|
244
|
+
....: g.append(k)
|
245
|
+
sage: for i in range(3):
|
246
|
+
....: n = []
|
247
|
+
....: for m in range(3):
|
248
|
+
....: n.append(g[3*i + m].plot(vertex_size=50, vertex_labels=False))
|
249
|
+
....: j.append(n)
|
250
|
+
sage: G = graphics_array(j)
|
251
|
+
sage: G.show() # long time
|
252
|
+
"""
|
253
|
+
adj = {0: [1, 10, 19], 1: [2, 8], 2: [3, 6], 3: [4, 19], 4: [5, 17],
|
254
|
+
5: [6, 15], 6: [7], 7: [8, 14], 8: [9], 9: [10, 13], 10: [11],
|
255
|
+
11: [12, 18], 12: [13, 16], 13: [14], 14: [15], 15: [16], 16: [17],
|
256
|
+
17: [18], 18: [19]}
|
257
|
+
G = Graph(adj, format='dict_of_lists', name='Dodecahedron')
|
258
|
+
G._circle_embedding([19, 0, 1, 2, 3], radius=7, angle=pi/10)
|
259
|
+
G._circle_embedding([18, 10, 8, 6, 4], radius=4.7, angle=pi/10)
|
260
|
+
G._circle_embedding([11, 9, 7, 5, 17], radius=3.8, angle=3*pi/10)
|
261
|
+
G._circle_embedding([12, 13, 14, 15, 16], radius=1.5, angle=3*pi/10)
|
262
|
+
return G
|