intersection_array#
- graph_tool.structure.intersection_array(g)[git][source]#
Return the intersection array of a distance-regular graph.
- Parameters:
- g
Graph Graph to be used. Edge directions are ignored.
- g
- Returns:
- b
numpy.ndarrayorNone The numbers \(b_0, \dots, b_{d-1}\), or
Noneif the graph is not distance-regular.- c
numpy.ndarray The numbers \(c_1, \dots, c_d\). Only returned if the graph is distance-regular.
- b
See also
is_distance_regularTest for distance-regular graphs
global_parametersGlobal parameters from the intersection array
is_strongly_regularTest for strongly regular graphs
Notes
A connected graph of diameter \(d\) is distance-regular [brouwer-distance-1989] if, for every pair of vertices \(u, v\) at distance \(i\), the number \(c_i\) of neighbors of \(v\) at distance \(i-1\) from \(u\), and the number \(b_i\) of those at distance \(i+1\), depend only on \(i\). They are counted after a breadth-first search from every vertex, in parallel, in time \(O(VE)\).
References
[brouwer-distance-1989]Andries E. Brouwer, Arjeh M. Cohen and Arnold Neumaier, “Distance-Regular Graphs”, Springer (1989), DOI: 10.1007/978-3-642-74341-2 [sci-hub, @tor]
Examples
>>> g = gt.lattice([2, 2, 2]) >>> print(gt.intersection_array(g)) (array([3, 2, 1]), array([1, 2, 3])) >>> print(gt.intersection_array(gt.lattice([3, 3]))) None