SubGraph {gRapHD}R Documentation

Generates a subgraph

Description

Generates a sub-graph.

Usage

  SubGraph(model=NULL,edges=NULL,v=NULL,p=0)

Arguments

model gRapHD object.
edges matrix with 2 columns, each row representing one edge, and each column one of the vertices in the edge.
v list of vertices in the sub-graph.
p Number of vartices (used only if edges is not NULL).

Details

Based on a list of vertices, generate a sub-graph.

Value

Returns a gRapHD object, in which the edge list contains only edges where both vertices are in v.

Author(s)

Gabriel Coelho Goncalves de Abreu (Gabriel.Abreu@agrsci.dk)
Rodrigo Labouriau (Rodrigo.Labouriau@agrsci.dk)
David Edwards (David.Edwards@agrsci.dk)

Examples

  data(dsCont)
  m1 <- minForest(dsCont,homog=TRUE,forbEdges=NULL,stat="LR")
  plotG(edges=m1$edges,numIter=1000)
  
  v <- c(1,11,21,19,30,25,22,24,34,9,20,29)
  subEdges <- SubGraph(edges=m1$edges,v=v)$edges
  plotG(edges=subEdges,v=v,numIter=1500)

[Package gRapHD version 0.1.0 Index]