GraphTheory - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Discrete Mathematics : Graph Theory : GraphTheory Package : GraphTheory/HighlightEdges

GraphTheory

  

HighlightEdges

  

highlight the edges of a graph

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

HighlightEdges(G, E)

HighlightEdges(G, E, C, ip)

HighlightEdges(G, E, stylesheet=[ optionsequence ], ip)

Parameters

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.

Description

• 

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.

Examples

withGraphTheory:

K5CompleteGraph5

K5Graph 1: an undirected unweighted graph with 5 vertices and 10 edge(s)

(1)

HighlightEdgesK5,1,2

DrawGraphK5

HighlightEdgesK5,2,3,4,5,stylesheet=thickness=3

DrawGraphK5

STSpanningTreeK5

STGraph 2: an undirected unweighted graph with 5 vertices and 4 edge(s)

(2)

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_STHighlightEdgesK5,ST,Gold,inplace=false

K5_with_STGraph 3: an undirected unweighted graph with 5 vertices and 10 edge(s)

(3)

DrawGraphK5_with_ST

K5 is unmodified.

DrawGraphK5

MMatrix0,2,9,4,0,1,3,0,0

M029401300

(4)

GGraphM

GGraph 4: a directed weighted graph with 3 vertices and 5 arc(s)

(5)

HighlightEdgesG,2,3,stylesheet=fontstyle=bold,fontcolor=Red,color=Green,thickness=3

DrawGraphG

PSpecialGraphs:-PetersenGraph

PGraph 5: an undirected unweighted graph with 10 vertices and 15 edge(s)

(6)

P1InducedSubgraphP,1,2,3,4,5

P1Graph 6: an undirected unweighted graph with 5 vertices and 5 edge(s)

(7)

P2InducedSubgraphP,6,7,8,9,10

P2Graph 7: an undirected unweighted graph with 5 vertices and 5 edge(s)

(8)

HighlightEdgesP,P1,P2,Blue,Green

DrawGraphP

HighlightEdgesP,1,6,2,9,3,7,4,10,5,8,stylesheet=seqthickness=i,i=2..10,2

DrawGraphP

Compatibility

• 

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