Page 1 of 1

Getting edges of a polytope

Posted: 13 Nov 2012, 23:47
by Jack Love
How do I have Polymake tell me the edges of a polytope? For example, print $p->VERTICES. "\n"; tells me the vertices of the polytope p. But print $p->EDGES. "\n"; doesn't do anything.

Re: Getting edges of a polytope

Posted: 14 Nov 2012, 00:59
by paffenholz
in polymake, the graph of a polytope is encoded as a sub-object of type Graph (like the one you can create with "new Graph(...)" in application graph), so the edges are listed with

Code: Select all

$p->GRAPH->EDGES;
Similarly, you can get the adjacency matrix via

Code: Select all

$p->GRAPH->ADJACENCY;
and the neighbors of a particular node with

Code: Select all

$p->GRAPH->ADJACENCY->adjacent_nodes(3);

Re: Getting edges of a polytope

Posted: 20 Nov 2012, 02:32
by Jack Love
Thank you!