This class implements a directed graph structure.

Namespace: yWorks.yFiles.Algorithms
Assembly: yWorks.yFilesSilverlight.Algorithms (in yWorks.yFilesSilverlight.Algorithms.dll) Version: 2.4.0.0

Syntax

C#
public class Graph : IGraphInterface
Visual Basic
Public Class Graph _ Implements IGraphInterface

Remarks

This class implements a directed graph structure. Basically, a directed graph consists of a set of objects called "nodes" (represented by instances of class Node ) and a set of node pairs which are called "edges" (represented by instances of class Edge ).
The directed stems from the fact that all edges in the graph have direction, i.e., they have a distinct source node and a distinct target node. Using the aforementioned pair notation, an edge would be written as (<source node>, <target node>).

Class Graph presents a proper data type that provides support for all essential operations like element creation, removal, access, and iteration.
Important: Class Graph is the single authority for any structural changes to the graph data type. Specifically, this means that there is no way to create or delete a node or an edge without using an actual Graph instance.

Furthermore, this class is also responsible for providing access to its elements. This is done by means of bidirectional cursors that present a read-only view on the node set (interface INodeCursor ) and edge set (interface IEdgeCursor ).

Class Graph fires notification events that signal structural changes, like, e.g., creation, removal, reinsertion, or modification of graph elements.
Classes that implement the IGraphListener interface can be registered with this class using the addGraphListener method in order to receive such events.

This class provides direct support for the notion of data accessors. It allows to register so-called data providers (implementations of interface IDataProvider ) that hold arbitrary data which is associated to its nodes and/or edges.
Also, it serves as a factory to create so-called maps ( INodeMap , IEdgeMap ) that can be utilized to bind arbitrary data to nodes and edges.

Inheritance Hierarchy

System..::..Object
  yWorks.yFiles.Algorithms..::..Graph
    yWorks.yFiles.Layout..::..LayoutGraph

See Also