graph question about orientation of polyhedra

40 views
Skip to first unread message

John Cremona

unread,
Jun 19, 2023, 6:18:46 AM6/19/23
to SAGE support
I have some quite small graphs which are polyhedral, each is the 1-skeleton of a (connected convex) polyhedron such as a cube, tetrahedron, etc, constructed from a list of edge pairs.

I can get the faces of one of these, say G, via G.faces().  This returns a list of lists of vertices, each one being a list of the vertices of one face in some cyclic order.  So each face in the list has an implied orientation.  OK so far.

What I want is for the orientations of the different faces to be coherent, coming from a single orientation of the surface.  Expliticly that means that each edge xy, which  will appear in exactly two faces, appears once in each direction, i.e. x before y (cyclically) in one and the other way round in the other.

It is possible that G.faces() is already returning such a globally oriented list of faces, as experimentation suggests, but I need to be certain -- otherwise I can write code to check and if necessary reverse some faces.  I would prefer not to have to though.

The docstrong of G.faces() does not make this clear (at least not to me).

Dima Pasechnik

unread,
Jun 19, 2023, 7:08:18 AM6/19/23
to sage-s...@googlegroups.com
You can call G.strong_orientation()
to get an orientation of the edge of your graph, and use it.

HTH
Dima

>
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/CAD0p0K5e9ch3tgrM2RAHxQieVOqG%2BEX37fyWj7BwF0ns-NTPpA%40mail.gmail.com.

John Cremona

unread,
Jun 19, 2023, 8:56:14 AM6/19/23
to sage-support
Thanks Dima for the suggestion.  I'm not sure that this does what I need: the associated directed graph has each edge directed, which is not what I was needing, and the faces of the directed graph look identical to those of the original -- in particular, the edges of each face are tuples (x,y) where both (x,y) and (y,x) appear on different faces (as I need to always hold) regardless of the orientation of the edges.

I will keep on experimenting. My polyhedra are small and few enough that check the orientations of each is not very time-consuming.

John

Dima Pasechnik

unread,
Jun 19, 2023, 9:00:37 AM6/19/23
to sage-support
oh, right, what I suggested isn't what you asked for, sorry.


Dima Pasechnik

unread,
Jun 19, 2023, 9:27:26 AM6/19/23
to sage-support
One can do something like this; start from your graph G, take
D=G.planar_dual(), in D take a spanning tree, and starting from the
root of the tree,
and orientation chosen in the face corresponding to the root, proceed
recursively to induce orientations on the adjacent faces.

John Cremona

unread,
Jun 19, 2023, 10:16:58 AM6/19/23
to sage-s...@googlegroups.com
On Mon, 19 Jun 2023 at 14:27, Dima Pasechnik <dim...@gmail.com> wrote:
One can do something like this; start from your graph G, take
D=G.planar_dual(), in D take a spanning tree, and starting from the
root of the tree,
and orientation chosen in the face corresponding to the root, proceed
recursively to induce orientations on the adjacent faces.

OK, though that is quite complicated.  Right now I am just checking that the faces I am given by G.faces() are consistently oriented.  If/when I come across a case where theya re not, I will work out which subset of them needs to have its orientation flipped.

John 
You received this message because you are subscribed to a topic in the Google Groups "sage-support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-support/5GmwK-v-UWY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/CAAWYfq1Rd%2BOmDBLY9x4ZZFn99WFrGShS98%2BPc39zHfw4jcgZvA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages