Author: Shenyong Guan(8604539) Date:2017-04-15
SourceCode folder includes the code and the libraries used in the program. Examples represent some examples generated by the program. /* GreedySpanner.jar is an executable jar file can be executed by double click or accessed by command line. Blocked by the gmail, so I took this file away. */
SouceCode: DrawSpanner.java is a class with main function to draw the UI and show the graph. Dijkstra.java is a class for implementing the Dijkstra Algorithm to get the shortest path. Line.java is a class for drawing the line. Ring.java is a class for drawing the ring. PointsByDistance is a class for calculating the distance of each pair of points in increasing order.
Application step:
- Pick several points on the canvas.
- Insert t in the menu item (If no inster, default is 1).
- Click the 'Compute' button then will show the t spanner graph.
- Click the 'Show' button in the menu item will show the pair with biggest spanning ratio.
- Press 'Clear' button can clean the canvas (but t will not be changed).
- Click the existed point will delete that point and all the edges will clear until press 'Compute' again to have a new spanner graph (t remains).