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

Online Help

All Products    Maple    MapleSim


Random Graph Layout Method

 

Options

Description

Examples

Options

• 

distribution=function

  

This option can take any value understood by the RandomTools distribution generator. See RandomTools/flavor/distribution. This method will generate n+n1d points and check if there were n unique points generated.  If not, it will try again. If both distribution and generator options are given, only generator will be used.

• 

generator=function

  

This option can take a custom procedure that generates points (as lists) of the appropriate dimension. This method will generate n+n1d points and check if there were n unique points generated.  If not, it will try again. If both distribution and generator options are given, only generator will be used.

• 

seed=posint

  

Specify a seed to send to randomize before generating the random points.

Description

• 

The random layout method uses RandomTools:-Generate to generate random positions for the vertices of the graph. By default, this method randomly populates a 2n1dd grid with the graph vertices (with an additional small random perturbation added to reduce the likelihood of overlapping edges).

• 

This layout method works in two and three dimensions.

Examples

withGraphTheory:

withSpecialGraphs:

GGraphundirected,1,2,1,4,2,3,3,4

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

(1)

DrawGraphG,layout=random

DrawGraphG,layout=random,layoutoptions=distribution=Normal0,0.5

A custom procedure to create random points can also be used

RRandomTools:-GeneratelistdistributionUniform0.97,0.97,2,makeproc:

DrawGraphG,layout=random,layoutoptions=generator=R

HHypercubeGraph3

HGraph 2: an undirected graph with 8 vertices and 12 edge(s)

(2)

DrawGraphH,layout=random,dimension=3

See Also

GraphTheory[DrawGraph]