epsilon_hypergraph {HyperG} | R Documentation |
Epsilon-Ball Hypergraph
Description
Build a hypergraph by constructing hyperedges from balls around a set of points.
Usage
epsilon_hypergraph(x, epsilon, method = "Euclidean", reduce=FALSE,
as.graph=FALSE)
Arguments
x |
a matrix of points. |
epsilon |
radius of the balls. May be a vector. |
method |
passed to |
reduce |
logical. Whether to reduce the hypergraph by removing reduntant hyper-edges. |
as.graph |
logical. Whether to return a graph instead of a hypergraph. |
Details
Each point of x
corresponds to a vertex in the hypergraph.
For each point, a ball of radius epsilon
is constructed,
and all points in the ball form a hyper-edge in the graph.
If epsilon is a vector, each ball may have a different radius, and
if the length of epsilon is less than the number of points, they are
repeated.
If reduce=TRUE
reduntant hyper-edges (those contained in other
hyper-edges) are removed. If as.graph==TRUE
, reduce
is
ignored an a graph is returned instead of a hypergraph.
Value
a hypergraph or graph.
Note
Because of symmetry (a is in the ball centered at b if and only if b is in the
ball centered at a), the incidence matrix of an epsilon hypergraph is
square and symmetric. It can thus be interpreted as an adjacency matrix,
and it is this graph that is returned if as.graph==TRUE
.
Author(s)
David J. Marchette dmarchette@gmail.com.
See Also
knn_hypergraph
,
sample_geom_hypergraph
,
dist
.
Examples
set.seed(565)
x <- matrix(rnorm(100),ncol=2)
h <- epsilon_hypergraph(x,epsilon=.25)
plot(h)
plot(h,layout=x)
epsilons <- runif(nrow(x),0,.5)
k <- epsilon_hypergraph(x,epsilon=epsilons)
plot(k)
plot(k,layout=x)