// Copyright 2003, Trustees of Indiana University // Please see the license in the file ../LICENSE // Relax function from BGL public class relax { public static bool go (Edge e, WeightMap w, DistanceMap d, PredecessorMap pi, Combine combine, Compare compare) where Edge: GraphEdge, WeightMap: ReadablePropertyMap, DistanceMap: ReadWritePropertyMap, PredecessorMap: ReadWritePropertyMap, Combine: BinaryFunction, Compare: StrictWeakOrdering { Distance dnew = combine.op(((ReadWritePropertyMap)d)[e.source], ((ReadablePropertyMap)w)[e]); if (compare.less(dnew, ((ReadWritePropertyMap)d)[e.target])) { ((ReadWritePropertyMap)d)[e.target] = dnew; ((ReadWritePropertyMap)pi)[e.target] = e.source; return true; } return false; } }