Example #1
0
        public override double getEdgeWeight(E e)
        {
            IntrusiveWeightedEdge ie = getIntrusiveEdge(e);

            if (ie == null)
            {
                throw new ArgumentException("no such edge in graph: " + e.ToString());
            }
            return(ie.weight);
        }
Example #2
0
        public override void setEdgeWeight(E e, double weight)
        {
            IntrusiveWeightedEdge ie = getIntrusiveEdge(e);

            if (ie == null)
            {
                throw new ArgumentException("no such edge in graph: " + e.ToString());
            }
            ie.weight = weight;
        }
Example #3
0
        public override void add(E e, V sourceVertex, V targetVertex)
        {
            IntrusiveWeightedEdge intrusiveEdge;

            if (e is IntrusiveWeightedEdge)
            {
                intrusiveEdge = e as IntrusiveWeightedEdge;
            }
            else
            {
                intrusiveEdge = new IntrusiveWeightedEdge();
            }
            intrusiveEdge.source = sourceVertex;
            intrusiveEdge.target = targetVertex;
            edgeMap[e]           = intrusiveEdge;
        }