RandomGeometricGraph - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


GraphTheory[RandomGraphs]

  

RandomGeometricGraph

  

generate random geometric graph

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

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.

  

For more information on norms, see LinearAlgebra[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

> 

with⁡GraphTheory:

> 

with⁡RandomGraphs:

> 

G1≔RandomGeometricGraph⁡100,1

G1≔Graph 1: an undirected graph with 100 vertices and 4795 edges

(1)
> 

G2≔RandomGeometricGraph⁡100,1,weighted

G2≔Graph 2: an undirected weighted graph with 100 vertices and 4837 edges

(2)
> 

interface⁡rtablesize=4:

> 

WeightMatrix⁡G2

0.0.6767011457378830.1681431070931710.112118041294177…0.6767011457378830.0.7723188101623420.629702446893480…0.1681431070931710.7723188101623420.0.280260786478517…0.1121180412941770.6297024468934800.2802607864785170.…⋮⋮⋮⋮100 × 100 Matrix

(3)
> 

G3≔RandomGeometricGraph⁡200,12,norm=∞,distribution=`$`⁡Normal⁡0,1,3

G3≔Graph 3: an undirected graph with 200 vertices and 441 edges

(4)

Compatibility

• 

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

• 

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

See Also

GraphTheory[WeightMatrix]

RandomDigraph

RandomGraph

RandomNetwork

RandomTournament

RandomTree