Package edu.uci.ics.jung.algorithms.shortestpath

Examples of edu.uci.ics.jung.algorithms.shortestpath.DijkstraDistance


  }
 
  public static int diameter(LearnerGraph graph)
  {// TODO: to rewrite using a flowgraph or not, given that this is only used once per experiment?
    DirectedSparseGraph g = graph.paths.getGraph();
    DijkstraDistance dd = new DijkstraDistance(g);
    Collection<Double> distances = dd.getDistanceMap(DeterministicDirectedSparseGraph.findInitial(g)).values();
    Double result =-1.;
    for(Double distance:distances) if (result<distance) result=distance;
    return result.intValue();
  }
View Full Code Here


  }
 
  @SuppressWarnings("unchecked")
  protected static int getEffectiveDiameter(DirectedSparseGraph machine)
  {
    DijkstraDistance p = new DijkstraDistance(machine);
    List<Integer> distances = new LinkedList<Integer>();

    for(DeterministicVertex v:(Set<DeterministicVertex>)machine.getVertices())
      for(DeterministicVertex vOther:(Set<DeterministicVertex>)machine.getVertices())
      {
        int length = 0;
        Number distance = p.getDistance(v, vOther);if (distance != null) length = distance.intValue();
        if (length > 0) // non-empty path
          distances.add(length);
        // cannot limit consideration to a triangular subset because the relation is not symmetric.
      }
   
View Full Code Here

  }
 
  @SuppressWarnings("unchecked")
  protected static int getEffectiveDiameter(DirectedSparseGraph machine)
  {
    DijkstraDistance p = new DijkstraDistance(machine);
    List<Integer> distances = new LinkedList<Integer>();
    for(DeterministicVertex v:(Set<DeterministicVertex>)machine.getVertices())
      for(DeterministicVertex vOther:(Set<DeterministicVertex>)machine.getVertices())
      {
        int length = 0;
        Number distance = p.getDistance(v, vOther);if (distance != null) length = distance.intValue();
        if (length > 0) // non-empty path
          distances.add(length);
        if (v == vOther)
          break;// we only process a triangular subset.
      }
View Full Code Here

  }
 
  public static int diameter(LearnerGraph graph)
  {// Decided not to rewrite using a flowgraph or not, given that this is only used once per experiment.
    DirectedSparseGraph g = graph.pathroutines.getGraph();
    DijkstraDistance dd = new DijkstraDistance(g);
    Collection<Double> distances = dd.getDistanceMap(DeterministicDirectedSparseGraph.findInitial(g)).values();
    Double result =-1.;
    for(Double distance:distances) if (result<distance) result=distance;
    return result.intValue();
  }
View Full Code Here

   
  }
 
  protected static int getEffectiveDiameter(DirectedSparseGraph machine)
  {
    DijkstraDistance p = new DijkstraDistance(machine);
    List<Integer> distances = new LinkedList<Integer>();
    for(DeterministicVertex v:(Set<DeterministicVertex>)machine.getVertices())
      for(DeterministicVertex vOther:(Set<DeterministicVertex>)machine.getVertices())
      {
        int length = 0;
        Number distance = p.getDistance(v, vOther);if (distance != null) length = distance.intValue();
        if (length > 0) // non-empty path
          distances.add(length);
        if (v == vOther)
          break;// we only process a triangular subset.
      }
View Full Code Here

   
  }
 
  protected static int getEffectiveDiameter(DirectedSparseGraph machine)
  {
    DijkstraDistance p = new DijkstraDistance(machine);
    List<Integer> distances = new LinkedList<Integer>();
    for(DeterministicVertex v:(Set<DeterministicVertex>)machine.getVertices())
      for(DeterministicVertex vOther:(Set<DeterministicVertex>)machine.getVertices())
      {
        int length = 0;
        Number distance = p.getDistance(v, vOther);if (distance != null) length = distance.intValue();
        if (length > 0) // non-empty path
          distances.add(length);
        if (v == vOther)
          break;// we only process a triangular subset.
      }
View Full Code Here

  }
 
  public static int diameter(LearnerGraph graph)
  {// Decided not to rewrite using a flowgraph or not, given that this is only used once per experiment.
    DirectedSparseGraph g = graph.pathroutines.getGraph();
    DijkstraDistance dd = new DijkstraDistance(g);
    @SuppressWarnings("unchecked")
    Collection<Double> distances = dd.getDistanceMap(DeterministicDirectedSparseGraph.findInitial(g)).values();
    Double result =-1.;
    for(Double distance:distances) if (result<distance) result=distance;
    return result.intValue();
  }
View Full Code Here

  }
 
  public static int diameter(LearnerGraph graph)
  {// Decided not to rewrite using a flowgraph or not, given that this is only used once per experiment.
    DirectedSparseGraph g = graph.pathroutines.getGraph();
    DijkstraDistance dd = new DijkstraDistance(g);
    @SuppressWarnings("unchecked")
    Collection<Double> distances = dd.getDistanceMap(DeterministicDirectedSparseGraph.findInitial(g)).values();
    Double result =-1.;
    for(Double distance:distances) if (result<distance) result=distance;
    return result.intValue();
  }
View Full Code Here

   
  }
 
  protected static int getEffectiveDiameter(DirectedSparseGraph machine)
  {
    DijkstraDistance p = new DijkstraDistance(machine);
    List<Integer> distances = new LinkedList<Integer>();
    for(DeterministicVertex v:(Set<DeterministicVertex>)machine.getVertices())
      for(DeterministicVertex vOther:(Set<DeterministicVertex>)machine.getVertices())
      {
        int length = 0;
        Number distance = p.getDistance(v, vOther);if (distance != null) length = distance.intValue();
        if (length > 0) // non-empty path
          distances.add(length);
        if (v == vOther)
          break;// we only process a triangular subset.
      }
View Full Code Here

   
  }
 
  protected static int getEffectiveDiameter(DirectedSparseGraph machine)
  {
    DijkstraDistance p = new DijkstraDistance(machine);
    List<Integer> distances = new LinkedList<Integer>();
    for(DeterministicVertex v:(Set<DeterministicVertex>)machine.getVertices())
      for(DeterministicVertex vOther:(Set<DeterministicVertex>)machine.getVertices())
      {
        int length = 0;
        Number distance = p.getDistance(v, vOther);if (distance != null) length = distance.intValue();
        if (length > 0) // non-empty path
          distances.add(length);
        if (v == vOther)
          break;// we only process a triangular subset.
      }
View Full Code Here

TOP

Related Classes of edu.uci.ics.jung.algorithms.shortestpath.DijkstraDistance

Copyright © 2018 www.massapicom. 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.