subgraph of a graph
g1 = subgraph(v,ind,g)
row vector, numbers of nodes or edges
string, 'nodes' or 'edges'
graph data structure of the new graph
subgraph
returns the graph g1
, built with the numbers given by the
the row vector v
.
If ind
is the string 'nodes'
, g1
is built with the node
numbers given by v
and the connected edges of these nodes in g
.
If ind
is the string 'edges'
, g1
is built with the edge
numbers given by v
and the tail-head nodes of these edges in g
.
All the characteristics of the old nodes and edges of g
are preserved.