delete dynamic arrays' code and insert function to count degrees
graph write dot file and vertices' degree