mathgraph             package:mathgraph             R Documentation

_C_r_e_a_t_e _M_a_t_h_e_m_a_t_i_c_a_l _G_r_a_p_h

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

     Create an object of class '"mathgraph"' which represents a 
     mathematical graph.

_U_s_a_g_e:

     mathgraph(formula, directed = FALSE, data = sys.parent())
     length.mathgraph(x)
     c.mathgraph(...)

     is.mathgraph(x)

_A_r_g_u_m_e_n_t_s:

 formula: a formula containing just the right-side.
           Special operators in the formula are '+' which separates 
          terms, '/' which puts an edge between corresponding  elements
          of the two vectors on which it is operating,  and '*' which
          puts an edge between every pair of elements in the two
          vectors on which it is operating. 

directed: logical flag: if 'TRUE', then all edges that  are created are
          directed, otherwise they are undirected. 

    data: the frame in which to find objects referenced in the formula.
          This can be either the number of a memory frame, or a list or
           data frame containing the data. 

     ...: objects to be concatenated. 

       x: object of class '"mathgraph"'. 

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

     Mathematical graphs consist of a set of nodes (vertices) and
     edges. Edges go between two nodes. An edge that is directed is
     often called an arc.

     Terms in the formula (delimited by '+') may be either calls to '*'
     or '/', or objects that are already of class '"mathgraph"'.

     Two other representations of graphs are adjacency matrices and
     incidence matrices. The functions to convert '"mathgraph"' objects
     to these  are 'adjamat' and 'incidmat', respectively. Most
     algorithms for mathematical graphs are in terms of incidence
     matrices or adjacency matrices.

     The generic functions that have a method for class '"mathgraph"'
     include: '[', 'c', 'length', 'names', 'plot', 'print',  'unique'.

     'is.mathgraph' is the membership function for this class.

_V_a_l_u_e:

     an object of class 'mathgraph' which is a two-column matrix of
     nodes along with an additional attribute called '"directed"' which
     is a  logical vector stating whether or not each edge is directed.
      An edge (row of the matrix) that is directed goes from the node
     in the first column to the node in the second column.

_N_o_t_e:

     S Poetry, Patrick J. Burns, <URL:
     http://www.burns-stat.com/pages/spoetry.html>

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

     Nick Efthymiou

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

     Chachra, V., Ghare, P. M. and Moore, J. M. (1979). Applications of
     Graph Theory Algorithms. Elvesier North Holland, New York.

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

     'adjamat', 'incidmat', 'getpath'

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

     mathgraph(~ 1:3 / 2:4) # graph with 3 edges
     mathgraph(~ 1:3 * 2:4) # graph with 9 edges

     mathgraph(~ 1:3 / 2:4, dir=TRUE) # directed graph with 3 edges

     # graph with some edges directed, some not
     c(mathgraph(~ 1:3 * 2:4), mathgraph(~ c(3,1) / c(2,4), dir=TRUE))

