Core/CafeLib.Core.Collections.DirectedGraph/Graph.cs
/// <summary>
/// Connects source and target verticies.
/// </summary>
/// <param name="source">source vertex</param>
/// <param name="target">target vertex</param>
/// <param name="weight">edge weight</param>
/// <param name="content">edge content</param>
/// <returns>the edges created by the connection</returns>
Connects source and target verticies.
Connects source and target verticies .
public IEdges Connect(IVertex source, IVertex target, int weight = 0, object content = null)
	    {
            Add(source);
            Add(target);
            ((Vertex<T>)source).Attach((Vertex<T>)target);
            var edges = FindEdges(source, target);
            edges.Successor.Weight = edges.Predecessor.Weight = weight;
            edges.Successor.Content = edges.Predecessor.Content = content;
            return edges;
        }
public IEdges Connect ( IVertex source , IVertex target , int weight = 0 , object content = null ) { Add ( source ) ; Add ( target ) ; ( ( Vertex < T > ) source ) . Attach ( ( Vertex < T > ) target ) ; var edges = FindEdges ( source , target ) ; edges . Successor . Weight = edges . Predecessor . Weight = weight ; edges . Successor . Content = edges . Predecessor . Content = content ; return edges ; }
Connects source and target verticies.
Connects source and target verticies .
the edges created by the connection
the edges created by the connection
source
IVertex
None
target
IVertex
None
weight
int
None
content
object
None