Close
Close window
EgoGraph - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

GraphTheory

EgoGraph

find subgraph within specified distance of vertex

Calling Sequence

EgoGraph(G, V, dist, opts)

Parameters

G

-

graph or digraph

V

-

vertex or list or set of vertices

dist

-

real constant; distance threshold

opts

-

(optional) equation of the form direction=incoming or outgoing

Options

direction = one of incoming or outgoing

When G is directed, specifies the direction of the directed path used to define which vertices of G are included in the result.

If direction=outgoing, a vertex w is included in the result if there is a directed path from some vertex in V to w. If direction=incoming, w is included in the result if there is a directed path from w to some vertex in V.

The default is direction=outgoing.

Description

EgoGraph(G, V, dist) returns the induced subgraph of G defined by those vertices of G which are within distance dist from any of vertices referenced in V.

If G is undirected, EgoGraph(G, V, dist) returns a subgraph of G in which a vertex w is present if there exists a path from some vertex in V to w whose length is less than or equal to dist.

If G is directed, EgoGraph(G, V, dist) returns a subgraph of G in which a vertex w is present if there exists a directed path from some vertex in V to w whose length is less than or equal to dist.

If G is weighted, these paths are weighted paths.

If dist is not specified, a default value of 1 is assumed.

Examples

>

withGraphTheory:

>

GCycleGraph7

GGraph 1: an undirected graph with 7 vertices and 7 edges

(1)
>

EgoGraphG,1,2

Graph 2: an undirected graph with 7 vertices and 7 edges

(2)
>

EgoGraphG,1,3

Graph 3: an undirected graph with 7 vertices and 7 edges

(3)
>

DGDigraphTrail1,2,3,4,5,3,Trail1,5,2,4,1

DGGraph 4: a directed graph with 5 vertices and 9 arcs

(4)
>

EgoGraphDG,2,2

Graph 5: a directed graph with 5 vertices and 9 arcs

(5)
>

EgoGraphDG,2,2,direction=incoming

Graph 6: a directed graph with 5 vertices and 9 arcs

(6)

Compatibility

The GraphTheory[EgoGraph] command was introduced in Maple 2021.

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


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /