C# Class FastGraph.BidirectionalGraph

Inheritance: IEdgeListAndIncidenceGraph, IMutableBidirectionalGraph, ICloneable
Show file Open project: brucificus/FastGraph

Private Properties

Property Type Description
AddEdgeInternal bool
Clone TEdge>.BidirectionalGraph
ICloneable object
NotifyEdgesRemoved void
NotifyVerticesRemoved void
RemoveEdgesInternal int
RemoveInOutEdges IEnumerable

Public Methods

Method Description
AddEdge ( edge ) : bool
AddEdgeRange ( IEnumerable edges ) : int
AddVertex ( vertex ) : bool
AddVertexRange ( IEnumerable vertices ) : int
AddVerticesAndEdge ( edge ) : bool
AddVerticesAndEdgeRange ( IEnumerable edges ) : int
BidirectionalGraph ( ) : System

Initializes a new instance of the BidirectionalGraph{TVertex,TEdge} class.

BidirectionalGraph ( BidirectionalGraph other ) : System

Copy constructor that creates sufficiently deep copy of the graph.

BidirectionalGraph ( bool allowParallelEdges ) : System

Initializes a new instance of the BidirectionalGraph{TVertex,TEdge} class.

BidirectionalGraph ( bool allowParallelEdges, int capacity ) : System

Initializes a new instance of the BidirectionalGraph{TVertex,TEdge} class.

BidirectionalGraph ( bool allowParallelEdges, int vertexCapacity, int edgeCapacity ) : System

Initializes a new instance of the BidirectionalGraph{TVertex,TEdge} class.

Clear ( ) : void
ClearEdges ( vertex ) : void
ClearInEdges ( vertex ) : void
ClearOutEdges ( vertex ) : void
ContainsEdge ( edge ) : bool
ContainsEdge ( source, target ) : bool
ContainsVertex ( vertex ) : bool
Degree ( vertex ) : int
InDegree ( vertex ) : int
InEdge ( vertex, int index ) : TEdge
InEdges ( vertex ) : IEnumerable
IsInEdgesEmpty ( vertex ) : bool
IsOutEdgesEmpty ( vertex ) : bool
MergeVertex ( vertex, EdgeFactory edgeFactory ) : void

Removes the given vertex and merges all its connection to other vertices.

MergeVerticesIf ( VertexPredicate vertexPredicate, EdgeFactory edgeFactory ) : void

Removes vertices matching the given vertexPredicate and merges all their connections to other vertices.

OutDegree ( vertex ) : int
OutEdge ( vertex, int index ) : TEdge
OutEdges ( vertex ) : IEnumerable
RemoveEdge ( edge ) : bool
RemoveEdgeIf ( EdgePredicate predicate ) : int
RemoveInEdgeIf ( vertex, EdgePredicate predicate ) : int
RemoveOutEdgeIf ( vertex, EdgePredicate predicate ) : int
RemoveVertex ( vertex ) : bool
RemoveVertexIf ( VertexPredicate predicate ) : int
TrimEdgeExcess ( ) : void
TryGetEdge ( source, target, &edge ) : bool
TryGetEdges ( source, target, IEnumerable &edges ) : bool
TryGetInEdges ( vertex, IEnumerable &edges ) : bool
TryGetOutEdges ( vertex, IEnumerable &edges ) : bool

Protected Methods

Method Description
OnEdgeAdded ( edge ) : void

Called on each added edge.

OnEdgeRemoved ( edge ) : void

Called on each removed edge.

OnVertexAdded ( vertex ) : void

Called on each added vertex.

OnVertexRemoved ( vertex ) : void

Called for each removed vertex.

Private Methods

Method Description
AddEdgeInternal ( edge ) : bool
Clone ( ) : TEdge>.BidirectionalGraph
ICloneable ( ) : object
NotifyEdgesRemoved ( IEnumerable edges ) : void
NotifyVerticesRemoved ( ICollection vertices ) : void
RemoveEdgesInternal ( ICollection edgesToRemove ) : int
RemoveInOutEdges ( vertex ) : IEnumerable

Method Details

AddEdge() public method

public AddEdge ( edge ) : bool
return bool

AddEdgeRange() public method

public AddEdgeRange ( IEnumerable edges ) : int
edges IEnumerable
return int

AddVertex() public method

public AddVertex ( vertex ) : bool
return bool

AddVertexRange() public method

public AddVertexRange ( IEnumerable vertices ) : int
vertices IEnumerable
return int

AddVerticesAndEdge() public method

public AddVerticesAndEdge ( edge ) : bool
return bool

AddVerticesAndEdgeRange() public method

public AddVerticesAndEdgeRange ( IEnumerable edges ) : int
edges IEnumerable
return int

BidirectionalGraph() public method

Initializes a new instance of the BidirectionalGraph{TVertex,TEdge} class.
public BidirectionalGraph ( ) : System
return System

BidirectionalGraph() public method

