/** * {@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()); } }
/** * {@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()); } }