networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersRaisesReturnsBackRef
is_chordal(G)

A graph is chordal if every cycle of length at least 4 has a chord (an edge joining two nodes not adjacent in the cycle).

Notes

The routine tries to go through every node following maximum cardinality search. It returns False when it finds that the separator for any node is not a clique. Based on the algorithms in .

Parameters

G : graph

A NetworkX graph.

Raises

NetworkXNotImplemented

The algorithm does not support DiGraph, MultiGraph and MultiDiGraph.

Returns

chordal : bool

True if G is a chordal graph and False otherwise.

Checks whether G is a chordal graph.

Examples

>>> e = [
...  (1, 2),
...  (1, 3),
...  (2, 3),
...  (2, 4),
...  (3, 4),
...  (3, 5),
...  (3, 6),
...  (4, 5),
...  (4, 6),
...  (5, 6),
... ]
... G = nx.Graph(e)
... nx.is_chordal(G) True
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

networkx.algorithms.chordal.is_chordal

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/algorithms/chordal.py#31
type: <class 'function'>
Commit: