user_guide:tutorials:random

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 4.11, release 4.10, release 4.9, release 4.8, release 4.7, release 4.6, release 4.5, release 4.4, release 4.3, release 4.2, release 4.1, release 4.0, release 3.6, nightly master

This is an old revision of the document!


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.

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

With probability one such polytopes are simplicial.

polytope > ($d,$m,$n) = (4,50,30);
polytope > $p1=rand_sphere($d,$m);
polytope > $p2=polarize($p1);
polytope > $p3=new Polytope(POINTS=>rand_vert($p2->VERTICES,$n));
polytope > print $p3->SIMPLICIAL, " ", $p3->SIMPLE, "\n", $p3->F_VECTOR;
0 0
30 166 264 128
  • user_guide/tutorials/random.1497275123.txt.gz
  • Last modified: 2017/06/12 13:45
  • by oroehrig