Examples of KShortestPaths


Examples of org.jgrapht.alg.KShortestPaths

      ++totalProcessed;
      if (totalProcessed % 1000 == 0) {
        logger.info("Processed: " + totalProcessed + " curr_dia: " + diameter);
      }
     
      KShortestPaths<Vertex,DefaultWeightedEdge> ksp = new KShortestPaths(g, v, 1);
      // kShortestPathMap.put(v, new KShortestPaths(g, v, _kPrime));
     
      Iterator<Vertex> vIter2 = g.vertexSet().iterator();
      while (vIter2.hasNext()) {
        Vertex nv = vIter2.next();
       
        // skip self comparison
        if (v.equals(nv)) { continue; }

        List<GraphPath<Vertex,DefaultWeightedEdge>> paths = ksp.getPaths(nv);
       
        if (paths == null) { isConnected = false; }
        else  if (paths.get(0).getEdgeList().size() > diameter) {
          diameter = paths.get(0).getEdgeList().size();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.