Constructors

The constructors let you construct a new instace of the graph class, it has a few parameters which allow you to set a few properties of the graph.
Graph<NodeType, EdgeType>(bool BiDirectional = false, bool SelfEdges = false)
Graph<NodeType, EdgeType>(bool BiDirectional = false, bool SelfEdges = false, IEnumerable<NodeType> NodeValues )
Parameter Type Default Value Description
BiDirectional Boolean False Are the edges bi-directional?
SelfEdge Boolean False Are Self Edges Allowed?
NodeValues IEnumerable< NodeType > These values are to be add as nodes of the graph.



Indexers

The graph object has 2 indexer properties.
Node<NodeType, EdgeType> ( NodeType Value )
Parameter Type Description
Value NodeType The Node Value to lookup.
Node< NodeType, EdgeType > The corresponding node, otherwish returns null.


Edge<NodeType, EdgeType> ( NodeType StartNodeValue, NodeType FinisNodeValue )
Parameter Type Descrption
StartNodeValue NodeType The Start Node
FinisNodeValue NodeType The Finish Node
Edge< NodeType, EdgeType > The corresponding Edge, otherwise it returns Null.


Properties

.IsBiDirectional
Are the Edges in the graph Bi-Directional?
.AllowsSelfEdges
Does the graph permit Edges where the start and finish nodes are the same.
.NodeCount
The number of nodes in the graph.
.EdgeCount
The number of edges in the graph. (Note: This will take into account the bi-directionality and self edges.
.SelfEdges
Returns an IEnumerable containing all of the SelfEdges in the Graph.
.Values
Returns an IEnumerable containing all the values of the Nodes.
.Edges
Returns an IEnumerable containing all the Edges in the Graph.
.Nodes
Returns an IEnumerable containing all the Nodes in the Graph.

Methods

Add

Graph<NodeType,EdgeType> Add( NodeType NodeOfThisValue )
Parameter Type Description
NodeOfThisValue NodeType Add a node with this value to the graph.
Graph< NodeType, EdgeType > Returns the updated graph.


Paths

IEnumerable<Path<NodeType,EdgeType>> Path( Node<NodeType, EdgeType> StartNode,  Node<NodeType, EdgeType> FinisNode )
Parameter Type Description
StartNode Node< NodeType, EdgeType > The node to start from.
FinisNode Node< NodeType, EdgeType > The node to finish at.
IEnumerable< Path<NodeType, EdgeType >> Returns an IEnumerable containing all of the paths between the start and finish nodes.




This WikiPage was created with Codeplex WikiEditor

Last edited May 21, 2011 at 8:25 PM by AdamSpeight2008, version 27

Comments

No comments yet.