UnitDiskGraph - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


GraphTheory[GeometricGraphs]

  

UnitDiskGraph

  

construct a unit disk graph

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

UnitDiskGraph( P, threshold, 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

• 

metric = positive number or one of the symbols Euclidean, Manhattan, discrete, geographical, or infinity.

  

Specifies the metric to be used in computing distances. The default is 2, the metric induced by the Euclidean norm.

  

For more information on norms, see LinearAlgebra[Norm].

• 

norm = positive real or one of Euclidean, Manhattan, or infinity.

  

An alias for the metric option.

• 

vertices = list of integers, strings or symbols

  

Specifies the vertices to be used in the generated graph.

• 

weighted = truefalse

  

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

pointsLinearAlgebra:-RandomMatrix60,2,generator=0..100.,datatype=float8

withGraphTheory:

withGeometricGraphs:

GUnitDiskGraphpoints,10

GGraph 1: an undirected graph with 60 vertices and 54 edge(s)

(1)

DrawGraphG

Compatibility

• 

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

• 

For more information on Maple 2020 changes, see Updates in Maple 2020.

• 

The GraphTheory[GeometricGraphs][UnitDiskGraph] command was updated in Maple 2023.

• 

The metric option was introduced in Maple 2023.

• 

For more information on Maple 2023 changes, see Updates in Maple 2023.

See Also

GeometricGraphs

GraphTheory[RandomGraphs][RandomGeometricGraph]