Copy constructor that creates sufficiently deep copy of the graph.
public BidirectionalGraph ( BidirectionalGraph other ) : System
other BidirectionalGraph Graph to copy.
return System

BidirectionalGraph() public method

Initializes a new instance of the BidirectionalGraph{TVertex,TEdge} class.
public BidirectionalGraph ( bool allowParallelEdges ) : System
allowParallelEdges bool Indicates if parallel edges are allowed.
return System

BidirectionalGraph() public method

Initializes a new instance of the BidirectionalGraph{TVertex,TEdge} class.
public BidirectionalGraph ( bool allowParallelEdges, int capacity ) : System
allowParallelEdges bool Indicates if parallel edges are allowed.
capacity int Vertex capacity.
return System

BidirectionalGraph() public method

Initializes a new instance of the BidirectionalGraph{TVertex,TEdge} class.
public BidirectionalGraph ( bool allowParallelEdges, int vertexCapacity, int edgeCapacity ) : System
allowParallelEdges bool Indicates if parallel edges are allowed.
vertexCapacity int Vertex capacity.
edgeCapacity int Edge capacity.
return System

Clear() public method

public Clear ( ) : void
return void

ClearEdges() public method

public ClearEdges ( vertex ) : void
return void

ClearInEdges() public method

public ClearInEdges ( vertex ) : void
return void

ClearOutEdges() public method

public ClearOutEdges ( vertex ) : void
return void

ContainsEdge() public method

public ContainsEdge ( edge ) : bool
return bool

ContainsEdge() public method

public ContainsEdge ( source, target ) : bool
return bool

ContainsVertex() public method

public ContainsVertex ( vertex ) : bool
return bool

Degree() public method

public Degree ( vertex ) : int
return int

InDegree() public method

public InDegree ( vertex ) : int
return int

InEdge() public method

public InEdge ( vertex, int index ) : TEdge
index int
return TEdge

InEdges() public method

public InEdges ( vertex ) : IEnumerable
return IEnumerable

IsInEdgesEmpty() public method

public IsInEdgesEmpty ( vertex ) : bool
return bool

IsOutEdgesEmpty() public method

public IsOutEdgesEmpty ( vertex ) : bool
return bool

MergeVertex() public method

Removes the given vertex and merges all its connection to other vertices.
is . is . is not part of the graph.
public MergeVertex ( vertex, EdgeFactory edgeFactory ) : void
vertex The vertex.
edgeFactory EdgeFactory Factory method to create an edge.
return void

MergeVerticesIf() public method

Removes vertices matching the given vertexPredicate and merges all their connections to other vertices.
is . is .
public MergeVerticesIf ( VertexPredicate vertexPredicate, EdgeFactory edgeFactory ) : void
vertexPredicate VertexPredicate Predicate to match vertices.
edgeFactory EdgeFactory Factory method to create an edge.
return void

OnEdgeAdded() protected method

Called on each added edge.
protected OnEdgeAdded ( edge ) : void
edge Added edge.
return void

OnEdgeRemoved() protected method

Called on each removed edge.
protected OnEdgeRemoved ( edge ) : void
edge Removed edge.
return void

OnVertexAdded() protected method

Called on each added vertex.
protected OnVertexAdded ( vertex ) : void
vertex Added vertex.
return void

OnVertexRemoved() protected method

Called for each removed vertex.
protected OnVertexRemoved ( vertex ) : void
vertex Removed vertex.
return void

OutDegree() public method

public OutDegree ( vertex ) : int
return int

OutEdge() public method

public OutEdge ( vertex, int index ) : TEdge
index int
return TEdge

OutEdges() public method

public OutEdges ( vertex ) : IEnumerable
return IEnumerable

RemoveEdge() public method

public RemoveEdge ( edge ) : bool
return bool

RemoveEdgeIf() public method

public RemoveEdgeIf ( EdgePredicate predicate ) : int
predicate EdgePredicate
return int

RemoveInEdgeIf() public method

public RemoveInEdgeIf ( vertex, EdgePredicate predicate ) : int
predicate EdgePredicate
return int

RemoveOutEdgeIf() public method

public RemoveOutEdgeIf ( vertex, EdgePredicate predicate ) : int
predicate EdgePredicate
return int

RemoveVertex() public method

public RemoveVertex ( vertex ) : bool
return bool

RemoveVertexIf() public method

public RemoveVertexIf ( VertexPredicate predicate ) : int
predicate VertexPredicate
return int

TrimEdgeExcess() public method

public TrimEdgeExcess ( ) : void
return void

TryGetEdge() public method

public TryGetEdge ( source, target, &edge ) : bool
return bool

TryGetEdges() public method

public TryGetEdges ( source, target, IEnumerable &edges ) : bool
edges IEnumerable
return bool

TryGetInEdges() public method

public TryGetInEdges ( vertex, IEnumerable &edges ) : bool
edges IEnumerable
return bool

TryGetOutEdges() public method

public TryGetOutEdges ( vertex, IEnumerable &edges ) : bool
edges IEnumerable
return bool