Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class GraphTimeElapsed {
- public static void main(String[] args){
- long start; //start time of the process
- long end;
- double timeElapsed;
- System.out.println(" Problem of size, Run time");
- //checking the time for the problem with different sizes [10;15]
- for(int i=10;i<=15;i++){ //5 repetitions
- for(int j=1;j<=5;j++){
- start = System.nanoTime();
- Graph graph = new Graph(i, 0.5);
- Colouring colouring = graph.bestColouring(3);
- graph.show(colouring);
- end=System.nanoTime();
- timeElapsed=(end-start)/1000000000.0;
- System.out.println(i+","+timeElapsed);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment