GraphTheory[HighlightVertex] - highlight a subgraph of a graph
GraphTheory[HighlightEdges] - highlight a subgraph of a graph
GraphTheory[HighlightSubgraph] - highlight a subgraph of a graph
GraphTheory[HighlightTrail] - highlight a subgraph of a graph
|
Calling Sequence
|
|
HighlightVertex(G, V)
HighlightVertex(G, V, C)
HighlightEdges(G, E)
HighlightEdges(G, E, C)
HighlightSubgraph(G, S)
HighlightSubgraph(G, S, C1, C2)
HighlightTrail(G, T)
HighlightTrail(G, T, C)
|
|
Parameters
|
|
G
|
-
|
graph
|
V
|
-
|
a single vertex or a list of vertices of G
|
E
|
-
|
a single edge or a list or set of edges of G
|
S
|
-
|
a subgraph or a list or set of subgraphs of G
|
T
|
-
|
a list of vertices (the trail) of G
|
C
|
-
|
(optional) color or list of colors
|
C1, C2
|
-
|
(optional) colors
|
|
|
|
|
Description
|
|
•
|
By default the DrawGraph command draws the vertices of the graph G in yellow and the edges of a graph in blue. The commands HighlightVertex, HighlightEdge, HighlightTrail, and and HighlightSubgraph allow you to specify colors for individual vertices, individual edges, a trail (also path and cycle) of edges, and the edges and vertices of a subgraph of a graph respectively. The default highlight color for a vertex is green. The default highlight color for an edge is red.
|
•
|
If V is a vertex in the graph G then HighlightVertex(G,S,C) sets the color of the vertex to be C. If V is a list of vertices in G then C may be a single color or a list of colors.
|
•
|
If E is an edge of G then HighlightEdges(G,E,C) sets the color of the edge to be C. If E is a list or set of edges of G then C may be a single color or a list of colors.
|
•
|
If S is a subgraph of G then HighlightSubgraph(G,S,C1,C2) sets the color of the edges of S in G to be C1 and of the vertices of S in G to be C2. If no colors are provided, C1 defaults to red and C2 defaults to green. If S is a list or set of subgraphs of G then each of C1, C2 may be a single color or a list or set of colors with the same number of elements as S. Note that if either color is provided, then both colors must be provided.
|
•
|
If T is a list of vertices in the graph G then HighlightTrail(G,T,C) sets the color of the edges on the trail T to be C.
|
•
|
Colors may be specified by their name, e.g., red, cyan, magenta, or by there RGB color values as COLOR(RGB, r, g, b) or by the HSV values as COLOR( HSV, h, s, v ) or COLOR( HUE, x ) where r, g, b, h, s, v, and x must be numerical values between 0 and 1.
|
|
|
Examples
|
|
>
|
|
>
|
|
| (1) |
>
|
|
>
|
|
>
|
|
| (2) |
>
|
|
>
|
|
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
>
|
|
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
>
|
|
>
|
|
| (7) |
>
|
|
| (8) |
>
|
|
| (9) |
>
|
|
| (10) |
>
|
|
>
|
|
|
|