GraphTheory - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

GraphTheory

  

UnderlyingGraph

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

UnderlyingGraph(G,opts)

Parameters

G

-

graph

opts

-

zero or or more options as specified below

Options

• 

directed=truefalse

  

Specifies whether directed edges should be permitted in the graph returned. If true, the result will be a directed graph if the input was directed. The default value, false, produces an undirected graph.

• 

weights=truefalse

  

Specifies whether edge weights should be included in the graph returned. If true, the result will be a weighted graph if the input was weighted. The default value, false, produces an unweighted graph.

Description

• 

The UnderlyingGraph(G,opts) command returns an underlying graph of a graph.

• 

The default behavior produces a graph in which the directions of arcs and the weights of the edges (or arcs) have been dropped.

• 

Note that UnderlyingGraph(G) = Graph(Vertices(G), Neighbors(G)).

Examples

withGraphTheory:

GDigraph1,2,2,3,3,4,4,1

GGraph 1: a directed unweighted graph with 4 vertices and 4 arc(s)

(1)

EdgesG

1,2,2,3,3,4,4,1

(2)

NeighborsG

2,4,1,3,2,4,1,3

(3)

HUnderlyingGraphG:

EdgesH

1,2,1,4,2,3,3,4

(4)

NeighborsH

2,4,1,3,2,4,1,3

(5)

Compatibility

• 

The GraphTheory[UnderlyingGraph] command was updated in Maple 2019.

• 

The directed and weights options were introduced in Maple 2019.

• 

For more information on Maple 2019 changes, see Updates in Maple 2019.

See Also

IsDirected

IsWeighted

MakeDirected

MakeWeighted