1) Please look at the program http://www.cs.rpi.edu/~moorthy/Courses/CSCI2300/Graph2015-5-1.cc 2) Please look at the program http://www.cs.rpi.edu/~moorthy/Courses/CSCI2300/Graph2015-5-2.cc 3.1) For eight vertices directed graph two stringly connected components are size 7 and 1 respectively. So the maximum number of edges will be 7*6+7=49 For n vertices it will be (n-1)^2. (=(n-1)*(n-2)+n-1) With three strongly connected components (components size will be 6, 1, 1) the maximum number of edges with be 6*5+6+7 = 42 For n vertices it will be (n-2)*(n-3)+n-2+n-1= n^2-3n+3 3.2) Solution in http://www.cs.rpi.edu//~moorthy/Courses/CSCI2300/Graph2015-5-3-2.cc