C# Class numl.Data.Graph

Graph class.
Mostrar archivo Open project: sethjuarez/numl Class Usage Examples

Public Methods

Method Description
AddEdge ( IEdge edge ) : void

Inserts the Edge object to the Graph.

Connecting IVertex objects should already be present in the graph before attempting to add a connection.

AddEdges ( IEnumerable edges ) : void

Inserts the enumerable of Edge objects to the Graph.

Connecting IVertex objects should already be present in the graph before attempting to add a connection.

AddVertex ( IVertex v ) : void

Adds the specified IVertex to the current Graph.

AddVertices ( IEnumerable vertices ) : void

Adds the enumerable of IVertex objects to the current Graph.

ContainsVertex ( IVertex v ) : bool

Returns True if the specified vertex exists in the graph.

Equals ( object obj ) : bool

Determines whether the current Graph is equal to the specified Graph object.

GetChildren ( IVertex v ) : IEnumerable

Gets the child vertices for the specified IVertex object.

GetEdges ( ) : IEnumerable

Returns all IEdge objects in the current graph.

GetHashCode ( ) : int

Returns the hash code for this Graph object.

GetInEdges ( IVertex v ) : IEnumerable

Gets the afferent or inbound connections for the specified IVertex object.

GetOutEdges ( IVertex v ) : IEnumerable

Gets the efferent or outbound connections for the specified IVertex object.

GetParents ( IVertex v ) : IEnumerable

Gets the parent vertices for the specified IVertex object.

GetVertex ( int id ) : IVertex

Gets the IVertex associated with the specified identifier.

GetVertices ( ) : IEnumerable

Returns all IVertex objects in the current graph.

Graph ( ) : System

Initializes a new Graph.

RemoveEdge ( IEdge edge ) : void

Removes the Edge object from the graph.

RemoveVertex ( IVertex v ) : void

Removes the specified Vertex and its associated edges from the Graph.

this ( int id ) : IVertex

Gets the IVertex by the specified Id.

Method Details

AddEdge() public method

Inserts the Edge object to the Graph.

Connecting IVertex objects should already be present in the graph before attempting to add a connection.

public AddEdge ( IEdge edge ) : void
edge IEdge IEdge object to add.
return void

AddEdges() public method

Inserts the enumerable of Edge objects to the Graph.

Connecting IVertex objects should already be present in the graph before attempting to add a connection.

public AddEdges ( IEnumerable edges ) : void
edges IEnumerable Collection of IEdge objects to add.
return void

AddVertex() public method

Adds the specified IVertex to the current Graph.
public AddVertex ( IVertex v ) : void
v IVertex IVertex object to add.
return void

AddVertices() public method

Adds the enumerable of IVertex objects to the current Graph.
public AddVertices ( IEnumerable vertices ) : void
vertices IEnumerable Collection of IVertex objects to add.
return void

ContainsVertex() public method

Returns True if the specified vertex exists in the graph.
public ContainsVertex ( IVertex v ) : bool
v IVertex IVertex to check exists.
return bool

Equals() public method

Determines whether the current Graph is equal to the specified Graph object.
public Equals ( object obj ) : bool
obj object Graph object.
return bool

GetChildren() public method

Gets the child vertices for the specified IVertex object.
public GetChildren ( IVertex v ) : IEnumerable
v IVertex IVertex object to return child vertices for.
return IEnumerable

GetEdges() public method

Returns all IEdge objects in the current graph.
public GetEdges ( ) : IEnumerable
return IEnumerable

GetHashCode() public method

Returns the hash code for this Graph object.
public GetHashCode ( ) : int
return int

GetInEdges() public method

Gets the afferent or inbound connections for the specified IVertex object.
public GetInEdges ( IVertex v ) : IEnumerable
v IVertex IVertex object to return edges for.
return IEnumerable

GetOutEdges() public method

Gets the efferent or outbound connections for the specified IVertex object.
public GetOutEdges ( IVertex v ) : IEnumerable
v IVertex IVertex object to return edges for.
return IEnumerable

GetParents() public method

Gets the parent vertices for the specified IVertex object.
public GetParents ( IVertex v ) : IEnumerable
v IVertex IVertex object to return parent vertices for.
return IEnumerable

GetVertex() public method

Gets the IVertex associated with the specified identifier.
public GetVertex ( int id ) : IVertex
id int Identifier of the IVertex to return.
return IVertex

GetVertices() public method

Returns all IVertex objects in the current graph.
public GetVertices ( ) : IEnumerable
return IEnumerable

Graph() public method

Initializes a new Graph.
public Graph ( ) : System
return System

RemoveEdge() public method

Removes the Edge object from the graph.
public RemoveEdge ( IEdge edge ) : void
edge IEdge IEdge object to remove.
return void

RemoveVertex() public method

Removes the specified Vertex and its associated edges from the Graph.
public RemoveVertex ( IVertex v ) : void
v IVertex IVertex to remove.
return void

this() public method

Gets the IVertex by the specified Id.
public this ( int id ) : IVertex
id int The key of the specified IVertex to return.
return IVertex