Two-graphs¶
A two-graph on \(n\) points is a family \(T \subset \binom {[n]}{3}\)
of \(3\)-sets, such that any \(4\)-set \(S\subset [n]\) of size four
contains an even number of elements of \(T\). Any graph \(([n],E)\)
gives rise to a two-graph
\(T(E)=\{t \in \binom {[n]}{3} : \left| \binom {t}{2} \cap E \right|\ odd \}\),
and any two graphs with the same two-graph can be obtained one
from the other by Seidel switching.
This defines an equivalence relation on the graphs on \([n]\),
called Seidel switching equivalence.
Conversely, given a two-graph \(T\), one can construct a graph
\(\Gamma\) in the corresponding Seidel switching class with an
isolated vertex \(w\). The graph \(\Gamma \setminus w\) is called
the descendant of \(T\) w.r.t. \(v\).
\(T\) is called regular if each two-subset of \([n]\) is contained in the same number alpha of triples of \(T\).
This module implements a direct construction of a two-graph from a list of triples, construction of descendant graphs, regularity checking, and other things such as constructing the complement two-graph, cf. [BH2012].
AUTHORS:
- Dima Pasechnik (Aug 2015) 
Index¶
This module’s methods are the following:
| Test if  | |
| Return the complement of  | |
| Return the descendant graph at \(w\) | 
This module’s functions are the following:
| Construct Taylor’s two-graph for \(U_3(q)\) | |
| Check that the incidence system is a two-graph | |
| Return the descendant graph w.r.t. a given vertex of the two-graph of a given graph | 
Methods¶
- class sage.combinat.designs.twographs.TwoGraph(points=None, blocks=None, incidence_matrix=None, name=None, check=False, copy=True)[source]¶
- Bases: - IncidenceStructure- Two-graphs class. - A two-graph on \(n\) points is a 3-uniform hypergraph, i.e. a family \(T \subset \binom {[n]}{3}\) of \(3\)-sets, such that any \(4\)-set \(S\subset [n]\) of size four contains an even number of elements of \(T\). For more information, see the documentation of the - twographsmodule.- complement()[source]¶
- The two-graph which is the complement of - self.- That is, the two-graph consisting exactly of triples not in - self. Note that this is different from- complementof the- parent class.- EXAMPLES: - sage: p = graphs.CompleteGraph(8).line_graph().twograph() # needs sage.modules sage: pc = p.complement(); pc # needs sage.modules Incidence structure with 28 points and 1260 blocks - >>> from sage.all import * >>> p = graphs.CompleteGraph(Integer(8)).line_graph().twograph() # needs sage.modules >>> pc = p.complement(); pc # needs sage.modules Incidence structure with 28 points and 1260 blocks 
 - descendant(v)[source]¶
- The descendant - graphat- v.- The - switching class of graphscorresponding to- selfcontains a graph- Dwith- vits own connected component; removing- vfrom- D, one obtains the descendant graph of- selfat- v, which is constructed by this method.- INPUT: - v– an element of- ground_set()
 - EXAMPLES: - sage: p = graphs.PetersenGraph().twograph().descendant(0) # needs sage.modules sage: p.is_strongly_regular(parameters=True) # needs sage.modules (9, 4, 1, 2) - >>> from sage.all import * >>> p = graphs.PetersenGraph().twograph().descendant(Integer(0)) # needs sage.modules >>> p.is_strongly_regular(parameters=True) # needs sage.modules (9, 4, 1, 2) 
 - is_regular_twograph(alpha=False)[source]¶
- Test if the - TwoGraphis regular, i.e. is a 2-design.- Namely, each pair of elements of - ground_set()is contained in exactly- alphatriples.- INPUT: - alpha– boolean (default:- False); return the value of- alpha, if possible
 - EXAMPLES: - sage: # needs sage.modules sage: p = graphs.PetersenGraph().twograph() sage: p.is_regular_twograph(alpha=True) 4 sage: p.is_regular_twograph() True sage: p = graphs.PathGraph(5).twograph() sage: p.is_regular_twograph(alpha=True) False sage: p.is_regular_twograph() False - >>> from sage.all import * >>> # needs sage.modules >>> p = graphs.PetersenGraph().twograph() >>> p.is_regular_twograph(alpha=True) 4 >>> p.is_regular_twograph() True >>> p = graphs.PathGraph(Integer(5)).twograph() >>> p.is_regular_twograph(alpha=True) False >>> p.is_regular_twograph() False 
 
