TWiki . Doc . PrimMinimumSpanningTreeExample

// compilation unit Prim.nice
package graph;

<Edge,Vertex,Distance,T | Edge <: GraphEdge<Vertex> > 
void primMinimumSpanningTree(
   VertexListAndIncidenceGraph<Vertex,Edge> graph,
   Vertex s,
   ReadWritePropertyMap<Vertex,Vertex> predecessor,
   ReadWritePropertyMap<Vertex,Distance> distance,
   ReadablePropertyMap<Edge,Distance> weight,
   (Distance, Distance)->boolean compare,
   Distance inf,
   Distance zero
   ){
   
   dijkstraShortestPaths(
      graph, s, predecessor, distance, weight, compare, 
      (Distance d1, Distance d2)=>d2, 
      inf, zero);
}
-- IsaacGouy - 07 Jan 2004

----- Revision r1.7 - 28 Apr 2005 - 11:55 GMT - TWikiGuest
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.