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