public Edge( Vertex source, Vertex sink) { _source = source; _sink = sink; }
public Edge( object sourceKey, object sinkKey) { _source = new Vertex( sourceKey ); _sink = new Vertex( sinkKey ); }
public virtual Edge GetEdge( Vertex source, Vertex sink) { Edge targetEdge = new Edge( source, sink ); return (Edge) Edges.FindMatch( targetEdge ); }
public virtual ArrayList GetEdgesTo( Vertex sink) { ArrayList edgesTo = new ArrayList(); foreach ( Edge currentEdge in Edges ) { if ( currentEdge.Sink == sink ) { edgesTo.Add( currentEdge ); } } return edgesTo; }
public virtual ArrayList GetEdgesFrom( Vertex source) { ArrayList edgesFrom = new ArrayList(); foreach ( Edge currentEdge in Edges ) { if ( currentEdge.Source == source ) { edgesFrom.Add( currentEdge ); } } return edgesFrom; }
public virtual Vertex GetVertex( object key) { Vertex targetVertex = new Vertex( key ); return (Vertex) Vertices.FindMatch( targetVertex ); }
public abstract Edge AddEdge( Vertex source, Vertex sink);
public abstract bool RemoveVertex( Vertex targetVertex);
public void AddNeighbor(Vertex neighbor, int weight) { _Neighbors.Add(new Neighbor(neighbor, weight)); }