GraphTheory
HighlightEdges
highlight the edges of a graph
Calling Sequence
Parameters
Description
Examples
Compatibility
HighlightEdges(G, E)
HighlightEdges(G, E, C, ip)
HighlightEdges(G, E, stylesheet=[ optionsequence ], ip)
G
-
graph
E
a single edge or a list or set of edges of G or a subgraph of G or a list or set of subgraphs of G
C
(optional) color or list of colors
ip
(optional) equation of the form inplace = true or inplace = false
stylesheet
(optional) optionsequence is a sequence of keyword options to specify the style or a list of such sequences.
By default the DrawGraph command draws the edges and vertices of the graph with the same set of style options. The command HighlightEdges, marks the specified edges to be rendered with the default highlighted style.
Given only a graph G and an edge or edges E, HighlightEdges marks the specified edges to be rendered with the default highlighted style. If E is one or more subgraphs of G, then the edges in those subgraphs are highlighted. Use HighlightSubgraph instead if you want to highlight both edges and vertices of the subgraphs.
If you want to highlight a edge but give it a different color, then give C, a color for the edge. The colors C can be given in any form understood by Maple. See ColorTools/Formats for details.
If E is a list of edges or subgraphs, then a list of colors or stylesheets can be used to associate a different color or style to each member.
By default, this command modifies G and returns nothing. If you supply the option inplace = false, then instead the changes are applied to a copy of G, and that copy is returned.
More precise overriding of the highlighted style can be set using stylesheet options. The stylesheet options are understood as modifiers to the default highlighted style. So, for example, if a color is not specified the default highlighted color is used. If the stylesheet option and a color C are both given, the color C is ignored. See StyleEdge for a complete list of edge style options.
with⁡GraphTheory:
K5≔CompleteGraph⁡5
K5≔Graph 1: an undirected graph with 5 vertices and 10 edge(s)
HighlightEdges⁡K5,1,2
DrawGraph⁡K5
HighlightEdges⁡K5,2,3,4,5,stylesheet=thickness=3
ST≔SpanningTree⁡K5
ST≔Graph 2: an undirected graph with 5 vertices and 4 edge(s)
If we want a version of K5 with ST highlighted, but we also want to keep the current version of K5, we can use the inplace option.
K5_with_ST≔HighlightEdges⁡K5,ST,Gold,inplace=false
K5_with_ST≔Graph 3: an undirected graph with 5 vertices and 10 edge(s)
DrawGraph⁡K5_with_ST
K5 is unmodified.
M≔Matrix⁡0,2,9,4,0,1,3,0,0
M≔029401300
G≔Graph⁡M
G≔Graph 4: a directed weighted graph with 3 vertices and 5 arc(s)
HighlightEdges⁡G,2,3,stylesheet=fontstyle=bold,fontcolor=Red,color=Green,thickness=3
DrawGraph⁡G
P≔SpecialGraphs:-PetersenGraph⁡
P≔Graph 5: an undirected graph with 10 vertices and 15 edge(s)
P1≔InducedSubgraph⁡P,1,2,3,4,5
P1≔Graph 6: an undirected graph with 5 vertices and 5 edge(s)
P2≔InducedSubgraph⁡P,6,7,8,9,10
P2≔Graph 7: an undirected graph with 5 vertices and 5 edge(s)
HighlightEdges⁡P,P1,P2,Blue,Green
DrawGraph⁡P
HighlightEdges⁡P,1,6,2,9,3,7,4,10,5,8,stylesheet=seq⁡thickness=i,i=2..10,2
The GraphTheory[HighlightEdges] command was updated in Maple 2019.
The stylesheet option was updated in Maple 2019.
See Also
DrawGraph
Edges
HighlightSubgraph
HighlightTrail
HighlightVertex
StyleEdge
Download Help Document