Class WeightedGraph


  • public class WeightedGraph
    extends java.lang.Object
    Author:
    Yana Valasatava
    • Constructor Summary

      Constructors 
      Constructor Description
      WeightedGraph()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.jgrapht.Graph<java.lang.Integer,​org.jgrapht.graph.DefaultWeightedEdge> build​(java.util.List<scala.Tuple3<java.lang.Integer,​java.lang.Integer,​java.lang.Double>> data)
      Builds a simple weighted graph
      static org.jgrapht.Graph<java.lang.Integer,​org.jgrapht.graph.DefaultWeightedEdge> getMinimumSpanningTree​(org.jgrapht.Graph<java.lang.Integer,​org.jgrapht.graph.DefaultWeightedEdge> graph)
      Builds a graph that contains a Minimum Spanning Tree
      static java.util.List<java.util.List<java.lang.Integer>> traverse​(org.jgrapht.Graph<java.lang.Integer,​org.jgrapht.graph.DefaultWeightedEdge> graph)
      Builds a path (root and branches) to traverse a graph
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WeightedGraph

        public WeightedGraph()
    • Method Detail

      • build

        public static org.jgrapht.Graph<java.lang.Integer,​org.jgrapht.graph.DefaultWeightedEdge> build​(java.util.List<scala.Tuple3<java.lang.Integer,​java.lang.Integer,​java.lang.Double>> data)
        Builds a simple weighted graph
        Parameters:
        data - The input list of tuples each holds two indices and distance between them
      • getMinimumSpanningTree

        public static org.jgrapht.Graph<java.lang.Integer,​org.jgrapht.graph.DefaultWeightedEdge> getMinimumSpanningTree​(org.jgrapht.Graph<java.lang.Integer,​org.jgrapht.graph.DefaultWeightedEdge> graph)
        Builds a graph that contains a Minimum Spanning Tree
        Parameters:
        graph - The input weighted graph
      • traverse

        public static java.util.List<java.util.List<java.lang.Integer>> traverse​(org.jgrapht.Graph<java.lang.Integer,​org.jgrapht.graph.DefaultWeightedEdge> graph)
        Builds a path (root and branches) to traverse a graph
        Parameters:
        graph - The input graph