RandomGeometricGraph - Maple Help

GraphTheory[RandomGraphs]

 RandomGeometricGraph
 generate random geometric graph

 Calling Sequence RandomGeometricGraph(n,t,dims,opts)

Parameters

 n - positive integer or list of vertices t - positive real number; distance threshold dims - (optional) positive integer; number of dimensions of random points opts - (optional) one or more options as specified below

Options

 • distribution : algebraic or list(algebraic)
 A continuous distribution as supported by the Statistics package, or list of such distributions. The default is the uniform distribution between 0 and 1.
 • norm : integer or one of Frobenius or infinity.
 Specifies the norm to be used in computing distances. The default is 2, the Euclidean norm.
 • seed : integer or none
 Seed for the random number generator. Equivalent to calling randomize(seed) immediately before invoking this function.
 • 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

 • RandomGeometricGraph(n,t,dims,opts) creates a random geometric graph on n vertices. A random geometric graph is a graph whose vertices correspond to a set of randomly generated points, and whose edges correspond with those pairs of points whose distance falls under a specified threshold t.
 • If omitted, the parameter dims is assumed to be 2 unless a multidimensional distribution was specified with the distribution option, in which case dims is taken to be numelems(distribution).
 • The random number generator used can be seeded using the randomize function or the seed option.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{with}\left(\mathrm{RandomGraphs}\right):$
 > $\mathrm{G1}≔\mathrm{RandomGeometricGraph}\left(100,1\right)$
 ${\mathrm{G1}}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 100 vertices and 4795 edge\left(s\right)}}$ (1)
 > $\mathrm{G2}≔\mathrm{RandomGeometricGraph}\left(100,1,\mathrm{weighted}\right)$
 ${\mathrm{G2}}{≔}{\mathrm{Graph 2: an undirected weighted graph with 100 vertices and 4837 edge\left(s\right)}}$ (2)
 > $\mathrm{interface}\left(\mathrm{rtablesize}=4\right):$
 > $\mathrm{WeightMatrix}\left(\mathrm{G2}\right)$
 $\begin{array}{c}\left[\begin{array}{ccccc}{0.}& {0.676701145737883}& {0.168143107093171}& {0.112118041294177}& {\dots }\\ {0.676701145737883}& {0.}& {0.772318810162342}& {0.629702446893480}& {\dots }\\ {0.168143107093171}& {0.772318810162342}& {0.}& {0.280260786478517}& {\dots }\\ {0.112118041294177}& {0.629702446893480}& {0.280260786478517}& {0.}& {\dots }\\ {⋮}& {⋮}& {⋮}& {⋮}& {}\end{array}\right]\\ \hfill {\text{100 × 100 Matrix}}\end{array}$ (3)
 > $\mathrm{G3}≔\mathrm{RandomGeometricGraph}\left(200,\frac{1}{2},\mathrm{norm}=\mathrm{\infty },\mathrm{distribution}=\left[\mathrm{}\left(\mathrm{Normal}\left(0,1\right),3\right)\right]\right)$
 ${\mathrm{G3}}{≔}{\mathrm{Graph 3: an undirected unweighted graph with 200 vertices and 441 edge\left(s\right)}}$ (4)

Compatibility

 • The GraphTheory[RandomGraphs][RandomGeometricGraph] command was introduced in Maple 2020.