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:

LoopFreeGraphQ gives False for a graph with self-loops:

Scope  (6)

LoopFreeGraphQ works with undirected graphs:

Directed graphs:

Multigraphs:

Mixed graphs:

LoopFreeGraphQ gives False for anything that is not a graph without self-loops:

LoopFreeGraphQ works with large graphs:

Properties & Relations  (5)

A bipartite graph has no self-loops:

A TreeGraph has no self-loops:

A typical PathGraph has no self-loops:

The adjacency matrix of a graph without self-loops has a zero diagonal:

The incidence matrix of a graph without self-loops has no entries greater than 1:

Possible Issues  (1)

LoopFreeGraphQ gives False for non-explicit graphs:

Introduced in 2010
 (8.0)