Function Repository Resource:

OrientedGraphQ

Source Notebook

Test if a graph is oriented

Contributed by: Jon McLoone

ResourceFunction["OrientedGraphQ"][gr]

tests whether a graph gr is oriented.

Details

A directed graph is oriented if it contains no symmetric pairs of directed edges.

Examples

Basic Examples

There is a symmetric pair of directed edges between vertices 1 and 2 so this graph is not oriented:

In[1]:=
ResourceFunction["OrientedGraphQ"][
 Graph[{1 \[DirectedEdge] 2, 1 \[DirectedEdge] 3, 2 \[DirectedEdge] 1}]]
Out[1]=

Without one of those edges, it is:

In[2]:=
ResourceFunction["OrientedGraphQ"][
 Graph[{1 \[DirectedEdge] 2, 1 \[DirectedEdge] 3}]]
Out[2]=

Publisher

Jon McLoone

Version History

  • 1.0.0 – 25 March 2022

Related Resources

License Information