UnitDiskGraph - Maple Help

GraphTheory[GeometricGraphs]

 UnitDiskGraph
 construct a unit disk graph

 Calling Sequence UnitDiskGraph( P, f, opts )

Parameters

 P - Matrix or list of lists representing set of points threshold - (optional) positive real number opts - (optional) one or more options as specified below

Options

 • norm : integer or one of Euclidean or infinity.
 Specifies the norm to be used in computing distances. The default is 2, the Euclidean 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.

Description

 • 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.

Examples

Generate a set of random two-dimensional points and connect edges when the Euclidean distance between them is less than or equal to 10.

 > $\mathrm{points}≔\mathrm{LinearAlgebra}:-\mathrm{RandomMatrix}\left(60,2,\mathrm{generator}=0..100.,\mathrm{datatype}=\mathrm{float}\left[8\right]\right)$
 ${\mathrm{points}}{≔}\begin{array}{c}\left[\begin{array}{cc}{9.85017697341803}& {82.9750304386195}\\ {86.0670183749663}& {83.3188659363996}\\ {64.3746795546741}& {73.8671607639673}\\ {57.3670557294666}& {2.34399775883031}\\ {23.6234264844933}& {52.6873367387328}\\ {47.0027547350003}& {22.2459488367552}\\ {74.9213491558963}& {62.0471820220718}\\ {92.1513434709073}& {96.3107262637080}\\ {48.2319624355944}& {63.7563267144141}\\ {90.9441877431805}& {33.8527464913022}\\ {⋮}& {⋮}\end{array}\right]\\ \hfill {\text{60 × 2 Matrix}}\end{array}$ (1)
 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{with}\left(\mathrm{GeometricGraphs}\right):$
 > $G≔\mathrm{UnitDiskGraph}\left(\mathrm{points},10\right)$
 ${G}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 60 vertices and 54 edge\left(s\right)}}$ (2)
 > $\mathrm{DrawGraph}\left(G\right)$

Compatibility

 • The GraphTheory[GeometricGraphs][UnitDiskGraph] command was introduced in Maple 2020.