graphH-class              package:graph              R Documentation

_C_l_a_s_s "_g_r_a_p_h_H"

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

     This is a class of graphs that are represented in terms of nodes,
     a list of in-edge identifiers and a list of out-edge identifiers
     for the nodes. and a hashtable for the edges. This is a suitable
     representation for a graph with a large number of nodes and
     relatively few edges.

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

     Objects can be created by calls of the form 'new("graphH",
     graphID, nodes, edges, edgemode, ...)'.

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

     '_g_r_a_p_h_I_D': Object of class '"Ruuid"'. This is an unique identifier
          for the graph. Modifying the graph results in a modification
          of the graph ID.

     '_n_o_d_e_s': Object of class '"list"' with each element an object of
          class '"gNode"'. The name of each element is its node ID.

     '_l_a_b_e_l_2_n_o_d_e_I_D': Object of class '"character"', this is used
          internally to map between the node labels and the node IDs.

     '_e_d_g_e_s': Object of class '"environment"', this is used as
          hashtable to store the edges (with edge IDs as keys).

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

_E_x_t_e_n_d_s:

     Class '"graph"', directly.

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

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

     _d_e_g_r_e_e 'signature(object = "graphH", Nodes = "character")': find
          the 'degree' of the specified graph nodes.

     _e_d_g_e_s 'signature(object = "graphNEL", which="missing")': A method
          for obtaining the out edges of the nodes as list, each
          element of the list representing the out edges for a
          particular node. Each such element is a character vector of
          end node labels of the out edges for the corresponding begin
          nodes.

     _e_d_g_e_s 'signature(object = "graphNEL", which="character")': A
          method for obtaining the out edges of the specified nodes.

     _g_e_t_N_o_d_e_s 'signature(x = "graphH", which = "missing")': A method
          for obtaining all the nodes of a graph as a list of '"gNode"'
          objects.

     _g_e_t_N_o_d_e_s 'signature(x = "graphH", which = "character")': A method
          for obtaining the specified nodes of a graph as a list of
          '"gNode"' objects.

     _i_d_s_t_r_i_n_g 'signature(x = "graphH")': A method that returns the
          graph identifier as a character string.

     _i_n_i_t_i_a_l_i_z_e 'signature(.Object = "graphH")': Initializer for
          '"graphH"' objects.

     _n_o_d_e_s 'signature(object = "graphH")': A method for obtaining the
          node labels of a graph. 

     _n_o_d_e_s<- 'signature(object="graphH", value="character")': A method
          for replacing the node labels in a graph object. It checks to
          be sure the values are the right length and unique. 

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

     Saikat DebRoy

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

     'graphNEL-class'

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

     v <- lapply(letters[1:5], function(l) new("gNode", label=l))
     e <- vector("list", 2)
     e[[1]] <- new("gEdge", bNode=v[[1]], eNode=v[[2]])
     e[[2]] <- new("gEdge", bNode=v[[2]], eNode=v[[3]])
     g <- new("graphH", nodes=v, edges=e)
     nodes(g)
     edges(g)

