Macaulay2 » Documentation
Packages » Posets :: randomPoset
next | previous | forward | backward | up | index | toc

randomPoset -- generates a random poset with a given relation probability

Synopsis

Description

This method generates a random poset with a given ground set ($\{1, \ldots, n\}$, if $n$ is specified).

i1 : randomPoset 10

o1 = Relation Matrix: | 1 0 0 1 0 1 1 1 1 1 |
                      | 0 1 0 0 1 1 1 1 1 1 |
                      | 0 0 1 1 0 1 1 1 1 1 |
                      | 0 0 0 1 0 0 0 1 0 0 |
                      | 0 0 0 0 1 1 1 0 1 1 |
                      | 0 0 0 0 0 1 1 0 1 0 |
                      | 0 0 0 0 0 0 1 0 1 0 |
                      | 0 0 0 0 0 0 0 1 0 0 |
                      | 0 0 0 0 0 0 0 0 1 0 |
                      | 0 0 0 0 0 0 0 0 0 1 |

o1 : Poset

The option Bias determines the probability that a given relation will be present. A higher Bias will lead to more relations.

i2 : randomPoset(10, Bias => 0.1)

o2 = Relation Matrix: | 1 0 0 0 1 0 1 1 0 0 |
                      | 0 1 0 0 0 0 0 0 0 0 |
                      | 0 0 1 0 0 0 0 0 0 0 |
                      | 0 0 0 1 1 0 0 0 0 0 |
                      | 0 0 0 0 1 0 0 0 0 0 |
                      | 0 0 0 0 0 1 0 0 0 1 |
                      | 0 0 0 0 0 0 1 1 0 0 |
                      | 0 0 0 0 0 0 0 1 0 0 |
                      | 0 0 0 0 0 0 0 0 1 0 |
                      | 0 0 0 0 0 0 0 0 0 1 |

o2 : Poset
i3 : randomPoset(10, Bias => 0.9)

o3 = Relation Matrix: | 1 1 1 1 1 1 1 1 1 1 |
                      | 0 1 1 1 1 1 1 1 1 1 |
                      | 0 0 1 1 1 1 1 1 1 1 |
                      | 0 0 0 1 1 1 1 1 1 1 |
                      | 0 0 0 0 1 1 1 1 1 1 |
                      | 0 0 0 0 0 1 1 1 1 1 |
                      | 0 0 0 0 0 0 1 1 1 1 |
                      | 0 0 0 0 0 0 0 1 1 1 |
                      | 0 0 0 0 0 0 0 0 1 1 |
                      | 0 0 0 0 0 0 0 0 0 1 |

o3 : Poset

See also

Ways to use randomPoset :

For the programmer

The object randomPoset is a method function with options.