Digraph object (Multivariate Analysis Toolbox for MatlabŪ)

written by: Liran Carmel

Last modified: 22:41, Sun 12-Sep-2010

General Description
This object describes a mathematical entity known as a directed graph (digraph). This is a graph, whose branches are directed. I chose to represent the directionality by an antisymmetric matrix D, which is the matrix of target height differences. A value D(i,j) means that node i is a distance D(i,j) "above" node j. This objects inherits from the parent object graph.

Navigate to:     General Description     Class Structure     Class Construction     Class Functions

Class Structure
Each field can be accessed by the dot (.) operation, or by the GET function. The GET function can work on multiple instances simultaneously. Most fields, except for those that are Dependent, can be modified using the dot (.) operation, or by the SET function.
    Field Description Type Default Dedicated Get/Set Function  
    thd target-height-differences matrix double matrix []    
    name Inherited from graph. name of object, should be short and used as identifier. This field will never be empty. string 'unnamed'    
    description Inherited from graph. verbal description of the class content. string ''    
    source Inherited from graph. verbal description of the source of information. string ''    
    type Inherited from graph. type of graph. string 'general graph'    
    node_name Inherited from graph. names of all nodes. cell array of strings {} nodenames  
    node_mass Inherited from graph. mass of each node. double vector []    
    node_cfield Inherited from graph. user-specific node customized fields. cell array of values {}    
    node_cfield_name Inherited from graph. names of node customized fields. cell array of strings {}    
    weights Inherited from graph. symmetric sparse weight matrix. double matrix []    
  Dependent no_nodes Inherited from graph. number of nodes in the graph. integer scalar 0 nonodes  
  Dependent no_node_cfields Inherited from graph. number of customized fields. integer scalar 0    
  Dependent no_edges Inherited from graph. number of edges in the graph. integer vector 0 noedges  

Class Construction
Empty instance (scalar)
an empty digraph instance, with all fields initialized to their default values.
syntax: dg = digraph;
Empty instance (matrix)
an array of empty digraph instances.
syntax: dg = digraph(size,'size');
Copy constructor
one digraph instance is copied into another.
syntax: dg_destination = digraph(dg_origin);
Construction by field names
an instance is formed by directly providing field values. Any field which is not dependent is permitted.
syntax: dg = digraph(field_name, field_value, ...);
Enumerating all possible DAGs
Enumerates all DAGs with a certain number of nodes, including non-connected ones.
syntax: dg = digraph('enum',no_nodes,node_names);

List of Functions


computes the balance vector.
finds the DAG-code of a DAG.
computes the Laplacian of a graph. Source: graph.
finds nodes that are center of a V-structure.

Customized fields manipulations:

allocates a new customized field to a graph. Source: graph.
finds whether a customized field exists in a graph. Source: graph.
lists the customized fields in a GRAPH object. Source: graph.
retrieves a customized field from a graph. Source: graph.
sets values for a customized field of GRAPHs. Source: graph.


displays class content. Source: graph.

I/O functions:

writes a DIGRAPH to disk.

Information extraction:

computes the in and out degrees of a digraph.
finds whether a DIGRAPH is cyclic or not.
finds these nodes that are leaves.
finds the IDs of a list of nodes. Source: graph.
finds the parents of specific nodes.


computes missing fields.

SET/GET functions:

get method
retrieves the name of the nodes in the graph. Source: graph.
retrieves the number of edges in GRAPH objects. Source: graph.
retrieves the number of nodes in GRAPH objects. Source: graph.
set method


replaces the indices of two nodes.


computes the eigenprojection of a graph. Source: graph.
plots a DIGRAPH