Package ons.util

Class WeightedMultiGraph

java.lang.Object
ons.util.WeightedMultiGraph

public class WeightedMultiGraph
extends java.lang.Object
  • Constructor Details

  • Method Details

    • size

      public int size()
    • addEdge

      public void addEdge​(int source, int target, double weight)
    • removeEdge

      public void removeEdge​(int source, long id)
    • removeEdgesUntil

      public void removeEdgesUntil​(int source, long id)
    • getFirstEdge

      public Edge getFirstEdge​(int source)
    • getEdgeIterator

      public java.util.Iterator<Edge> getEdgeIterator​(int source)
    • getFirstEdge

      public Edge getFirstEdge​(int source, int target)
    • getEdges

      public java.util.TreeSet<Edge> getEdges​(int source)
    • isEdge

      public boolean isEdge​(int source, int target)
    • getEdges

      public java.util.ArrayList<Edge> getEdges​(int source, int target)
      Retrieves the set of the Edges linking this pair
      Parameters:
      source - the source node
      target - the destination node
      Returns:
      the the set of the Edges linking this pair, if the edge doesnt existing, returns null set
    • getWeight

      public double getWeight​(int source, int target, long id)
    • getWeight

      public double getWeight​(int source, int target)
    • setWeight

      public void setWeight​(int source, int target, long id, double w)
    • setWeight

      public void setWeight​(int source, int target, double w)
    • neighbors

      public int[] neighbors​(int vertex)
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • removeNodeEdge

      public void removeNodeEdge​(int node)
    • removeNode

      public void removeNode​(int node)
    • addNode

      public void addNode()
    • removeEdge

      public void removeEdge​(int source, int target)
    • getGraphDiameter

      public double getGraphDiameter()
      Retrieves the diameter of this graph.
      Returns:
      the longest of all the calculated shortest paths in a network