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,306 @@
|
|
1
|
+
# sage_setup: distribution = sagemath-graphs
|
2
|
+
r"""
|
3
|
+
Two-graphs
|
4
|
+
|
5
|
+
A two-graph on `n` points is a family `T \subset \binom {[n]}{3}`
|
6
|
+
of `3`-sets, such that any `4`-set `S\subset [n]` of size four
|
7
|
+
contains an even number of elements of `T`. Any graph `([n],E)`
|
8
|
+
gives rise to a two-graph
|
9
|
+
`T(E)=\{t \in \binom {[n]}{3} : \left| \binom {t}{2} \cap E \right|\ odd \}`,
|
10
|
+
and any two graphs with the same two-graph can be obtained one
|
11
|
+
from the other by :meth:`Seidel switching <Graph.seidel_switching>`.
|
12
|
+
This defines an equivalence relation on the graphs on `[n]`,
|
13
|
+
called Seidel switching equivalence.
|
14
|
+
Conversely, given a two-graph `T`, one can construct a graph
|
15
|
+
`\Gamma` in the corresponding Seidel switching class with an
|
16
|
+
isolated vertex `w`. The graph `\Gamma \setminus w` is called
|
17
|
+
the :meth:`descendant <TwoGraph.descendant>` of `T` w.r.t. `v`.
|
18
|
+
|
19
|
+
`T` is called regular if each two-subset of `[n]` is contained
|
20
|
+
in the same number alpha of triples of `T`.
|
21
|
+
|
22
|
+
This module implements a direct construction of a two-graph from a list of
|
23
|
+
triples, construction of descendant graphs, regularity checking, and other
|
24
|
+
things such as constructing the complement two-graph, cf. [BH2012]_.
|
25
|
+
|
26
|
+
AUTHORS:
|
27
|
+
|
28
|
+
- Dima Pasechnik (Aug 2015)
|
29
|
+
|
30
|
+
Index
|
31
|
+
-----
|
32
|
+
|
33
|
+
This module's methods are the following:
|
34
|
+
|
35
|
+
.. csv-table::
|
36
|
+
:class: contentstable
|
37
|
+
:widths: 30, 70
|
38
|
+
:delim: |
|
39
|
+
|
40
|
+
:meth:`~TwoGraph.is_regular_twograph` | Test if ``self`` is a regular two-graph, i.e. a 2-design
|
41
|
+
:meth:`~TwoGraph.complement` | Return the complement of ``self``
|
42
|
+
:meth:`~TwoGraph.descendant` | Return the descendant graph at `w`
|
43
|
+
|
44
|
+
This module's functions are the following:
|
45
|
+
|
46
|
+
.. csv-table::
|
47
|
+
:class: contentstable
|
48
|
+
:widths: 30, 70
|
49
|
+
:delim: |
|
50
|
+
|
51
|
+
:func:`~taylor_twograph` | Construct Taylor's two-graph for `U_3(q)`
|
52
|
+
:func:`~is_twograph` | Check that the incidence system is a two-graph
|
53
|
+
:func:`~twograph_descendant` | Return the descendant graph w.r.t. a given vertex of the two-graph of a given graph
|
54
|
+
|
55
|
+
Methods
|
56
|
+
---------
|
57
|
+
"""
|
58
|
+
|
59
|
+
from sage.combinat.designs.incidence_structures import IncidenceStructure
|
60
|
+
from itertools import combinations
|
61
|
+
|
62
|
+
|
63
|
+
class TwoGraph(IncidenceStructure):
|
64
|
+
r"""
|
65
|
+
Two-graphs class.
|
66
|
+
|
67
|
+
A two-graph on `n` points is a 3-uniform hypergraph, i.e. a family `T
|
68
|
+
\subset \binom {[n]}{3}` of `3`-sets, such that any `4`-set `S\subset [n]`
|
69
|
+
of size four contains an even number of elements of `T`. For more
|
70
|
+
information, see the documentation of the
|
71
|
+
:mod:`~sage.combinat.designs.twographs` module.
|
72
|
+
"""
|
73
|
+
def __init__(self, points=None, blocks=None, incidence_matrix=None,
|
74
|
+
name=None, check=False, copy=True):
|
75
|
+
r"""
|
76
|
+
Constructor of the class.
|
77
|
+
|
78
|
+
TESTS::
|
79
|
+
|
80
|
+
sage: from sage.combinat.designs.twographs import TwoGraph
|
81
|
+
sage: TwoGraph([[1,2]])
|
82
|
+
Incidence structure with 2 points and 1 blocks
|
83
|
+
sage: TwoGraph([[1,2]], check=True)
|
84
|
+
Traceback (most recent call last):
|
85
|
+
...
|
86
|
+
AssertionError: the structure is not a 2-graph!
|
87
|
+
sage: p = graphs.PetersenGraph().twograph() # needs sage.modules
|
88
|
+
sage: TwoGraph(p, check=True) # needs sage.modules
|
89
|
+
Incidence structure with 10 points and 60 blocks
|
90
|
+
"""
|
91
|
+
IncidenceStructure.__init__(self, points=points, blocks=blocks,
|
92
|
+
incidence_matrix=incidence_matrix,
|
93
|
+
name=name, check=False, copy=copy)
|
94
|
+
if check: # it is a very slow, O(|points|^4), test...
|
95
|
+
assert is_twograph(self), "the structure is not a 2-graph!"
|
96
|
+
|
97
|
+
def is_regular_twograph(self, alpha=False):
|
98
|
+
r"""
|
99
|
+
Test if the :class:`TwoGraph` is regular, i.e. is a 2-design.
|
100
|
+
|
101
|
+
Namely, each pair of elements of :meth:`ground_set` is contained in
|
102
|
+
exactly ``alpha`` triples.
|
103
|
+
|
104
|
+
INPUT:
|
105
|
+
|
106
|
+
- ``alpha`` -- boolean (default: ``False``); return the value of
|
107
|
+
``alpha``, if possible
|
108
|
+
|
109
|
+
EXAMPLES::
|
110
|
+
|
111
|
+
sage: # needs sage.modules
|
112
|
+
sage: p = graphs.PetersenGraph().twograph()
|
113
|
+
sage: p.is_regular_twograph(alpha=True)
|
114
|
+
4
|
115
|
+
sage: p.is_regular_twograph()
|
116
|
+
True
|
117
|
+
sage: p = graphs.PathGraph(5).twograph()
|
118
|
+
sage: p.is_regular_twograph(alpha=True)
|
119
|
+
False
|
120
|
+
sage: p.is_regular_twograph()
|
121
|
+
False
|
122
|
+
"""
|
123
|
+
r, (_, _, _, a) = self.is_t_design(t=2, k=3, return_parameters=True)
|
124
|
+
if r and alpha:
|
125
|
+
return a
|
126
|
+
return r
|
127
|
+
|
128
|
+
def descendant(self, v):
|
129
|
+
"""
|
130
|
+
The descendant :class:`graph <sage.graphs.graph.Graph>` at ``v``.
|
131
|
+
|
132
|
+
The :mod:`switching class of graphs <sage.combinat.designs.twographs>`
|
133
|
+
corresponding to ``self`` contains a graph ``D`` with ``v`` its own connected
|
134
|
+
component; removing ``v`` from ``D``, one obtains the descendant graph of
|
135
|
+
``self`` at ``v``, which is constructed by this method.
|
136
|
+
|
137
|
+
INPUT:
|
138
|
+
|
139
|
+
- ``v`` -- an element of :meth:`ground_set`
|
140
|
+
|
141
|
+
EXAMPLES::
|
142
|
+
|
143
|
+
sage: p = graphs.PetersenGraph().twograph().descendant(0) # needs sage.modules
|
144
|
+
sage: p.is_strongly_regular(parameters=True) # needs sage.modules
|
145
|
+
(9, 4, 1, 2)
|
146
|
+
"""
|
147
|
+
from sage.graphs.graph import Graph
|
148
|
+
return Graph([[z for z in x if z != v]
|
149
|
+
for x in self.blocks() if v in x])
|
150
|
+
|
151
|
+
def complement(self):
|
152
|
+
"""
|
153
|
+
The two-graph which is the complement of ``self``.
|
154
|
+
|
155
|
+
That is, the two-graph consisting exactly of triples not in ``self``.
|
156
|
+
Note that this is different from :meth:`complement
|
157
|
+
<sage.combinat.designs.incidence_structures.IncidenceStructure.complement>`
|
158
|
+
of the :class:`parent class
|
159
|
+
<sage.combinat.designs.incidence_structures.IncidenceStructure>`.
|
160
|
+
|
161
|
+
EXAMPLES::
|
162
|
+
|
163
|
+
sage: p = graphs.CompleteGraph(8).line_graph().twograph() # needs sage.modules
|
164
|
+
sage: pc = p.complement(); pc # needs sage.modules
|
165
|
+
Incidence structure with 28 points and 1260 blocks
|
166
|
+
|
167
|
+
TESTS::
|
168
|
+
|
169
|
+
sage: from sage.combinat.designs.twographs import is_twograph
|
170
|
+
sage: is_twograph(pc) # needs sage.modules
|
171
|
+
True
|
172
|
+
"""
|
173
|
+
return super().complement(uniform=True)
|
174
|
+
|
175
|
+
|
176
|
+
def taylor_twograph(q):
|
177
|
+
r"""
|
178
|
+
Constructing Taylor's two-graph for `U_3(q)`, `q` odd prime power.
|
179
|
+
|
180
|
+
The Taylor's two-graph `T` has the `q^3+1` points of the projective plane over `F_{q^2}`
|
181
|
+
singular w.r.t. the non-degenerate Hermitean form `S` preserved by `U_3(q)` as its ground set;
|
182
|
+
the triples are `\{x,y,z\}` satisfying the condition that `S(x,y)S(y,z)S(z,x)` is square
|
183
|
+
(respectively non-square) if `q \cong 1 \mod 4` (respectively if `q \cong 3 \mod 4`).
|
184
|
+
See §7E of [BL1984]_.
|
185
|
+
|
186
|
+
There is also a `2-(q^3+1,q+1,1)`-design on these `q^3+1` points, known as the unital of
|
187
|
+
order `q`, also invariant under `U_3(q)`.
|
188
|
+
|
189
|
+
INPUT:
|
190
|
+
|
191
|
+
- ``q`` -- a power of an odd prime
|
192
|
+
|
193
|
+
EXAMPLES::
|
194
|
+
|
195
|
+
sage: from sage.combinat.designs.twographs import taylor_twograph
|
196
|
+
sage: T = taylor_twograph(3); T # needs sage.rings.finite_rings
|
197
|
+
Incidence structure with 28 points and 1260 blocks
|
198
|
+
"""
|
199
|
+
from sage.graphs.generators.classical_geometries import TaylorTwographSRG
|
200
|
+
return TaylorTwographSRG(q).twograph()
|
201
|
+
|
202
|
+
|
203
|
+
def is_twograph(T) -> bool:
|
204
|
+
r"""
|
205
|
+
Check whether the incidence system `T` is a two-graph.
|
206
|
+
|
207
|
+
INPUT:
|
208
|
+
|
209
|
+
- ``T`` -- an :class:`incidence structure <sage.combinat.designs.IncidenceStructure>`
|
210
|
+
|
211
|
+
EXAMPLES:
|
212
|
+
|
213
|
+
a two-graph from a graph::
|
214
|
+
|
215
|
+
sage: from sage.combinat.designs.twographs import (is_twograph, TwoGraph)
|
216
|
+
sage: p = graphs.PetersenGraph().twograph() # needs sage.modules
|
217
|
+
sage: is_twograph(p) # needs sage.modules
|
218
|
+
True
|
219
|
+
|
220
|
+
a non-regular 2-uniform hypergraph which is a two-graph::
|
221
|
+
|
222
|
+
sage: is_twograph(TwoGraph([[1,2,3],[1,2,4]]))
|
223
|
+
True
|
224
|
+
|
225
|
+
TESTS:
|
226
|
+
|
227
|
+
wrong size of blocks::
|
228
|
+
|
229
|
+
sage: is_twograph(designs.projective_plane(3)) # needs sage.schemes
|
230
|
+
False
|
231
|
+
|
232
|
+
a triple system which is not a two-graph::
|
233
|
+
|
234
|
+
sage: is_twograph(designs.projective_plane(2)) # needs sage.schemes
|
235
|
+
False
|
236
|
+
"""
|
237
|
+
if not T.is_uniform(3):
|
238
|
+
return False
|
239
|
+
|
240
|
+
# A structure for a fast triple existence check
|
241
|
+
v_to_blocks = {v: set() for v in range(T.num_points())}
|
242
|
+
for B in T._blocks:
|
243
|
+
B = frozenset(B)
|
244
|
+
for x in B:
|
245
|
+
v_to_blocks[x].add(B)
|
246
|
+
|
247
|
+
def has_triple(x_y_z) -> bool:
|
248
|
+
x, y, z = x_y_z
|
249
|
+
return bool(v_to_blocks[x] & v_to_blocks[y] & v_to_blocks[z])
|
250
|
+
|
251
|
+
# Check that every quadruple contains an even number of triples
|
252
|
+
for quad in combinations(range(T.num_points()), 4):
|
253
|
+
if sum(map(has_triple, combinations(quad, 3))) % 2:
|
254
|
+
return False
|
255
|
+
|
256
|
+
return True
|
257
|
+
|
258
|
+
|
259
|
+
def twograph_descendant(G, v, name=None):
|
260
|
+
r"""
|
261
|
+
Return the descendant graph w.r.t. vertex `v` of the two-graph of `G`.
|
262
|
+
|
263
|
+
In the :mod:`switching class <sage.combinat.designs.twographs>` of `G`,
|
264
|
+
construct a graph `\Delta` with `v` an isolated vertex, and return the subgraph
|
265
|
+
`\Delta \setminus v`. It is equivalent to, although much faster than, computing the
|
266
|
+
:meth:`TwoGraph.descendant` of :meth:`two-graph of G <sage.graphs.graph.Graph.twograph>`, as the
|
267
|
+
intermediate two-graph is not constructed.
|
268
|
+
|
269
|
+
INPUT:
|
270
|
+
|
271
|
+
- ``G`` -- a :class:`graph <sage.graphs.graph.Graph>`
|
272
|
+
|
273
|
+
- ``v`` -- a vertex of ``G``
|
274
|
+
|
275
|
+
- ``name`` -- (default: ``None``) no name, otherwise derive from the construction
|
276
|
+
|
277
|
+
EXAMPLES:
|
278
|
+
|
279
|
+
one of s.r.g.'s from the :mod:`database <sage.graphs.strongly_regular_db>`::
|
280
|
+
|
281
|
+
sage: from sage.combinat.designs.twographs import twograph_descendant
|
282
|
+
sage: A = graphs.strongly_regular_graph(280,135,70) # optional - gap_package_design internet
|
283
|
+
sage: twograph_descendant(A, 0).is_strongly_regular(parameters=True) # optional - gap_package_design internet
|
284
|
+
(279, 150, 85, 75)
|
285
|
+
|
286
|
+
TESTS::
|
287
|
+
|
288
|
+
sage: T8 = graphs.CompleteGraph(8).line_graph()
|
289
|
+
sage: v = T8.vertices(sort=True)[0]
|
290
|
+
sage: twograph_descendant(T8, v) == T8.twograph().descendant(v) # needs sage.modules
|
291
|
+
True
|
292
|
+
sage: twograph_descendant(T8, v).is_strongly_regular(parameters=True)
|
293
|
+
(27, 16, 10, 8)
|
294
|
+
sage: p = graphs.PetersenGraph()
|
295
|
+
sage: twograph_descendant(p, 5)
|
296
|
+
Graph on 9 vertices
|
297
|
+
sage: twograph_descendant(p, 5, name=True)
|
298
|
+
descendant of Petersen graph at 5: Graph on 9 vertices
|
299
|
+
"""
|
300
|
+
G = G.seidel_switching(G.neighbors(v), inplace=False)
|
301
|
+
G.delete_vertex(v)
|
302
|
+
if name:
|
303
|
+
G.name('descendant of ' + G.name() + ' at ' + str(v))
|
304
|
+
else:
|
305
|
+
G.name('')
|
306
|
+
return G
|