GraphTheory
IsComparabilityGraph
test if graph is a comparability graph
Calling Sequence
Parameters
Options
Description
Definition
Examples
Compatibility
IsComparabilityGraph(G,opts)
G
-
graph
opts
(optional) one or more options as specified below
transitiveorientation : keyword option of the form transitiveorientation=true or transitiveorientation=false.
Specifies whether a directed graph representing a transitive orientation of G should be returned when G is a comparability graph. The default is false.
usecached : keyword option of the form usecached=true or usecached=false.
Specifies whether previously stored information should be used, if available. The default is true.
The IsComparabilityGraph(G) command returns true if G is a comparability graph and false otherwise.
An undirected graph G is a comparability graph if it has a transitive orientation; that is, there exists a corresponding directed graph G2 with an identical vertex set and exactly one directed edge for each edge of G, and which also has the property that whenever there are directed edges from u to v and from v to w, there is also a directed edge from u to w.
The complement of a comparability graph is an interval graph.
with⁡GraphTheory:
The cycle graph on an even number of vertices is a comparability graph.
C4≔CycleGraph⁡4
C4≔Graph 1: an undirected graph with 4 vertices and 4 edge(s)
IsComparabilityGraph⁡C4
true
The cycle graph on an odd number of vertices is not a comparability graph.
C5≔CycleGraph⁡5
C5≔Graph 2: an undirected graph with 5 vertices and 5 edge(s)
IsComparabilityGraph⁡C5
false
The complement of an interval graph is a comparability graph.
IG≔IntervalGraph⁡1..4,2..3,2..6,3..7,4..9,5..8,6..9,7..9,8..10
IG≔Graph 3: an undirected graph with 9 vertices and 24 edge(s)
G≔GraphComplement⁡IG
G≔Graph 4: an undirected graph with 9 vertices and 12 edge(s)
IsComparabilityGraph⁡G
The Petersen graph is not a comparability graph.
P≔SpecialGraphs:-PetersenGraph⁡
P≔Graph 5: an undirected graph with 10 vertices and 15 edge(s)
IsComparabilityGraph⁡P
The GraphTheory[IsComparabilityGraph] command was introduced in Maple 2022.
For more information on Maple 2022 changes, see Updates in Maple 2022.
See Also
IsChordal
IsIntervalGraph
IsSplitGraph
Download Help Document