GraphTheory
MoralGraph
construct moral graph
Calling Sequence
Parameters
Description
Definition
Examples
Compatibility
MoralGraph( G )
G
-
graph
The MoralGraph( G ) command constructs the moral graph of the directed graph G.
The moral graph is a graph with the same vertices as G but with all directed edges made undirected and with the property that all pairs in G which share a child are connected.
Compute the moral graph of an acyclic directed graph.
with⁡GraphTheory:
G≔Graph⁡7,1,3,2,3,2,4,3,5,3,6,3,7,4,7
G≔Graph 1: a directed graph with 7 vertices and 7 arc(s)
NumberOfEdges⁡G
7
DrawGraph⁡G
M≔MoralGraph⁡G
M≔Graph 2: an undirected graph with 7 vertices and 9 edge(s)
NumberOfEdges⁡M
9
DrawGraph⁡M
The GraphTheory[MoralGraph] command was introduced in Maple 2024.
For more information on Maple 2024 changes, see Updates in Maple 2024.
See Also
GraphTheory[DrawGraph]
GraphTheory[Graph]
GraphTheory[ReverseGraph]
GraphTheory[UnderlyingGraph]
Download Help Document