Getting edges of a polytope

Questions and problems about using polymake go here.
Jack Love
Posts: 6
Joined: 13 Nov 2012, 23:44

Getting edges of a polytope

Postby Jack Love » 13 Nov 2012, 23:47

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.

paffenholz
Developer
Posts: 212
Joined: 24 Dec 2010, 13:47

Re: Getting edges of a polytope

Postby paffenholz » 14 Nov 2012, 00:59

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);

Jack Love
Posts: 6
Joined: 13 Nov 2012, 23:44

Re: Getting edges of a polytope

Postby Jack Love » 20 Nov 2012, 02:32

Thank you!


Return to “Helpdesk”