Random Graph Layout Method
Options
Description
Examples
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.
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.
withGraphTheory:
withSpecialGraphs:
G≔Graphundirected,1,2,1,4,2,3,3,4
G≔Graph 1: an undirected graph with 4 vertices and 4 edge(s)
DrawGraphG,layout=random
DrawGraphG,layout=random,layoutoptions=distribution=Normal0,0.5
A custom procedure to create random points can also be used
R≔RandomTools:-GeneratelistdistributionUniform−0.97,0.97,2,makeproc:
DrawGraphG,layout=random,layoutoptions=generator=R
H≔HypercubeGraph3
H≔Graph 2: an undirected graph with 8 vertices and 12 edge(s)
DrawGraphH,layout=random,dimension=3
See Also
GraphTheory[DrawGraph]
Download Help Document