Ejemplo n.º 1
0
        internal override void UpdateEdgeData(AdjSetGraphVertex <T> vertex1, AdjSetGraphVertex <T> vertex2, Func <EdgeData, EdgeData> updateFunc)
        {
            VertexSetItem setItem1 = GetVertexSetItem(vertex1, vertex2);
            VertexSetItem setItem2 = GetVertexSetItem(vertex2, vertex1);

            setItem1.EdgeData = setItem2.EdgeData = updateFunc(setItem1.EdgeData);
        }
Ejemplo n.º 2
0
 protected override void CreateEdgeCore(AdjSetGraphVertex <T> vertex1, AdjSetGraphVertex <T> vertex2, double weight)
 {
     if (!ReferenceEquals(vertex1, vertex2) && Data.AreVerticesAdjacent(vertex1, vertex2))
     {
         throw new InvalidOperationException();
     }
     base.CreateEdgeCore(vertex1, vertex2, weight);
 }
Ejemplo n.º 3
0
 internal override void CreateEdge(AdjSetGraphVertex <T> vertex1, AdjSetGraphVertex <T> vertex2, double weight)
 {
     List[vertex1.Handle].AddVertex(vertex2, weight);
     if (!ReferenceEquals(vertex1, vertex2))
     {
         List[vertex2.Handle].AddVertex(vertex1, weight);
     }
 }
Ejemplo n.º 4
0
 protected override bool AllowEdge(VertexDisjointSet set, AdjSetGraphVertex <T> vertex)
 {
     return(vertex.Handle >= set.Vertex.Handle);
 }