LoopFreeGraphQ

LoopFreeGraphQ[g]

yields True if the graph g has no self-loops, and False otherwise.

Details

  • A self-loop in a graph is an edge that connects a vertex to itself.

Examples

open allclose all

Basic Examples  (2)

Test whether a graph has no self-loops:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

LoopFreeGraphQ gives False for a graph with self-loops:

In[1]:=
Click for copyable input
Out[1]=

Scope  (6)

Properties & Relations  (5)

Possible Issues  (1)

See Also

Graph  DirectedEdges  AcyclicGraphQ  SimpleGraphQ

Introduced in 2010
(8.0)