2016-02-23 13:34:10 +01:00
|
|
|
package main;
|
|
|
|
|
2016-03-14 20:30:30 +01:00
|
|
|
import org.graphstream.graph.Graph;
|
|
|
|
import org.graphstream.graph.implementations.SingleGraph;
|
|
|
|
|
2016-03-14 18:02:24 +01:00
|
|
|
import structure.Grid;
|
2016-03-14 16:35:31 +01:00
|
|
|
|
2016-02-23 13:34:10 +01:00
|
|
|
public class Main {
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
2016-03-14 18:02:24 +01:00
|
|
|
Grid g=new Grid();
|
2016-03-14 18:27:27 +01:00
|
|
|
g.printLinkWeight();
|
|
|
|
System.out.println("Best link : " + g.getBestLinkIndex());
|
2016-03-14 20:30:30 +01:00
|
|
|
Graph graph = new SingleGraph("Tutorial 1");
|
|
|
|
|
|
|
|
graph.addNode("A");
|
|
|
|
graph.addNode("B");
|
|
|
|
graph.addNode("C");
|
|
|
|
graph.addEdge("AB", "A", "B");
|
|
|
|
graph.addEdge("BC", "B", "C");
|
|
|
|
graph.addEdge("CA", "C", "A");
|
|
|
|
graph.getEdge(0).addAttribute("ui.style", "fill-color: red;");
|
|
|
|
|
|
|
|
graph.display(false);
|
2016-02-23 13:34:10 +01:00
|
|
|
}
|
|
|
|
}
|