Example #1
0
    public void AddEdge( Vertex start,  Vertex end, int weight )
    {
        AddEdge( start,end ); // Adds the start and end as adjacent
        start.AddWeight( weight ); // the direction layer takes care of that

        // if the graph is undirected you have to include
        // the weight of the edge coming back
        if ( isDirected==false )
            end.AddWeight( weight );
    }
Example #2
0
    public void AddEdge(Vertex start, Vertex end, int weight)
    {
        AddEdge(start, end);     // Adds the start and end as adjacent
        start.AddWeight(weight); // the direction layer takes care of that

        // if the graph is undirected you have to include
        // the weight of the edge coming back
        if (isDirected == false)
        {
            end.AddWeight(weight);
        }
    }
Example #3
0
    public void AddEdge(Vertex start, Neighbor theNeighbor)
    {
        original(start, theNeighbor);

        // At this point the edges are Added.
        // If there is an adorn like weight it has to be Added to
        // the neighbor already present there
        if (isDirected == false)
        {
            // It has to Add ONLY the weight object to the neighbor
            Vertex end = theNeighbor.neighbor;
            end.AddWeight(end, theNeighbor.weight);
        } // of else
    }