Guest User

Untitled

a guest
Jun 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1.  
  2. public class GraphTimeElapsed {
  3. public static void main(String[] args){
  4. long start; //start time of the process
  5. long end;
  6. double timeElapsed;
  7.  
  8. System.out.println(" Problem of size, Run time");
  9. //checking the time for the problem with different sizes [10;15]
  10. for(int i=10;i<=15;i++){ //5 repetitions
  11. for(int j=1;j<=5;j++){
  12. start = System.nanoTime();
  13. Graph graph = new Graph(i, 0.5);
  14. Colouring colouring = graph.bestColouring(3);
  15. graph.show(colouring);
  16. end=System.nanoTime();
  17. timeElapsed=(end-start)/1000000000.0;
  18. System.out.println(i+","+timeElapsed);
  19. }
  20. }
  21.  
  22. }
  23.  
  24. }
Add Comment
Please, Sign In to add comment