Package org.biojava.spark.graph
Class WeightedGraph
- java.lang.Object
-
- org.biojava.spark.graph.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 graphstatic 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 Treestatic 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
-
-
-
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
-
-