GraphTheory - Maple Programming Help

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

GraphTheory

 HighlightTrail
 highlight a trail of vertices on a graph

 Calling Sequence HighlightTrail(G, T) HighlightTrail(G, T, C, ip) HighlightEdges(G, T, stylesheet=[ optionsequence ], ip)

Parameters

 G - graph T - a list of vertices (the trail) 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 HighlightTrail allows you to specify individual styles for specified trail of edges overriding the default or a previously set style.
 • Given only a graph G and an trail T, HighlightTrail marks the specified edges to be rendered with the default highlight style.
 • The simplest way to customize the rendering is to 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 a list of colors or stylesheets is given then they are used to associate a different color or style to each member of the trail.
 • 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 control of the style can be set using stylesheet options. The stylesheet options are understood as modifiers to the default highlight style. So, for example, if a color is not specified the default highlight color is used. If the edgestylesheet or vertexstylesheet option and a color C are both given, the color C is ignored.

Edge Stylesheet Options

 • The styles that are understood for edges are:
 – arrowpos : the position of the arrow on a directed edge, a number between 0 and 1
 – arrowsize : the length, in points, of the arrow on a directed edge, a positive number
 – color : color of the edge line. See ColorTools/Format
 – fontcolor : color of the weight label. See ColorTools/Format
 – fontsize : size of the weight label in points, a positive integer
 – fontfamily : font family to use for the weight label, a string. See plot/options
 – fontstyle : font style to use for the weight label, a string. See plot/options
 – font : shorthand to specify the weight label font as a list either [family, size] or [family, style, size]
 – linestyle : style of the edge line, a string: solid, dot, dash, dashdot, longdash, spacedash, or spacedot. See plot/options
 – thickness : thickness of the edge line, a nonnegative value

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{K5}≔\mathrm{CompleteGraph}\left(5\right)$
 ${\mathrm{K5}}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 5 vertices and 10 edge\left(s\right)}}$ (1)
 > $\mathrm{IsHamiltonian}\left(\mathrm{K5},'\mathrm{cycle}'\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{cycle}$
 $\left[{1}{,}{2}{,}{3}{,}{4}{,}{5}{,}{1}\right]$ (3)
 > $\mathrm{mustard}≔\mathrm{ColorTools}:-\mathrm{Color}\left("RGB",\left[0.9,0.6,0.0\right]\right)$
 ${\mathrm{mustard}}{≔}{⟨}\colorbox[rgb]{0.901960784313726,0.6,0}{RGB : 0.9 0.6 0}{⟩}$ (4)
 > $\mathrm{HighlightTrail}\left(\mathrm{K5},\mathrm{cycle},\mathrm{mustard}\right)$
 > $\mathrm{DrawGraph}\left(\mathrm{K5}\right)$

Compatibility

 • The GraphTheory[HighlightTrail] command was updated in Maple 2019.
 • The edgestylesheet option was introduced in Maple 2019.