- sage.combinat.designs.twographs.is_twograph(T)[source]¶
- Check whether the incidence system \(T\) is a two-graph. - INPUT: - T– an- incidence structure
 - EXAMPLES: - a two-graph from a graph: - sage: from sage.combinat.designs.twographs import (is_twograph, TwoGraph) sage: p = graphs.PetersenGraph().twograph() # needs sage.modules sage: is_twograph(p) # needs sage.modules True - >>> from sage.all import * >>> from sage.combinat.designs.twographs import (is_twograph, TwoGraph) >>> p = graphs.PetersenGraph().twograph() # needs sage.modules >>> is_twograph(p) # needs sage.modules True - a non-regular 2-uniform hypergraph which is a two-graph: - sage: is_twograph(TwoGraph([[1,2,3],[1,2,4]])) True - >>> from sage.all import * >>> is_twograph(TwoGraph([[Integer(1),Integer(2),Integer(3)],[Integer(1),Integer(2),Integer(4)]])) True 
- sage.combinat.designs.twographs.taylor_twograph(q)[source]¶
- Constructing Taylor’s two-graph for \(U_3(q)\), \(q\) odd prime power. - The Taylor’s two-graph \(T\) has the \(q^3+1\) points of the projective plane over \(F_{q^2}\) singular w.r.t. the non-degenerate Hermitean form \(S\) preserved by \(U_3(q)\) as its ground set; the triples are \(\{x,y,z\}\) satisfying the condition that \(S(x,y)S(y,z)S(z,x)\) is square (respectively non-square) if \(q \cong 1 \mod 4\) (respectively if \(q \cong 3 \mod 4\)). See §7E of [BL1984]. - There is also a \(2-(q^3+1,q+1,1)\)-design on these \(q^3+1\) points, known as the unital of order \(q\), also invariant under \(U_3(q)\). - INPUT: - q– a power of an odd prime
 - EXAMPLES: - sage: from sage.combinat.designs.twographs import taylor_twograph sage: T = taylor_twograph(3); T # needs sage.rings.finite_rings Incidence structure with 28 points and 1260 blocks - >>> from sage.all import * >>> from sage.combinat.designs.twographs import taylor_twograph >>> T = taylor_twograph(Integer(3)); T # needs sage.rings.finite_rings Incidence structure with 28 points and 1260 blocks 
- sage.combinat.designs.twographs.twograph_descendant(G, v, name=None)[source]¶
- Return the descendant graph w.r.t. vertex \(v\) of the two-graph of \(G\). - In the - switching classof \(G\), construct a graph \(\Delta\) with \(v\) an isolated vertex, and return the subgraph \(\Delta \setminus v\). It is equivalent to, although much faster than, computing the- TwoGraph.descendant()of- two-graph of G, as the intermediate two-graph is not constructed.- INPUT: - G– a- graph
- v– a vertex of- G
- name– (default:- None) no name, otherwise derive from the construction
 - EXAMPLES: - one of s.r.g.’s from the - database:- sage: from sage.combinat.designs.twographs import twograph_descendant sage: A = graphs.strongly_regular_graph(280,135,70) # optional - gap_package_design internet sage: twograph_descendant(A, 0).is_strongly_regular(parameters=True) # optional - gap_package_design internet (279, 150, 85, 75) - >>> from sage.all import * >>> from sage.combinat.designs.twographs import twograph_descendant >>> A = graphs.strongly_regular_graph(Integer(280),Integer(135),Integer(70)) # optional - gap_package_design internet >>> twograph_descendant(A, Integer(0)).is_strongly_regular(parameters=True) # optional - gap_package_design internet (279, 150, 85, 75)