Commit 42ae9e27 authored by Moritz Leibauer's avatar Moritz Leibauer
Browse files

Addet Algorithm Templates

parent 0cbf75c2
......@@ -28,15 +28,23 @@ public class mySpanningTree {
//Receives a graph and computes a minimum spanning tree
public static AsSubgraph<Integer, DefaultWeightedEdge> computeMST(Graph<Integer, DefaultWeightedEdge> graph) {
AsSubgraph<Integer, DefaultWeightedEdge> tree = new AsSubgraph<Integer, DefaultWeightedEdge>(graph, graph.vertexSet(), new HashSet<DefaultWeightedEdge>());
/**
*
* Implement your algorithm here
*
**/
// Implement your algorithm here
tree = primAlgorithm(tree, graph);
//tree = kruskalAlgorithm(tree, graph);
return tree;
}
public static AsSubgraph<Integer, DefaultWeightedEdge> primAlgorithm(AsSubgraph<Integer, DefaultWeightedEdge> tree, Graph<Integer, DefaultWeightedEdge> graph) {
// Input: tree ->
return tree;
}
public static AsSubgraph<Integer, DefaultWeightedEdge> kruskalAlgorithm(AsSubgraph<Integer, DefaultWeightedEdge> tree, Graph<Integer, DefaultWeightedEdge> graph) {
// Input: tree ->
return tree;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment