GraphTheory[GeometricGraphs]
UnitDiskGraph
construct a unit disk graph
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
UnitDiskGraph( P, f, opts )
P
-
Matrix or list of lists representing set of points
threshold
(optional) positive real number
opts
(optional) one or more options as specified below
norm : integer or one of Euclidean or infinity.
Specifies the norm to be used in computing distances. The default is 2, the Euclidean norm.
For more information on norms, see LinearAlgebra[Norm].
vertices : list of integers, strings or symbols
Specifies the vertices to be used in the generated graph.
weighted : true or false
If weighted=true, the result is a weighted graph whose edge weights correspond to the distance between points using the specified norm. Default is false.
The UnitDiskGraph(P, threshold, opts) command returns a graph whose vertices correspond to points from P and in which two vertices share an edge if the distance between their corresponding points is less than or equal to threshold.
The optional threshold must be a nonnegative real number or infinity. If not specified, a threshold of 1 is used.
A value of infinity for threshold will produce a complete weighted graph on the point set P.
Generate a set of random two-dimensional points and connect edges when the Euclidean distance between them is less than or equal to 10.
points≔LinearAlgebra:-RandomMatrix⁡60,2,generator=0..100.,datatype=float8
points≔9.8501769734180382.975030438619586.067018374966383.318865936399664.374679554674173.867160763967357.36705572946662.3439977588303123.623426484493352.687336738732847.002754735000322.245948836755274.921349155896362.047182022071892.151343470907396.310726263708048.231962435594463.756326714414190.944187743180533.8527464913022⋮⋮60 × 2 Matrix
with⁡GraphTheory:
with⁡GeometricGraphs:
G≔UnitDiskGraph⁡points,10
G≔Graph 1: an undirected unweighted graph with 60 vertices and 54 edge(s)
DrawGraph⁡G
The GraphTheory[GeometricGraphs][UnitDiskGraph] command was introduced in Maple 2020.
For more information on Maple 2020 changes, see Updates in Maple 2020.
See Also
GeometricGraphs
GraphTheory[RandomGraphs][RandomGeometricGraph]
Download Help Document
What kind of issue would you like to report? (Optional)