1

An undirected graph has a transitive orientation if its edges can be oriented in such a way that if (x, y) and (y, z) are two edges in the resulting directed graph, there also exists an edge (x, z) in the resulting directed graph.

I am working with real food web networks and I need to check if a dense undirected graph (which models competition in the food web) has a transitive orientation. The undirected graph is represented as an adjacency matrix in Java.

EDIT:

For example, for this undirected graph,

We can orient the edges in this way. So, this graph has a transitive orientation.

  • I answered, but then I noticed that you're using "undirected graph" and "directed graph" in the discussion. Is that a typo, or what? – nbro Jul 02 '16 at 23:56
  • After orienting the edges of the undirected graph, the resulting graph is a directed graph. – Pratik Koirala Jul 03 '16 at 00:10
  • Maybe I'm missing something. As you've defined "having a TO," I believe any path in the original undirected graph must lie in a complete subgraph. Consequently, every connected component must be a complete graph for the original graph to have a TO. It's pretty easy to check that. If I have this wrong, examples of incomplete graphs having a TO would be helpful. – Gene Jul 03 '16 at 03:52
  • @PratikKoirala What do you mean by orienting an edge? – nbro Jul 03 '16 at 09:10
  • @nbro Orienting an edge simply means assigning or choosing a direction to the edge. – Pratik Koirala Jul 03 '16 at 20:52
  • @Gene I have edited my post with an example and its not a complete graph. – Pratik Koirala Jul 03 '16 at 23:05

1 Answers1

0

What you are looking at is comparability graph. This class of graph is also known as "transitively orientable graphs", but this is not the most common name. For recognition of this class, look at the graphclasses website.

Damien Prot
  • 573
  • 3
  • 7