beta_skeleton

Contents

beta_skeleton#

graph_tool.generation.beta_skeleton(points, beta=1, kind='lune')[git][source]#

Return the \(\beta\)-skeleton of a set of points.

Parameters:
pointstwo-dimensional array

Coordinates of the points, as rows, without duplicates.

betafloat (optional, default: 1)

Parameter \(\beta > 0\) of the skeleton.

kindstr (optional, default: "lune")

Kind of region, "lune" or "circle".

Returns:
gGraph

The skeleton.

posVertexPropertyMap

Positions of the vertices.

See also

gabriel_graph

The skeleton for \(\beta = 1\)

relative_neighborhood_graph

The skeleton for \(\beta = 2\)

triangulation

Delaunay triangulation

Notes

In the \(\beta\)-skeleton (beta skeleton) [kirkpatrick-framework-1985], two points \(p\) and \(q\) at distance \(d\) are adjacent if no other point lies in their (closed) region, which for \(\beta \ge 1\) and kind="lune" is the intersection of the balls of radius \(\beta d/2\) centered at \((1-\beta/2)p+(\beta/2)q\) and \((\beta/2)p+(1-\beta/2)q\), and otherwise (for \(\beta < 1\), or kind="circle") the set of points \(r\) from which the segment \(pq\) is seen under an angle \(\angle prq \ge \theta\), with \(\theta = \pi-\arcsin\beta\) for \(\beta \le 1\) and \(\theta = \arcsin(1/\beta)\) for \(\beta \ge 1\). In two dimensions, the latter is the union of the two disks of diameter \(\beta d\) whose boundaries pass through \(p\) and \(q\), and the intersection of two such disks of diameter \(d/\beta\) for \(\beta < 1\). Both kinds give the Gabriel graph for \(\beta = 1\), and larger values of \(\beta\) give larger regions and sparser graphs.

For \(\beta \ge 1\) and points in two or three dimensions, the skeleton is a subgraph of the Delaunay triangulation (see triangulation()), whose edges are the candidates; otherwise all pairs of points are candidates. The algorithm takes time \(O(N\log N)\) for typical sets of points in the first case, and \(O(N^2\log N)\) in the second.

References

[kirkpatrick-framework-1985]

David G. Kirkpatrick and John D. Radke, “A framework for computational morphology”, Machine Intelligence and Pattern Recognition 2, 217-248 (1985), DOI: 10.1016/B978-0-444-87806-9.50013-X [sci-hub, @tor]

Examples

>>> points = np.random.random((500, 2))
>>> g, pos = gt.beta_skeleton(points, 1.5)
>>> gt.graph_draw(g, pos=pos, output="beta_skeleton.pdf")
<...>
../_images/beta_skeleton.png

Lune-based \(\beta\)-skeleton of 500 random points, for \(\beta = 1.5\).#