graph-class              package:graph              R Documentation

_C_l_a_s_s "_g_r_a_p_h"

_D_e_s_c_r_i_p_t_i_o_n:

     A virtual class that all graph classes should extend.

_D_e_t_a_i_l_s:

     'degree' returns either a named vector (names correspond to the
     nodes in the graph) containing the degree for undirected graphs or
     a list with two components, 'inDegree' and 'outDegree' for
     directed graphs.

     'connComp' returns a list of the connected components. Each
     element of this list contains the labels of all nodes in that
     component.

     For a _directed graph_ or _digraph_ the underlying graph is the
     graph that results from removing all direction from the edges.
     This can be achieved using the function 'ugraph'.

     A weakly connected component of a _digraph_ is one that is a
     connected component of the underlying graph. This is the default
     for 'connComp'. A _digraph_ is  strongly connected if every two
     vertices are mutually reachable. A strongly connected component of
     a _digraph_, *D*, is a maximal _strongly connected_ subdigraph of
     *D*. See the 'RBGL' package for an implementation of Trajan's
     algorithm to find _strongly connected_ components ('strongComp').

     In the 'graph' implementation of 'connComp' _weak connectivity_ is
     used. If the argument to 'connComp' is a directed graph then
     'ugraph' is called to create the underlying undirected graph and
     that is used to compute connected components. Users who want
     different behavior are encouraged to use 'RBGL'.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

_S_l_o_t_s:

     '_e_d_g_e_m_o_d_e': Indicates whether edges are '"directed"' or
          '"undirected"'

_M_e_t_h_o_d_s:

     _c_o_n_n_C_o_m_p 'signature(object = "graph")': find the connected
          components of a graph.

     _i_s_C_o_n_n_e_c_t_e_d 'signature(object = "graph")': A boolean that details
          if a graph is fully connected or not.

     _a_c_c 'signature(object = "graph")': find all nodes accessible from
          the specified node. 

     _d_e_g_r_e_e 'signature(object = "graph", Nodes = "missing")': find the
          'degree' of a node (number of coincident edges).

     _d_e_g_r_e_e 'signature(object = "graph", Nodes = "ANY")': as above.  

     _d_f_s 'signature(object = "graph")': execute a depth first search on
          a graph starting with the specified node.

     _i_n_t_e_r_s_e_c_t_i_o_n 'signature(x = "graph", y = "graph")': compute the
          intersection of the two supplied graphs. They must have
          identical nodes. Currently this returns an object of class
          'graphNEL'. With edge weights of 1 for any matching edge.

     _j_o_i_n 'signature(x = "graph", y = "graph")': returns the joining of
          two graphs.  Nodes which are shared by both graphs will have
          their edges merged.

     _u_n_i_o_n 'signature(x = "graph", y = "graph")': compute the union of
          the two supplied graphs. They must have identical nodes.
          Currently this returns an object of class 'graphNEL'.

     _c_o_m_p_l_e_m_e_n_t 'signature(x = "graph")': compute the complement of the
          supplied graph. The complement is defined with respect to the
          complete graph on the nodes in 'x'. Currently this returns an
          object of class 'graphNEL'.

     _n_u_m_N_o_d_e_s 'signature(object = "graph")': compute the number of
          nodes in a graph. 

     _e_d_g_e_s 'signature(object="graph", which="character")': return the
          edges indicated by 'which'. 'which' can be missing in which
          case all edges are returned or it can be a character vector
          with the node labels indicating the nodes whose edge lists
          are wanted.

     _n_o_d_e_s<- A generic function that allows different implementations
          of the 'graph' class to reset the node labels

     _p_l_o_t Please see the help page for the 'plot.graph' method in the
          'Rgraphviz' package

     _e_d_g_e_m_o_d_e 'signature(object="graph")': return the 'edgemode' for
          the graph. Currently this can be either 'directed' or
          'undirected'.

     _e_d_g_e_m_o_d_e<- 'signature(object="graph", value="character")': set the
          'edgemode' for the graph. Currently this can be either
          'directed' or 'undirected'.

_A_u_t_h_o_r(_s):

     R. Gentleman and E. Whalen.

_R_e_f_e_r_e_n_c_e_s:

     Graph Theory and its Applications, J. Gross and J. Yellen.

_S_e_e _A_l_s_o:

     'graphNEL-class', 'distGraph-class'

_E_x_a_m_p_l_e_s:

       set.seed(123)
       g1 <- randomGraph(letters[1:10], 1:4, p=.3)
       edges(g1)
       edges(g1, "a")

