intersection_array

intersection_array#

graph_tool.structure.intersection_array(g)[git][source]#

Return the intersection array of a distance-regular graph.

Parameters:
gGraph

Graph to be used. Edge directions are ignored.

Returns:
bnumpy.ndarray or None

The numbers \(b_0, \dots, b_{d-1}\), or None if the graph is not distance-regular.

cnumpy.ndarray

The numbers \(c_1, \dots, c_d\). Only returned if the graph is distance-regular.

See also

is_distance_regular

Test for distance-regular graphs

global_parameters

Global parameters from the intersection array

is_strongly_regular

Test 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