This tutorial is probably also available as a Jupyter notebook in the demo folder in the polymake source and on github.

Different versions of this tutorial: latest release, release 3.6, release 3.5, release 3.4, nightly master

Random Constructions

The easiest way to randomly construct a polytope is by sampling points on the unit sphere. The following chooses 100 points on the units sphere in 3-space.

> $p1=rand_sphere(3,100);
> print $p1->SIMPLICIAL;
true

With probability one such polytopes are simplicial.

> ($d,$m,$n) = (4,50,30);
> $p1=rand_sphere($d,$m);
> $p2=polarize($p1);
> $p3=new Polytope(POINTS=>rand_vert($p2->VERTICES,$n));
> print $p3->SIMPLICIAL, " ", $p3->SIMPLE, "\n", $p3->F_VECTOR;
false false
30 163 256 123
  • user_guide/tutorials/random.txt
  • Last modified: 2019/02/04 22:55
  • (external edit)