/**
         * {@inheritDoc}
         */
        public double getPathWeight(V source, V sink)
        {
            GraphPath <V, E> p = getPath(source, sink);

            if (p == null)
            {
                return(Double.PositiveInfinity);
            }
            else
            {
                return(p.getWeight());
            }
        }
示例#2
0
        /**
         * {@inheritDoc}
         */
        public double getWeight(V targetVertex)
        {
            GraphPath <V, E> p = paths[targetVertex];

            if (p == null)
            {
                if (source.Equals(targetVertex))
                {
                    return(0d);
                }
                else
                {
                    return(Double.PositiveInfinity);
                }
            }
            else
            {
                return(p.getWeight());
            }
        }