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:

     A virtual Class: No objects may be created from it.

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


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

     '_e_d_g_e_D_a_t_a': An 'attrData' instance for edge attributes.

     '_n_o_d_e_D_a_t_a': An 'attrData' instance for node attributes.

     '_g_r_a_p_h_D_a_t_a': A 'list' for graph-level attributes

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


     _n_o_d_e_s return a character vector containing the names of the nodes
          of the graph

     _n_o_d_e_s<- rename the nodes of the graph

     _s_h_o_w 'signature(object = "graph")':A print method for the graph.

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

     _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'.

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

     _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.

     _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.

     _e_d_g_e_D_a_t_a_D_e_f_a_u_l_t_s Get and set default attributes for the edges in
          the graph.

     _e_d_g_e_D_a_t_a Get and set attributes for edges in the graph

     _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'.

     _e_d_g_e_W_e_i_g_h_t_s Return a list of edge weights in a list format similar
          to the 'edges' method.

     _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.

     _i_s_A_d_j_a_c_e_n_t 'signature(from="character", to="character")':
          Determine if edges exists between nodes.

     _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.

     _i_s_D_i_r_e_c_t_e_d Return 'TRUE' if the graph object has directed edges
          and 'FALSE' otherwise.

     _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.  Note that edgeWeights for the resulting
          graph are all set to 1.  Users wishing to preserve weights in
          a join operation must perform addEdge operations on the
          resulting graph to restore weights.

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

     _n_o_d_e_D_a_t_a_D_e_f_a_u_l_t_s Get/set default attributes for nodes in the
          graph.

     _n_o_d_e_D_a_t_a Get/set attributes for nodes in the graph.

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

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

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

     _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'.

     _e_d_g_e_N_a_m_e_s 'signature(object = "graph")': Returns a vector of the
          edge names for this graph, using the format 'tail\~head',
          where 'head' is the name of the tail node and 'head' is the
          name of the head node.

     _u_p_d_a_t_e_G_r_a_p_h 'signature(object = "graph")': Updates old instances
          of graph objects.

_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', 'graphAM-class', 'distGraph-class'.

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

       set.seed(123)
       g1 <- randomGraph(letters[1:10], 1:4, p= 0.3)
       numEdges(g1)
       edgeNames(g1)
       edges(g1)
       edges(g1, c("a","d")) # those incident to 'a' or 'd'

